Using Agents to Optimize Agent Tools
Claude Code in practice: using AI to write tool descriptions, run evals, and auto-iterate
THE QUESTION THIS PAGE ANSWERS
ANSWER FIRSTWhat is the key idea behind “Using Agents to Optimize Agent Tools”?
Claude Code in practice: using AI to write tool descriptions, run evals, and auto-iterate
Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.
Write one question you could answer with evidence after trying this idea.
A conclusion that sounds complete but leaves the key assumption untested.
New approach: let Claude Code write tools → use evaluations to measure automatically → let Claude Code read eval results and optimize automatically. The Agent becomes the product manager of its own tools.
Prototype
Output: Claude Code generates complete MCP tool code, including tool definitions, parameter validation, and API call logic
Evaluate
- Did the Agent select the right tool?
- Were parameters filled in correctly?
- Was the return value correctly interpreted?
- What is the end-to-end task completion rate?
Optimize
Auto-fix: Rewrite tool descriptions, add differentiating explanations and usage examples
Choose the Right Tools: Less Is More
search, find, or lookup, the Agent can't either.Namespacing: Group Management
jira_create_issue / jira_list_issues / jira_update_statusBad naming:
create_issue / list_tasks / updateReturn Meaningful Context
{"status": "success"}Good:
{"status": "success", "issue_id": "PROJ-123", "url": "https://...", "assignee": "sample-user"}Token Efficiency: Trim Your Returns
Engineer Your Tool Descriptions as Prompts
Tool Namespace Groups
jira_ prefix, it immediately knows they are related and operate on the same system. This dramatically reduces the probability of selecting the wrong tool.
Full Return
Trimmed Return
search_issues Tool Description Comparison
How “Core Idea” changes an answer
“Claude Code in practice: using AI to write tool descriptions, run evals, and auto-iterate” shows that a model does not process the “word count” we see. It processes Token pieces. Tokenization affects input length, how much context fits, and how much computation a request consumes.
Length, information, and context are different
As “Claude Code in practice: using AI to write tool descriptions, run evals, and auto-iterate” grows, separate three questions: how many Tokens the text becomes, which pieces can change the current decision, and whether older material has fallen outside the context window. Removing repetition is often more useful than simply making the window larger.
Keep what can change the decision
Use “Claude Code in practice: using AI to write tool descriptions, run evals, and auto-iterate” as an A/B test: keep the same question while removing repeated background, compressing format, and trimming irrelevant history. Compare answer quality, latency, and Token count.
From “Core Idea” to “Three-Step Workflow: Prototype → Evaluate → Optimize”
“Core Idea” grounds the problem in “Traditional approach: humans write tools → humans test → humans improve. Long cycle, slow feedback, relies on developer intuition. New approach: let Claude Code write tools → use evaluations to m…”. “Three-Step Workflow: Prototype → Evaluate → Optimize” then moves it toward “Prototype Evaluate Optimize Evaluation not satisfactory? Repeat the loop until it meets the bar 01”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.
Carry the judgment into the next situation
For long text, keep what can change the conclusion before compressing format and history. A larger context is worth its cost only when the added information is useful.
- “Core Idea”: Traditional approach: humans write tools → humans test → humans improve. Long cycle, slow feedback, relies on developer intuition. New approach: let Claude Code write tools → use evaluations to m…
- “Three-Step Workflow: Prototype → Evaluate → Optimize”: Prototype Evaluate Optimize Evaluation not satisfactory? Repeat the loop until it meets the bar 01
- “Real Example: The Gap in Tool Descriptions”: search_issues Tool Description Comparison BEFORE -- Lazy Description { "name": "search_issues", "description": "Search for issues in the project tracker." } Agent doesn't know the search syntax, return format…
The final “Real Example: The Gap in Tool Descriptions” brings the discussion to “search_issues Tool Description Comparison BEFORE -- Lazy Description { "name": "search_issues", "description": "Search for issues in the project tracker." } Agent doesn't know the search syntax, return format…”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.
I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.
After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.
When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.
No discussion on this article yet.