Typed constructors for MCP content returned by handlers.
Constructors emit canonical string-key maps and raise ArgumentError for
invalid programmer input. Image, audio, and blob arguments are already
Base64-encoded wire values; only canonical padded Base64 is accepted.
Constructors use the secure 2,000,000-byte default; pass
max_json_bytes: server_budget when the supervised server explicitly uses a
larger finite JSON budget.
Raw maps remain supported by AttestoMCP.Server for hosts that need custom
extension members.
Summary
Functions
Builds an audio content block from canonical padded Base64 data.
Builds an embedded-resource content block from one resource content entry.
Builds an image content block from canonical padded Base64 data.
Builds one user or assistant prompt message.
Builds a blob resource-content entry from canonical padded Base64 data.
Builds a resource-link content block.
Builds a text resource-content entry.
Builds a text content block.
Types
@type budget_option() :: {:max_json_bytes, pos_integer()}
@type common_option() :: {:annotations, map()} | {:meta, map()} | budget_option()
@type resource_content_option() :: {:mime_type, String.t()} | {:meta, map()} | {:annotations, map()} | {:icons, [map()]} | budget_option()
@type resource_link_option() :: common_option() | {:title, String.t()} | {:description, String.t()} | {:mime_type, String.t()} | {:size, non_neg_integer()} | {:icons, [map()]}
@type role() :: :user | :assistant | String.t()
Functions
@spec audio(String.t(), String.t(), [common_option()]) :: t()
Builds an audio content block from canonical padded Base64 data.
@spec embedded_resource(resource_content(), [common_option()]) :: t()
Builds an embedded-resource content block from one resource content entry.
@spec image(String.t(), String.t(), [common_option()]) :: t()
Builds an image content block from canonical padded Base64 data.
@spec prompt_message(role(), t(), [budget_option()]) :: prompt_message()
Builds one user or assistant prompt message.
@spec resource_blob(String.t(), String.t(), [resource_content_option()]) :: resource_content()
Builds a blob resource-content entry from canonical padded Base64 data.
@spec resource_link(String.t(), String.t(), [resource_link_option()]) :: t()
Builds a resource-link content block.
@spec resource_text(String.t(), String.t(), [resource_content_option()]) :: resource_content()
Builds a text resource-content entry.
@spec text(String.t(), [common_option()]) :: t()
Builds a text content block.