Designing Tool Schemas and Retrieval
Explore how to design detailed tool definitions and enforce strict input schemas to improve Claude's tool use. Understand contextual retrieval for messy customer data and learn to return cited results that ensure trust and verifiability in Claude-powered applications.
Tools and retrieval are where a Claude system meets a customer’s real data. A design can look sound on a whiteboard and still fail here, because Claude calls the wrong tool, passes a malformed argument, or answers from a clause that was never retrieved. Most of these failures trace back to how the tools were described and how the data was prepared.
Customer data adds its own difficulty. Contracts arrive as long documents in different formats, written by different teams, with the key facts scattered across sections. A retrieval layer that works on clean examples often breaks on that material.
The sections below cover tool definitions, schema enforcement, and retrieval that returns sources Claude can cite.
What makes a tool well-formed
A tool definition is the only explanation Claude gets of what a tool does. Claude decides whether to call a tool, and with which arguments, from its name, description, and input schema. Anthropic’s guidance on tool definitions comes down to a few practices.
Detailed descriptions: The description is the most important factor in tool performance. It explains what the tool does, when to use it and when not to, what each parameter means, and what the tool does not return. Three to four sentences is a reasonable minimum.
Fewer, broader tools: Related operations can share one tool with an
actionparameter, which reduces confusion between near-identical tools.Clear namespacing: When tools span several systems, a prefix such as
contracts_ororders_makes the right choice obvious.High-signal responses: A tool returns only the fields Claude needs for its next step, with stable identifiers instead of internal references.
Input examples: Complex tools with nested or format-sensitive inputs can include
input_examples, sample inputs that show Claude the ...