LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessagestoolToolCall
    Class●Since v0.1

    ToolCall

    Represents an AI's request to call a tool.

    Copy
    ToolCall()

    Bases

    TypedDict

    Example:

    {"name": "foo", "args": {"a": 1}, "id": "123"}

    This represents a request to call the tool named 'foo' with arguments {"a": 1} and an identifier of '123'.

    tool_call may also be used as a factory to create a ToolCall. Benefits include:

    • Required arguments strictly validated at creation time

    Used in Docs

    • Quickstart
    • Workflows and agents

    Constructors

    constructor
    __init__
    NameType
    namestr
    argsdict[str, Any]
    idstr | None
    typeNotRequired[Literal['tool_call']]

    Attributes

    attribute
    name: str

    The name of the tool to be called.

    attribute
    args: dict[str, Any]

    The arguments to the tool call as a dictionary.

    attribute
    id: str | None

    An identifier associated with the tool call.

    An identifier is needed to associate a tool call request with a tool call result in events when multiple concurrent tool calls are made.

    attribute
    type: NotRequired[Literal['tool_call']]

    Used for discrimination.

    View source on GitHub