Ask a question to get started
Enter to sendā¢Shift+Enter new line
convert_to_anthropic_tool( tool: Mapping[str, Any] | type | Callable | BaseTool, *,
tool
Mapping[str, Any] | type | Callable | BaseTool
A tool-like object to convert. Can be an Anthropic tool dict, a Pydantic model, a function, or a BaseTool.
BaseTool
strict
bool | None
None
Convert a tool-like object to an Anthropic tool definition.
If True, enables strict schema adherence for the tool.
True
Requires Claude Sonnet 4.5 or Opus 4.1.