Search⌘ K
AI Features

Designing Tool Schemas and Retrieval

Explore how to design well-formed tool schemas and retrieval strategies that enable Claude systems to accurately access and cite customer data. This lesson covers defining tools with detailed descriptions and strict JSON schemas, handling messy real-world documents with contextual retrieval methods, and returning results that can be traced back to their sources. You'll understand how careful tool and retrieval design provides reliable, verifiable answers in regulated environments.

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 action parameter, which reduces confusion between near-identical tools.

  • Clear namespacing: When tools span several systems, a prefix such as contracts_ or orders_ 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 ...