Home / Function/ _is_builtin_tool() — langchain Function Reference

_is_builtin_tool() — langchain Function Reference

Architecture documentation for the _is_builtin_tool() function in chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f0c80129_8b9d_d60d_2093_7e4d90e48a1e["_is_builtin_tool()"]
  a85819c7_917d_4c71_2864_a19e68947340["chat_models.py"]
  f0c80129_8b9d_d60d_2093_7e4d90e48a1e -->|defined in| a85819c7_917d_4c71_2864_a19e68947340
  b4ebc2e5_c582_39ab_6403_117a559ab366["bind_tools()"]
  b4ebc2e5_c582_39ab_6403_117a559ab366 -->|calls| f0c80129_8b9d_d60d_2093_7e4d90e48a1e
  style f0c80129_8b9d_d60d_2093_7e4d90e48a1e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/langchain_anthropic/chat_models.py lines 171–186

def _is_builtin_tool(tool: Any) -> bool:
    """Check if a tool is a built-in (server-side) Anthropic tool.

    `tool` must be a `dict` and have a `type` key starting with one of the known
    built-in tool prefixes.

    [Claude docs](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)
    """
    if not isinstance(tool, dict):
        return False

    tool_type = tool.get("type")
    if not tool_type or not isinstance(tool_type, str):
        return False

    return any(tool_type.startswith(prefix) for prefix in _BUILTIN_TOOL_PREFIXES)

Domain

Subdomains

Called By

Frequently Asked Questions

What does _is_builtin_tool() do?
_is_builtin_tool() is a function in the langchain codebase, defined in libs/partners/anthropic/langchain_anthropic/chat_models.py.
Where is _is_builtin_tool() defined?
_is_builtin_tool() is defined in libs/partners/anthropic/langchain_anthropic/chat_models.py at line 171.
What calls _is_builtin_tool()?
_is_builtin_tool() is called by 1 function(s): bind_tools.

Analyze Your Own Codebase

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

Try Supermodel Free