Introduction¶
Just because an Agent can connect to a database, GitHub, or a custom API does not mean it can use those capabilities stably. Common failures are often not due to the backend going down, but rather the model selecting the wrong tool, incorrect parameter formatting, or error messages lacking any clues for self-correction. Human-facing API documentation can rely on conventions and follow-up questions to fill in gaps; however, tools aimed at Agents must embed contracts into descriptions and schemas, allowing a single inference step to select correctly, fill in correctly, and correct from failures. Below is an introduction to the tool-design skill within the Context Engineering skill set, which specifically covers the interface design at the layer of “a single tool or an entire tool catalog.”
What is this¶
tool-design is a Skill within the Agent Skills for Context Engineering repository, maintained by the Agent Skills for Context Engineering Contributors (SKILL metadata version 2.2.0, last updated 2026-05-15).
In one sentence: It treats every tool as a contract between a deterministic system and a non-deterministic Agent. It guides you in writing routable tool descriptions, designing schemas and response formats, unifying naming conventions, designing actionable error recovery messages, and handling MCP server and tool set consolidation/pruning.
It has a clear division of labor with project-development (project structure and pipelines), multi-agent-patterns (whether to split sub-agents), and context-optimization (trajectory-level tokens and observation masking) in the same collection: this Skill is responsible only for the tool interface layer and does not make architectural choices or full-project cost decisions for you.
When to enable¶
The official SKILL specifies that it should be activated when the work unit is “a single tool or a set of tools,” such as:
- Writing descriptions, schemas, or response formats for new tools.
- Troubleshooting Agents selecting wrong tools or generating malformed calls.
- Merging overlapping tool catalogs (typical phrasing: “We have 17 tools and select the wrong one half the time”).
- Designing actionable error messages to facilitate Agent self-correction.
- Unifying tool and parameter naming within a catalog (including MCP namespaces, verb-noun).
- Evaluating whether a third-party tool is worth adding using consolidation principles before integration.
Scenarios where it should not be activated include: whether to use an LLM, pipeline stage division (belongs to project-development); single Agent multi-tool vs. multi-Agent (belongs to multi-agent-patterns); token reduction for multi-turn tool outputs (belongs to context-optimization).
Core Concepts and Capabilities¶
Consolidation¶
If a human engineer cannot uniquely determine which tool to use in a given scenario, one should not expect an Agent to do better. Agents route by comparing the descriptions of various tools; functional overlap directly translates to wrong tool selection. The Skill suggests shrinking the tool set to “each tool having only one clear purpose” and using a single comprehensive tool to replace multiple narrow tool chains when appropriate (e.g., using schedule_event to internally handle checking availability and creation, rather than having the Agent sequentially call list_users, list_events, create_event).
Consolidation also has boundaries: capabilities with essentially different behaviors, different contexts, or those that must be called independently should remain separate; excessive consolidation leads to too many parameters and mixed modes, causing the Agent to fail to fill in parameters correctly.
Tools as Contracts, Descriptions as Prompts¶
Tool descriptions enter the Agent’s context and directly participate in reasoning; they are not appendices for humans to read. The contract must be self-contained within the description block: format examples, constraints, and return shapes must be fully written out, because Agents cannot ask follow-up questions before calling.
Descriptions should stably answer three types of questions (which the Agent is effectively asking during selection):
- What does it do?
- When should I use it?
- What does it return?
In engineering, this can be extended to a four-point structure: What it does, When to use it, What inputs it accepts, What it returns (including success and errors).
Naming, Namespaces, and MCP¶
Tool names should follow the verb-noun convention (e.g., get_customer, create_order), and parameter names should be consistent across tools (always customer_id, avoid mixing id / identifier). When the catalog grows, use prefixes for grouping (e.g., db_*, web_*) to reduce selection noise caused by flat scanning.
When integrating with MCP, the official requirement is to use fully qualified names in the format ServerName:tool_name to avoid “tool not found” issues when multiple Servers coexist:
# Correct
BigQuery:bigquery_schema
GitHub:create_issue
# Incorrect (likely to fail with multiple Servers)
bigquery_schema
Response Formats and Error Recovery¶
To control context consumption, you can provide response format options for tools (e.g., concise vs. detailed) and explain in the description when to choose which. Error messages must be actionable for the Agent: explaining the cause of the error, how to change parameters, and whether it can be retried; returning just failed or invalid input cannot support self-correction.
Architectural Reduction¶
When data layer documentation is complete, model reasoning is sufficient, and dedicated tools actually limit performance, the Skill discusses the path of using a small number of primitives (e.g., file system + standard Unix commands) to replace a large number of domain-specific tools, and points to references/architectural_reduction.md in the repository for further reading. It also reminds that blind reduction is not suitable when data is chaotic, security boundaries are strong, or processes indeed require structured orchestration.
Practice Checklist and Evaluation Dimensions¶
Tool Selection Framework (when designing tool sets):
- List the distinct workflows the Agent must complete.
- Group related actions into comprehensive tools.
- Ensure each tool has a unique, unambiguous purpose.
- Document errors and recovery paths.
- Test with real Agent interactions.
Pre-adoption Audit Checklist (excerpt): verb-noun naming and namespaces; descriptions cover what / when / returns; parameters include types, constraints, defaults, and examples; success and error payloads are parseable; errors contain retry instructions; no overlapping activation scenarios with other tools in the same catalog; large responses support concise or file reference modes.
Design quality can be self-checked across five dimensions: unambiguity, completeness, recoverability, efficiency, consistency. The Skill also provides a “Tool-Testing Agent” pattern: collect failure samples, let the Agent analyze description gaps and iterate on the description (efficiency improvements need to be verified by reproduction on your tool catalog).
Installation and Activation¶
This Skill uses the repository’s unified SKILL.md format. The source path is:
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/tool-design
Besides SKILL.md, the directory also contains references/ (such as best_practices.md, architectural_reduction.md) for in-depth reading.
Activation depends on how your Agent product loads Skills: add the above directory (or the SKILL.md and reference files within it) to the Skills path agreed upon by the product, and have the routing logic select tool-design when the task involves “tool descriptions / schemas / MCP tool sets.” The official SKILL does not separately list configuration differences for Cursor, Codex CLI, or Claude Code; do not fabricate installation commands here; refer to your current environment’s Skill loading documentation and ensure name: tool-design and the description in the front matter are recognizable.
The description summary in the Skill metadata is as follows for routing reference:
name: tool-design
description: "This skill should be used for the tool-interface layer of an agent system specifically: writing tool descriptions agents can route on, designing tool schemas and response formats, naming conventions, actionable error recovery messages, MCP server design, tool-set consolidation, and deciding when to add or remove an individual tool. ..."
Typical Usage Examples¶
Good Tool Description (Official Example 1)¶
The following demonstrates how the description simultaneously carries “when to use, parameter format, return, and error codes”:
def get_customer(customer_id: str, format: str = "concise"):
"""
Retrieve customer information by ID.
Use when:
- User asks about specific customer details
- Need customer context for decision-making
- Verifying customer identity
Args:
customer_id: Format "CUST-######" (e.g., "CUST-000001")
format: "concise" for key fields, "detailed" for complete record
Returns:
Customer object with requested fields
Errors:
NOT_FOUND: Customer ID not found
INVALID_FORMAT: ID must match CUST-###### pattern
"""
Anti-patterns and Failure Modes (Official Example 2)¶
def search(query):
"""Search the database."""
pass
Problems summarized by the Skill include: ambiguous name, lack of database and query format, no return or error explanation, no boundary with other tools—easily leading to wrong tool selection, random parameter filling, inability to interpret results, and inability to recover from errors.
Iterating Descriptions with Failure Samples (Tool-Testing Agent Approach)¶
The optimization process skeleton provided by the official: Agent attempts to call tools on multiple tasks → collects failures → analyzes description missing info and ambiguities → modifies description → regression on the same tasks. In implementation, a prompt structure similar to the following can be used (excerpt from SKILL):
def optimize_tool_description(tool_spec, failure_examples):
prompt = f"""
Analyze this tool specification and the observed failures.
Tool: {tool_spec}
Failures observed:
{failure_examples}
Identify:
1. Why agents are failing with this tool
2. What information is missing from the description
3. What ambiguities cause incorrect usage
Propose an improved tool description that addresses these issues.
"""
return get_agent_response(prompt)
Applicable Scenarios and Notes¶
Who it is for: Engineers designing or maintaining tool catalogs for Agents/MCP; teams encountering selection errors or malformed parameters that require systematic interface changes rather than just changing the system prompt; scenarios preparing to perform consolidation and naming audits before integrating new MCP Servers.
Limitations and Pitfalls (from official Gotchas, selected):
- Descriptions “rot” as APIs evolve; they should be versioned like code and regression tested on API changes.
- MCP multi-providers easily cause collisions with names like
search;ServerName:tool_namemust be used and conflicts audited. - Single tool with too many parameters (Skill suggests considering splitting if exceeding about 8–10 or carrying completely different workflows).
- When optional parameters explode, use reasonable defaults and format presets; avoid stacking bare optionals.
Connection with other Skills in the same collection: context-fundamentals explains how tool definitions occupy attention; evaluation covers overall effectiveness evaluation of tool sets; decisions beyond the interface layer should be explicitly routed to the corresponding Skill.
Conclusion¶
tool-design converges “whether tools can be reliably called by Agents” into executable contract design: consolidation and naming, description structure, responses and errors, MCP qualified names, and using real failures to drive iteration. If your current work unit is exactly a single tool or an entire tool catalog, prioritize modifying the interface according to this Skill’s audit checklist, which is often more round-saving than continuing to stack prompts.
Official Address: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/tool-design