| Name | Type | Description |
|---|---|---|
tools* | Sequence[Mapping[str, Any] | type | Callable | BaseTool] | A list of tool definitions to bind to this chat model. Supports Anthropic format tool schemas and any tool definition handled
by |
tool_choice | dict[str, str] | str | None | Default: None |
parallel_tool_calls | bool | None | Default: None |
strict | bool | None | Default: None |
kwargs | Any | Default: {} |
Bind tool-like objects to ChatAnthropic.
Example:
from langchain_anthropic import ChatAnthropic
from pydantic import BaseModel, Field
class GetWeather(BaseModel):
'''Get the current weather in a given location'''
location: str = Field(..., description="The city and state, e.g. San Francisco, CA")
class GetPrice(BaseModel):
'''Get the price of a specific product.'''
product: str = Field(..., description="The product to look up.")
model = ChatAnthropic(model="claude-sonnet-4-5-20250929", temperature=0)
model_with_tools = model.bind_tools([GetWeather, GetPrice])
model_with_tools.invoke(
"What is the weather like in San Francisco",
)
# -> AIMessage(
# content=[
# {'text': '<thinking>\nBased on the user\'s question, the relevant function to call is GetWeather, which requires the "location" parameter.\n\nThe user has directly specified the location as "San Francisco". Since San Francisco is a well known city, I can reasonably infer they mean San Francisco, CA without needing the state specified.\n\nAll the required parameters are provided, so I can proceed with the API call.\n</thinking>', 'type': 'text'},
# {'text': None, 'type': 'tool_use', 'id': 'toolu_01SCgExKzQ7eqSkMHfygvYuu', 'name': 'GetWeather', 'input': {'location': 'San Francisco, CA'}}
# ],
# response_metadata={'id': 'msg_01GM3zQtoFv8jGQMW7abLnhi', 'model': 'claude-sonnet-4-5-20250929', 'stop_reason': 'tool_use', 'stop_sequence': None, 'usage': {'input_tokens': 487, 'output_tokens': 145}},
# id='run-87b1331e-9251-4a68-acef-f0a018b639cc-0'
# )Which tool to require the model to call. Options are:
{"type": "tool", "name": "<<tool_name>>"}: calls corresponding tool'auto', {"type: "auto"}, or None: automatically selects a tool (including no tool)'any' or {"type: "any"}: force at least one tool to be calledSet to False to disable parallel tool use.
Defaults to None (no specification, which allows parallel tool use).
If True, Claude's schema adherence is applied to tool calls.
See the docs for more info.
Any additional parameters are passed directly to bind.