Recently, the official blog of Anthropic published a detailed guide titled "Writing effective tools for LLM agents—using LLM agents." The guide aims to help developers use the Model Context Protocol (MCP) to design efficient tools for LLM agents. It proposes a three-step iterative process: "Prototype - Evaluate - Collaborate," and summarizes five design principles to ensure the effectiveness and usability of the tools.
First, the guide emphasizes the need for caution when selecting tools. Developers should carefully consider the selection of tools to ensure they effectively meet the needs of the LLM agent. Second, the guide suggests maintaining a clear namespace to ensure that names of different tools and functions do not cause confusion, allowing developers to quickly understand and use them.
Additionally, the context return values of the tools should be more meaningful. The guide points out that developers should optimize the information returned by the tools to make it more informative and contextually relevant, thereby improving the efficiency of the LLM agent. Furthermore, token efficiency of the returned information should also be considered to reduce data transmission costs and improve processing speed. Finally, the guide suggests using prompt engineering to enhance the quality of tool descriptions, making it easier for users to understand the functions and usage of the tools.
The article also mentions that many conclusions were automatically derived by Claude Code after repeatedly analyzing scripts, refactoring tool descriptions, and patterns, ensuring the scientific accuracy and reliability of the analysis. To prevent overfitting, Anthropic also evaluated using a reserved test set. At the same time, Anthropic has open-sourced the Cookbook for tool evaluation and announced that as the MCP protocol and underlying LLM are upgraded in the future, the capabilities of the tools will also evolve accordingly.
Guide: https://www.anthropic.com/engineering/writing-tools-for-agents