Helper module used to build ToolResultContent structure: the result of a
tool call, inside a sampling message.
(MCP protocol: 2025-11-25)
Short example:
%ToolResultContent{}
|> ToolResultContent.tool_use_id("call_1")
|> ToolResultContent.content([%TextContent{} |> TextContent.text("18 C")])
|> ToolResultContent.build()Result:
%{type: "tool_result", toolUseId: "call_1", content: [%{type: "text", text: "18 C"}]}Specification: ToolResultContent
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
toolUseId | tool_use_id/2 | string | yes |
content | content/2 | list() | yes |
structuredContent | structured_content/2 | map | no |
isError | is_error/2 | boolean | no |
_meta | _meta/2 | map | no |