Claude API · Tools and structured output

Guarantee valid tool input

Set strict: true on a tool so its input always matches the schema. The schema needs additionalProperties: false and required.

tools = [{**tool, "strict": True} for tool in tools]

Official Claude API documentation

More tools and structured output commands

All tools and structured output commands · Claude API cheatsheet

Was this page helpful?