Response helpers for the modern server DSL.
When a module uses ExMCP.Server.DSL, this module is aliased as ToolResult.
Outside DSL modules, call the functions via ExMCP.Server.DSL.Result.
Building results
ToolResult.text("hello")
ToolResult.error("something went wrong")
ToolResult.structured("done", %{count: 1})Normalization
Handlers may also return plain values; the DSL normalizes them:
- binaries and
%{text: ...}→ text content %{content: ...}maps → used as tool results{:ok, result}/{:ok, result, state}/{:error, reason}tuples
Summary
Functions
Builds an error tool result.
Suspends a modern tool, resource, or prompt result for MRTR input.
Builds a tool result with both text and structured content.
Builds a text tool result.
Functions
Builds an error tool result.
@spec input_required(map(), term()) :: ExMCP.Server.MRTR.InputRequired.t()
Suspends a modern tool, resource, or prompt result for MRTR input.
The optional application state must be JSON encodable. ExMCP seals it into
an opaque requestState; handlers can read it on the retry through
ExMCP.Server.Context.request_state/0.
Builds a tool result with both text and structured content.
Builds a text tool result.