Noizu.MCP.Types.ToolResult (Noizu MCP v0.1.1)

Copy Markdown View Source

The result of a tools/call — content blocks, optional structured content, and the isError execution-error flag.

Summary

Functions

Tool execution error (isError: true) — visible to the model.

Successful result from content blocks, a binary, or a structured map.

Successful structured result. Includes a JSON-serialized text block alongside structuredContent for backward compatibility, as the spec requires.

Types

t()

@type t() :: %Noizu.MCP.Types.ToolResult{
  content: [Noizu.MCP.Types.Content.t()],
  is_error: boolean(),
  meta: map() | nil,
  structured: map() | nil
}

Functions

error(content)

Tool execution error (isError: true) — visible to the model.

from_map(map)

@spec from_map(map()) :: t()

ok(content)

Successful result from content blocks, a binary, or a structured map.

ok?(tool_result)

@spec ok?(t()) :: boolean()

structured(value)

@spec structured(map()) :: t()

Successful structured result. Includes a JSON-serialized text block alongside structuredContent for backward compatibility, as the spec requires.

to_map(result)

@spec to_map(t()) :: map()