OzMcp.Structs.TextContent (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build TextContent structure.

(MCP protocol: 2025-11-25)

Short example:

%TextContent{}
  |> TextContent.text("Hello, world!")
  |> TextContent.build()

Result:

%{type: "text", text: "Hello, world!"}

Specification: TextContent

Fields

FieldSetterTypeRequired
texttext/2stringyes
_meta_meta/2mapno
annotationsannotations/2OzMcp.Structs.Annotations.t/0no

Summary

Types

t()

@type t() :: %OzMcp.Structs.TextContent{
  _meta: map() | nil,
  annotations: OzMcp.Structs.Annotations.t() | nil,
  text: String.t()
}

Functions

annotations(struct, value)

@spec annotations(t(), OzMcp.Structs.Annotations.t() | nil) :: t()

build(struct)

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

text(struct, value)

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