Home / Function/ tool_call() — langchain Function Reference

tool_call() — langchain Function Reference

Architecture documentation for the tool_call() function in tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  64f5f480_21f9_a113_f62b_7946632322d5["tool_call()"]
  210f83c5_4be3_e20e_b877_98a194178520["tool.py"]
  64f5f480_21f9_a113_f62b_7946632322d5 -->|defined in| 210f83c5_4be3_e20e_b877_98a194178520
  c3cea370_0eb2_ed10_0436_0c051020ac26["default_tool_parser()"]
  c3cea370_0eb2_ed10_0436_0c051020ac26 -->|calls| 64f5f480_21f9_a113_f62b_7946632322d5
  style 64f5f480_21f9_a113_f62b_7946632322d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/tool.py lines 242–258

def tool_call(
    *,
    name: str,
    args: dict[str, Any],
    id: str | None,
) -> ToolCall:
    """Create a tool call.

    Args:
        name: The name of the tool to be called.
        args: The arguments to the tool call as a dictionary.
        id: An identifier associated with the tool call.

    Returns:
        The created tool call.
    """
    return ToolCall(name=name, args=args, id=id, type="tool_call")

Subdomains

Frequently Asked Questions

What does tool_call() do?
tool_call() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/tool.py.
Where is tool_call() defined?
tool_call() is defined in libs/core/langchain_core/messages/tool.py at line 242.
What calls tool_call()?
tool_call() is called by 1 function(s): default_tool_parser.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free