ClaudeCode.Content.ServerToolResultBlock (ClaudeCode v0.36.3)

View Source

Represents a server-side tool result content block within a Claude message.

Server tool result blocks contain the output from server-side tool executions such as web_search, web_fetch, code_execution, bash_code_execution, text_editor_code_execution, and tool_search. Unlike regular tool_result blocks, these results come from tools executed by the API itself.

The type field distinguishes the specific tool (e.g., :web_search_tool_result, :code_execution_tool_result), mirroring how ServerToolUseBlock uses its name field for the use side.

Known Types

  • :web_search_tool_result - Web search results or error
  • :web_fetch_tool_result - Web page fetch results or error
  • :code_execution_tool_result - Code execution results, errors, or encrypted results
  • :bash_code_execution_tool_result - Bash code execution results or error
  • :text_editor_code_execution_tool_result - Text editor code execution results or error
  • :tool_search_tool_result - Tool search results or error

Summary

Types

server_tool_result_type()

@type server_tool_result_type() ::
  :web_search_tool_result
  | :web_fetch_tool_result
  | :code_execution_tool_result
  | :bash_code_execution_tool_result
  | :text_editor_code_execution_tool_result
  | :tool_search_tool_result

t()

@type t() :: %ClaudeCode.Content.ServerToolResultBlock{
  caller: map() | nil,
  content: term(),
  tool_use_id: String.t(),
  type: server_tool_result_type()
}

Functions

new(data)

@spec new(map()) :: {:ok, t()} | {:error, atom() | {:missing_fields, [atom()]}}