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-supervisorhandoffcreate_handoff_tool
    Function●Since v0.0

    create_handoff_tool

    Copy
    create_handoff_tool(
      *,
      agent_name: str,
      name: str | None = None,
      description: str
    View source on GitHub
    |
    None
    =
    None
    ,
    add_handoff_messages
    :
    bool
    =
    True
    )
    ->
    BaseTool

    Parameters

    NameTypeDescription
    agent_name*str

    The name of the agent to handoff control to, i.e. the name of the agent node in the multi-agent graph.

    Agent names should be simple, clear and unique, preferably in snake_case, although you are only limited to the names accepted by LangGraph nodes as well as the tool names accepted by LLM providers (the tool name will look like this: transfer_to_<agent_name>).

    namestr | None
    Default:None

    Optional name of the tool to use for the handoff.

    If not provided, the tool name will be transfer_to_<agent_name>.

    descriptionstr | None
    Default:None

    Optional description for the handoff tool.

    If not provided, the description will be Ask agent <agent_name> for help.

    add_handoff_messagesbool
    Default:True

    Create a tool that can handoff control to the requested agent.

    Whether to add handoff messages to the message history.

    If False, the handoff messages will be omitted from the message history.