# convert_to_anthropic_tool

> **Function** in `langchain_anthropic`

📖 [View in docs](https://reference.langchain.com/python/langchain-anthropic/chat_models/convert_to_anthropic_tool)

Convert a tool-like object to an Anthropic tool definition.

## Signature

```python
convert_to_anthropic_tool(
    tool: Mapping[str, Any] | type | Callable | BaseTool,
    *,
    strict: bool | None = None,
) -> AnthropicTool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tool` | `Mapping[str, Any] \| type \| Callable \| BaseTool` | Yes | A tool-like object to convert. Can be an Anthropic tool dict, a Pydantic model, a function, or a `BaseTool`. |
| `strict` | `bool \| None` | No | If `True`, enables strict schema adherence for the tool.  !!! note      Requires Claude Sonnet 4.5 or Opus 4.1. (default: `None`) |

## Returns

`AnthropicTool`

`AnthropicTool` for custom/user-defined tools

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/8fec4e7ceee2c368b068c49f9fed453276e210e7/libs/partners/anthropic/langchain_anthropic/chat_models.py#L1987)