OzMcp.Structs.TextResourceContents (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build TextResourceContents structure.

(MCP protocol: 2025-11-25)

Short example:

%TextResourceContents{}
  |> TextResourceContents.uri("file:///logs/app.log")
  |> TextResourceContents.text("INFO App started")
  |> TextResourceContents.mime_type("text/plain")
  |> TextResourceContents.build()

Result:

%{
  text: "INFO App started",
  uri: "file:///logs/app.log",
  mimeType: "text/plain"
}

Specification: TextResourceContents

Fields

FieldSetterTypeRequired
uriuri/2stringyes
texttext/2stringyes
mimeTypemime_type/2stringno
_meta_meta/2mapno

Summary

Types

t()

@type t() :: %OzMcp.Structs.TextResourceContents{
  _meta: map() | nil,
  mimeType: String.t() | nil,
  text: String.t(),
  uri: String.t()
}

Functions

build(struct)

@spec build(t()) :: map()

mime_type(struct, value)

@spec mime_type(t(), String.t() | nil) :: t()

text(struct, value)

@spec text(t(), String.t()) :: t()

uri(struct, value)

@spec uri(t(), String.t()) :: t()