> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# (Deprecated) experimental Anthropic tools wrapper integration

> Integrate with (Deprecated) experimental Anthropic tools wrapper chat model using LangChain Python.

<Warning>
  **The Anthropic API officially supports tool-calling so this workaround is no longer needed. Please use [ChatAnthropic](/oss/python/integrations/chat/anthropic) with `langchain-anthropic>=0.1.15`.**
</Warning>

This notebook shows how to use an experimental wrapper around Anthropic that gives it tool calling and structured output capabilities. It follows [Anthropic's tool use guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)

The wrapper is available from the `langchain-anthropic` package, and it also requires the optional dependency `defusedxml` for parsing XML output from the llm.

Note: this is a beta feature that will be replaced by Anthropic's formal implementation of tool calling, but it is useful for testing and experimentation in the meantime.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pip install -qU langchain-anthropic defusedxml
from langchain_anthropic.experimental import ChatAnthropicTools
```

## Tool binding

`ChatAnthropicTools` exposes a `bind_tools` method that allows you to pass in Pydantic models or BaseTools to the llm.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from pydantic import BaseModel


class Person(BaseModel):
    name: str
    age: int


model = ChatAnthropicTools(model="claude-3-opus-20240229").bind_tools(tools=[Person])
model.invoke("I am a 27 year old named Erick")
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
AIMessage(content='', additional_kwargs={'tool_calls': [{'function': {'name': 'Person', 'arguments': '{"name": "Erick", "age": "27"}'}, 'type': 'function'}]})
```

## Structured output

`ChatAnthropicTools` also implements the [`with_structured_output` spec](/oss/python/langchain/structured-output) for extracting values. Note: this may not be as stable as with models that explicitly offer tool calling.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
chain = ChatAnthropicTools(model="claude-3-opus-20240229").with_structured_output(
    Person
)
chain.invoke("I am a 27 year old named Erick")
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
Person(name='Erick', age=27)
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/chat/anthropic_functions.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
