Lv.1 0 XP

Tool Schema Design — Building Input Schemas Claude Can Use Reliably

Core 8 min +30 XP
💡
THE ANALOGY

A well-designed form vs a blank text field. A blank field gives you anything — but you'll get inconsistent input that breaks downstream processing. A well-designed form guides the user to provide exactly what you need, in the format you need it. Tool schemas do the same for Claude.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Making all fields required when some are genuinely optional. Required fields that Claude can't always populate cause tool call failures. Optional fields with clear descriptions are better than required fields that sometimes have no valid value.

KEY POINTS
1 JSON Schema is the format for tool input schemas — use type, description, enum, default, and required correctly.
2 enum values constrain Claude's choices to valid options — essential for fields with a fixed set of valid values.
3 required array should only contain fields Claude can always provide — optional fields should be genuinely optional.
4 Nested objects in schemas are fine but deep nesting makes descriptions harder to write and Claude's inputs harder to validate.
5 Schema design affects reliability: a schema that allows invalid inputs will eventually receive them.