Builders for MCP content blocks and resource contents.
Content blocks (text, image, audio, resource_link, embedded) appear in
tool-call results and prompt messages. Resource contents (text_resource,
blob_resource) appear in resources/read results.
Every builder returns a plain map with atom keys, ready to be JSON-encoded. Optional
members (annotations, _meta) are only included when provided.
Summary
Functions
An audio content block carrying base64-encoded data and its MIME type.
Binary resource contents (base64-encoded) for a resources/read result.
An embedded resource content block. resource_contents must be a map built by
text_resource/3 or blob_resource/3 (or an equivalent shape).
An image content block carrying base64-encoded data and its MIME type.
A resource link content block. Accepts an Urchin.Resource struct or a map carrying
at least :uri/:name.
A text content block.
Text resource contents for a resources/read result.
Types
Functions
An audio content block carrying base64-encoded data and its MIME type.
Binary resource contents (base64-encoded) for a resources/read result.
Options
:mime_type- MIME type of the resource:meta- value for the_metafield
An embedded resource content block. resource_contents must be a map built by
text_resource/3 or blob_resource/3 (or an equivalent shape).
An image content block carrying base64-encoded data and its MIME type.
@spec resource_link(Urchin.Resource.t() | map(), opts()) :: block()
A resource link content block. Accepts an Urchin.Resource struct or a map carrying
at least :uri/:name.
A text content block.
Options
:annotations- client annotations map:meta- value for the_metafield
Text resource contents for a resources/read result.
Options
:mime_type- MIME type of the resource:meta- value for the_metafield