Writing effective tools for AI agents—using AI agents

This post details best practices for writing effective tools for AI agents, focusing on the development and improvement of tools that interact with agents via the Model Context Protocol (MCP). It outlines a process for prototyping tools, running comprehensive evaluations with agents to measure performance, and collaborating with agents (like Claude Code) to automatically enhance tool performance. Key principles for writing high-quality tools are presented, including selecting appropriate tools, effective namespacing, returning meaningful context, optimizing for token efficiency, and prompt-engineering tool descriptions. The post emphasizes the unique contract between deterministic systems (tools) and non-deterministic agents, and the need to design tools with agents' affordances in mind.
More from the AI Code Generation and Software Engineering Agents trail
- Using Claude Science to produce the first complete map of the sky in UV light
- Project Swap: What happens when agents trade for us?
- Automated researchers can reliably mitigate alignment failures
- How Claude is accelerating protein design and analytical chemistry
- Patterns and problems in multiagent systems