Lv.1 0 XP

Tool Result Formatting — Structuring Output for Claude's Reasoning

Core 6 min +25 XP
💡
THE ANALOGY

A well-organized filing cabinet vs a box of loose papers. Both have the same information. But the filing cabinet lets you find exactly what you need in seconds. Tool results formatted for Claude's reasoning are the filing cabinet — Claude can extract what it needs without parsing noise.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Returning raw API responses directly as tool results. Raw API responses contain headers, metadata, pagination info, and nested structures that Claude must wade through. Pre-process results to return only what Claude needs in the clearest possible format.

KEY POINTS
1 Return only relevant information — strip metadata, headers, pagination artifacts, and unused fields before sending to Claude.
2 Consistent field names across similar tools reduce Claude's cognitive load — 'customer_id' should mean the same thing in every tool result.
3 Structured formats (JSON with clear field names) beat prose descriptions — Claude can reference specific fields.
4 Include computed summaries for large result sets — don't make Claude count or calculate when you can do it for free.
5 Error results need the same formatting care as success results — a well-formatted error helps Claude recover correctly.