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-coremessagescontentcreate_tool_call
    Function●Since v1.0

    create_tool_call

    Copy
    create_tool_call(
      name: str,
      args: dict[str, Any],
      *,
      id: 
    View source on GitHub
    str
    |
    None
    =
    None
    ,
    index
    :
    int
    |
    str
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    ToolCall

    Parameters

    NameTypeDescription
    name*str

    The name of the tool to be called.

    args*dict[str, Any]

    The arguments to the tool call.

    idstr | None
    Default:None
    indexint | str | None
    Default:None

    Create a ToolCall.

    The id is generated automatically if not provided, using a UUID4 format prefixed with 'lc_' to indicate it is a LangChain-generated ID.

    An identifier for the tool call.

    Generated automatically if not provided.

    Index of block in aggregate response.

    Used during streaming.