Home / Class/ ServerToolResult Class — langchain Architecture

ServerToolResult Class — langchain Architecture

Architecture documentation for the ServerToolResult class in content.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9b81b2bc_e8c3_580a_ec8b_ae96263abb90["ServerToolResult"]
  c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"]
  9b81b2bc_e8c3_580a_ec8b_ae96263abb90 -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630

Relationship Graph

Source Code

libs/core/langchain_core/messages/content.py lines 425–453

class ServerToolResult(TypedDict):
    """Result of a server-side tool call."""

    type: Literal["server_tool_result"]
    """Used for discrimination."""

    id: NotRequired[str]
    """Unique identifier for this server tool result.

    Either:

    - Generated by the provider
    - Generated by LangChain upon creation (`UUID4` prefixed with `'lc_'`))
    """

    tool_call_id: str
    """ID of the corresponding server tool call."""

    status: Literal["success", "error"]
    """Execution status of the server-side tool."""

    output: NotRequired[Any]
    """Output of the executed tool."""

    index: NotRequired[int | str]
    """Index of block in aggregate response. Used during streaming."""

    extras: NotRequired[dict[str, Any]]
    """Provider-specific metadata."""

Frequently Asked Questions

What is the ServerToolResult class?
ServerToolResult is a class in the langchain codebase, defined in libs/core/langchain_core/messages/content.py.
Where is ServerToolResult defined?
ServerToolResult is defined in libs/core/langchain_core/messages/content.py at line 425.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free