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-swarmhandoffcreate_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
    )
    ->
    BaseTool

    Parameters

    NameTypeDescription
    agent_name*str
    namestr | None
    Default:None
    descriptionstr | None
    Default:None

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

    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>).

    Optional name of the tool to use for the handoff.

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

    Optional description for the handoff tool.

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