LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    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
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.prebuilttool_nodeToolCallWrapper
    Attribute●Since v1.0

    ToolCallWrapper

    Wrapper for tool call execution with multi-call support.

    Copy
    ToolCallWrapper = Callable[[ToolCallRequest, Callable[[ToolCallRequest], ToolMessage | Command]], ToolMessage | Command]

    Wrapper receives:

    request: ToolCallRequest with tool_call, tool, state, and runtime. execute: Callable to execute the tool (CAN BE CALLED MULTIPLE TIMES).

    The execute callable can be invoked multiple times for retry logic, with potentially modified requests each time. Each call to execute is independent and stateless.

    Note

    When implementing middleware for create_agent, use AgentMiddleware.wrap_tool_call which provides properly typed state parameter for better type safety.

    View source on GitHub