LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.prebuilt_tool_call_streamToolCallStream
    Class●Since v1.1

    ToolCallStream

    Scoped view of a single tool call's lifecycle.

    Yielded on run.tool_calls once per tool-started event. Fields are populated as events arrive:

    • tool_call_id, tool_name, input: stable from the start event.
    • output_deltas: a StreamChannel of delta chunks. Iterate (sync or async) to consume partial output in arrival order.
    • output: terminal payload from tool-finished, or None if the call failed or is still in flight.
    • error: terminal error string from tool-error, or None if the call succeeded or is still in flight.
    • completed: True once a terminal event (tool-finished or tool-error) has been observed.

    ToolCallStream is not meant to be constructed by end users — it's produced by ToolCallTransformer as events flow through the mux.

    Copy
    ToolCallStream(
      self,
      tool_call_id: str,
      tool_name: str,
      input: dict[str, Any] | None = None
    )

    Parameters

    NameTypeDescription
    tool_call_id*str

    The tool_call_id from the AIMessage.

    tool_name*str

    The tool's name.

    inputdict[str, Any] | None
    Default:None

    The tool's input arguments (as reported by on_tool_start), or None if none were captured.

    Constructors

    constructor
    __init__
    NameType
    tool_call_idstr
    tool_namestr
    inputdict[str, Any] | None

    Attributes

    attribute
    tool_call_id: tool_call_id
    attribute
    tool_name: tool_name
    attribute
    input: input
    attribute
    output: Any
    attribute
    error: str | None
    attribute
    completed: bool
    attribute
    output_deltas: StreamChannel[Any]

    The channel of streamed tool-output-delta payloads.

    Iterate (sync or async depending on how the run was started) to consume partial output in arrival order. The log closes when the tool finishes or errors.

    View source on GitHub