Type: url

Original: https://www.anthropic.com/engineering/writing-tools-for-agents

Status: generated

Summary

Anthropic’s engineering guide to writing tools for LLM agents, built on the claim that a tool is a contract between a deterministic system and a non-deterministic one and so should not be written the way functions and APIs are written for other developers. The method it proposes is evaluation-driven: prototype the tools, build an evaluation from realistic multi-tool-call tasks with verifiable outcomes, run it as simple agentic loops, then paste the transcripts into Claude Code and let it analyse them and refactor the tools. It closes with five principles — build few consolidated tools rather than wrapping endpoints, namespace them, return high-signal context, bound response size, and prompt-engineer the descriptions — reporting a SWE-bench Verified result from description refinement and a retrieval-precision gain from resolving UUIDs into meaningful identifiers.

Generated pages