tool-design
Skill8 starsChanged 3 months agoMITView on GitHub
Design and iterate on tools (MCP or direct API) that agents actually use well: prototype-then-evaluate loops, agent-assisted tool optimization, consolidated workflow tools, namespacing, high-signal responses, and token-efficient outputs. Use when writing or refactoring tool definitions, building an MCP server, debugging why an agent misuses/ignores tools, or reviewing tool schemas and descriptions.
25 other projects use a version of this.
Adopted by
Most recently taken up by
- LuisSambrano/antigravity-configtheir own version, first seen Nov 8, 2026
- docxology/templatetheir own version, first seen Oct 30, 2026
- AbdelrhmanAlquran/claude-skillstheir own version, first seen Oct 20, 2026
- bingyue/fde-skillstheir own version, first seen Oct 13, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- brake71/1c-ssl-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use long-horizon-prompting, bdi-mental-states and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
DVwebBiz11Skilllong-horizon-prompting
This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.
Also in 5 projects that use this
Downey6689Skillbdi-mental-states
Transforms external RDF context into BDI mental states. Invoke when modeling beliefs, desires, and intentions.
Also in 6 projects that use this
Downey6689Skillhosted-agents
Guidance for hosted/sandboxed agents. Invoke when running background agents in isolated VMs or multi-client setups.
Also in 6 projects that use this
DVwebBiz11Skillself-improvement-loops
This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.
Also in 4 projects that use this
abdullah1854Skillcontext-degradation
Also in 11 projects that use this
abdullah1854Skillcontext-fundamentals
Also in 12 projects that use this
- +1 more from Downey6689
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- bojieli/ai-agent-book-projects★ 53ksame name
- bojieli/ai-agent-book★ 53ksame name
- muratcankoylan/Agent-Skills-for-Context-Engineering★ 18ksame name
- brake71/1c-ssl-skills★ 85same name
- nahid-sparktales/agent-dispatcher★ 59same name
- mjunaidca/mjs-agent-skills★ 27same name
- docxology/template★ 23same name
- AbdullahMalik17/Digital-FTE★ 12same name
- AbdullahMalik17/Hacathan_5★ 9same name
- AbdullahMalik17/My_skills★ 9same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- agent-design-fundamentalsSkill
- agent-evalsSkill
- agent-failure-preflightSkill
- agentic-coding-disciplineSkill
- agent-improvement-loopSkill
- agent-sandboxingSkill
- coding-agent-securitySkill
- context-compressionSkill
- context-engineeringSkill
- gpt-56-promptingSkill
- long-running-harnessSkill
- mcp-2026-migrationSkill
- mcp-code-executionSkill
- memory-compactionSkill
- monorepo-agentsSkill
- planner-evaluator-harnessSkill
- prompt-cache-optimizationSkill
- prompt-engineering-canonSkill
- skill-authoringSkill
- spec-driven-devSkill
- zero-trust-agentsSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Do NOT use for: designing deterministic function APIs consumed only by code (normal API-design rules apply), or prompt engineering …
- Distinctive: line 42
Do not wrap every API endpoint 1:1.
- Very specific: line 50
When downstream calls genuinely need technical IDs (e.g.
- Distinctive: line 52
When you truncate, tell the agent what to do next — steer it toward token-efficient strategies such as many small targeted searches instead …
- Distinctive: line 58
Treat tool descriptions as one of the highest-leverage surfaces — they load directly into the agent's context.
- Very specific: line 59
Use unambiguous parameter names: user_id, not user.
“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tool Design for Agents
This skill distills Anthropic's engineering guidance on writing tools that non-deterministic agents use effectively. Tools are a contract between deterministic systems and non-deterministic agents — an agent may call your tool, ignore it, misuse it, or hallucinate around it. The methodology: prototype fast, evaluate against realistic multi-step tasks, let the agent itself analyze transcripts and rewrite the tools, and optimize every tool for the agent's scarce context rather than for API completeness.
When to use
- Writing or refactoring tool definitions for an agent (MCP server, direct API
toolsparameter, SDK tool registry). - Deciding which endpoints of an existing API to expose to an agent, and how.
- Debugging an agent that calls the wrong tool, makes redundant calls, pages through data wastefully, or ignores a tool entirely.
- Reviewing tool names, parameter names, descriptions, or response payloads.
- Building an evaluation for a tool set.
Do NOT use for: designing deterministic function APIs consumed only by code (normal API-design rules apply), or prompt engineering unrelated to tool specs.
Rules
Prototype, then evaluate
- Stand up a quick local prototype before polishing anything. Give the coding agent documentation for the target libraries/APIs and the MCP SDK; LLM-friendly docs are often published as flat
llms.txtfiles (e.g.https://docs.anthropic.com/llms.txt). Wrap the tools in a local MCP server or Desktop extension (DXT) for hands-on testing:claude mcp add <name> <command> [args...]for Claude Code, orSettings > Developer/Settings > Extensionsin the Claude Desktop app. Test the tools yourself first — rough edges you feel are rough edges the agent will hit. - Build evaluation tasks from real-world workflows, not toy lookups. Strong tasks require realistic data and multiple — potentially dozens of — tool calls (e.g. "Customer ID 9182 reported that they were charged three times for a single purchase attempt. Find all relevant log entries and determine if any other customers were affected."). Weak tasks hand the agent the answer ("Search the payment logs for
purchase_completeandcustomer_id=9182"). - Pair every task with a verifiable outcome — exact string comparison or an LLM judge. Do not make verifiers so strict that formatting or punctuation differences fail correct answers. You may note expected tool calls, but avoid overspecifying: multiple valid solution paths usually exist, and overfitting the grader to one strategy hides good behavior.
- Run evaluations programmatically with a simple agentic loop (a
while-loop alternating LLM API calls and tool calls), one task prompt per agent. Ask for reasoning/feedback blocks before tool calls and enable interleaved thinking so you can probe why the agent did or didn't call a tool. - Collect more than accuracy: total runtime, tool call count, token consumption, and tool error counts. Redundant calls point at pagination or token-limit tuning; frequent errors point at unclear descriptions or missing input examples.
- Read the raw transcripts, not just scores — and remember "what agents omit in their feedback and responses can often be more important than what they include" (Anthropic). Example fix from the source: Claude's web search tool kept appending "2025" to queries; improving the tool description corrected it.
Let the agent optimize its own tools
- Concatenate evaluation transcripts and paste them into Claude Code; ask it to analyze failures and refactor the tools — it can rewrite many tools at once for consistency. Anthropic reports internal Slack and Asana MCP servers measurably beat their human-written baselines this way, with held-out test sets revealing further gains. Most of the source article's advice came from this loop.
Choose and shape the tools
- Do not wrap every API endpoint 1:1. More tools do not improve outcomes; too many or overlapping tools distract agents from efficient strategies. Build a small set of thoughtful tools targeting the high-impact workflows your eval tasks exercise, each with a clear, distinct purpose.
- Consolidate multi-step workflows into single tools that do the discrete API calls under the hood. Source examples:
schedule_event(finds availability and books) instead oflist_users+list_events+create_event;search_logsreturning only relevant lines with context instead ofread_logs;get_customer_contextcompiling everything about a customer instead ofget_customer_by_id+list_transactions+list_notes. - Respect the asymmetry: computer memory is cheap, agent context is not. Prefer targeted retrieval tools (
search_contacts,message_contact) over dumps (list_contacts) that force the agent to read everything token-by-token. - Namespace tools under common prefixes when many servers/tools coexist — by service (
asana_search,jira_search) or by resource (asana_projects_search,asana_users_search). Prefix- vs suffix-based namespacing has non-trivial, LLM-dependent effects on tool-use evals — pick the scheme your own evaluations favor.
Return meaningful, token-efficient context
- Return only high-signal information. Prefer semantically meaningful fields (
name,image_url,file_type) over low-level technical identifiers (uuid,256px_image_url,mime_type). Resolving UUIDs into natural-language names significantly improves retrieval precision and reduces hallucinations. - When downstream calls genuinely need technical IDs (e.g.
search_user(name='jane')feedingsend_message(id=12345)), expose aresponse_formatenum parameter —DETAILED = "detailed"/CONCISE = "concise"— so the agent chooses. Source measurement on a Slack thread response: detailed 206 tokens (includesthread_ts,channel_id,user_id), concise 72 tokens — roughly one-third the cost. - Bound response size: implement pagination, range selection, filtering, and/or truncation with sensible defaults. Claude Code restricts tool responses to 25,000 tokens by default. Effective context will grow, but the need for context-efficient tools will remain.
- When you truncate, tell the agent what to do next — steer it toward token-efficient strategies such as many small targeted searches instead of one broad search.
- Make errors actionable: return specific formatting guidance or example inputs, not opaque error codes or raw tracebacks.
- There is no one-size-fits-all response format (JSON vs XML vs Markdown). LLMs perform better with formats matching their training data — test formats in your evals.
Prompt-engineer the tool spec
- Treat tool descriptions as one of the highest-leverage surfaces — they load directly into the agent's context. "Think of how you would describe your tool to a new hire on your team" (Anthropic): make implicit knowledge explicit — specialized query formats, niche terminology, how resources relate.
- Use unambiguous parameter names:
user_id, notuser. Strict data models plus clear descriptions eliminate ambiguity. - Measure description changes with your eval. Anthropic reports Claude Sonnet 3.5 reached state-of-the-art on SWE-bench Verified after precise refinements to tool descriptions dramatically cut error rates.
Checklist
- Prototype wired into a local MCP server / DXT and tested by hand before any polish
- Eval tasks drawn from real workflows; each needs multiple tool calls and has a verifiable outcome
- Verifier tolerant of formatting differences; expected-tool-call specs not overfit to one strategy
- Eval loop records runtime, tool call count, token consumption, and error counts — not just accuracy
- Transcripts read manually; agent-omitted information checked, not just agent-stated feedback
- Transcripts fed to Claude Code with a request to analyze and refactor the tools; re-run on held-out tasks
- Tool set consolidated: workflow tools (
schedule_event-style) replace chains of low-level endpoints - No dump-style tools where a targeted search tool would do
- Tools namespaced with a consistent prefix scheme validated by your own evals
- Responses use natural-language fields; UUIDs resolved to names;
response_format(detailed/concise) offered where IDs are sometimes needed - Pagination/filtering/truncation with sensible defaults; truncation messages tell the agent the next move
- Errors return corrective guidance and example inputs
- Every description written new-hire-clear; parameter names unambiguous (
user_idnotuser) - Each description change re-measured against the eval before shipping
Anti-patterns
- Wrapping every existing API endpoint as a tool without considering agent affordances.
- Shipping many overlapping tools with fuzzy boundaries — the agent picks wrong or dithers.
list_*dump tools that flood context and force token-by-token scanning.- Returning
uuid,mime_type,256px_image_url-style fields when the agent needs names and meanings. - Opaque error codes and raw tracebacks instead of guidance the agent can act on.
- Eval tasks that are single-call lookups or that embed the answer in the prompt.
- Verifiers that fail correct answers over punctuation, or that hard-require one tool-call sequence.
- Trusting unit-style "it returns data" checks over transcript reading — silent omissions hide there.
- Ambiguous parameter names (
user) and descriptions that assume tribal knowledge. - Hand-tuning tools without an eval, or skipping the agent-driven optimization loop entirely.
Source
- Writing effective tools for agents — with agents — https://www.anthropic.com/engineering/writing-tools-for-agents — 2025-09-11
Distilled from the official document(s) above on 2026-08-12. If this skill and the source disagree, trust the source.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

