$npx -y skills add sickn33/agentic-awesome-skills --skill agent-tool-builderTools are how AI agents interact with the world. A well-designed
| 1 | # Agent Tool Builder |
| 2 | |
| 3 | Tools are how AI agents interact with the world. A well-designed tool is the |
| 4 | difference between an agent that works and one that hallucinates, fails |
| 5 | silently, or costs 10x more tokens than necessary. |
| 6 | |
| 7 | This skill covers tool design from schema to error handling. JSON Schema |
| 8 | best practices, description writing that actually helps the LLM, validation, |
| 9 | and the emerging MCP standard that's becoming the lingua franca for AI tools. |
| 10 | |
| 11 | Key insight: Tool descriptions are more important than tool implementations. |
| 12 | The LLM never sees your code - it only sees the schema and description. |
| 13 | |
| 14 | ## Principles |
| 15 | |
| 16 | - Description quality > implementation quality for LLM accuracy |
| 17 | - Aim for fewer than 20 tools - more causes confusion |
| 18 | - Every tool needs explicit error handling - silent failures poison agents |
| 19 | - Return strings, not objects - LLMs process text |
| 20 | - Validation gates before execution - reject, fix, or escalate, never silent fail |
| 21 | - Test tools with the LLM, not just unit tests |
| 22 | |
| 23 | ## Capabilities |
| 24 | |
| 25 | - agent-tools |
| 26 | - function-calling |
| 27 | - tool-schema-design |
| 28 | - mcp-tools |
| 29 | - tool-validation |
| 30 | - tool-error-handling |
| 31 | |
| 32 | ## Scope |
| 33 | |
| 34 | - multi-agent-coordination → multi-agent-orchestration |
| 35 | - agent-memory → agent-memory-systems |
| 36 | - api-design → api-designer |
| 37 | - llm-prompting → prompt-engineering |
| 38 | |
| 39 | ## Tooling |
| 40 | |
| 41 | ### Standards |
| 42 | |
| 43 | - JSON Schema - When: All tool definitions Note: The universal format for tool schemas |
| 44 | - MCP (Model Context Protocol) - When: Building reusable, cross-platform tools Note: Anthropic's open standard, widely adopted |
| 45 | |
| 46 | ### Frameworks |
| 47 | |
| 48 | - Anthropic SDK - When: Claude-based agents Note: Beta tool runner handles most complexity |
| 49 | - OpenAI Functions - When: OpenAI-based agents Note: Use strict mode for guaranteed schema compliance |
| 50 | - Vercel AI SDK - When: Multi-provider tool handling Note: Abstracts differences between providers |
| 51 | - LangChain Tools - When: LangChain-based agents Note: Converts MCP tools to LangChain format |
| 52 | |
| 53 | ## Patterns |
| 54 | |
| 55 | ### Tool Schema Design |
| 56 | |
| 57 | Creating clear, unambiguous JSON Schema for tools |
| 58 | |
| 59 | **When to use**: Defining any new tool for an agent |
| 60 | |
| 61 | # TOOL SCHEMA BEST PRACTICES: |
| 62 | |
| 63 | ## 1. Detailed Descriptions (Most Important) |
| 64 | """ |
| 65 | BAD - Too vague: |
| 66 | { |
| 67 | "name": "get_stock_price", |
| 68 | "description": "Gets stock price", |
| 69 | "input_schema": { |
| 70 | "type": "object", |
| 71 | "properties": { |
| 72 | "ticker": {"type": "string"} |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | GOOD - Comprehensive: |
| 78 | { |
| 79 | "name": "get_stock_price", |
| 80 | "description": "Retrieves the current stock price for a given ticker |
| 81 | symbol. The ticker symbol must be a valid symbol for a publicly |
| 82 | traded company on a major US stock exchange like NYSE or NASDAQ. |
| 83 | Returns the latest trade price in USD. Use when the user asks |
| 84 | about current or recent stock prices. Does NOT provide historical |
| 85 | data, company info, or predictions.", |
| 86 | "input_schema": { |
| 87 | "type": "object", |
| 88 | "properties": { |
| 89 | "ticker": { |
| 90 | "type": "string", |
| 91 | "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." |
| 92 | } |
| 93 | }, |
| 94 | "required": ["ticker"] |
| 95 | } |
| 96 | } |
| 97 | """ |
| 98 | |
| 99 | ## 2. Parameter Descriptions |
| 100 | """ |
| 101 | Every parameter needs: |
| 102 | - What it is |
| 103 | - Format expected |
| 104 | - Example value |
| 105 | - Edge cases/limitations |
| 106 | |
| 107 | { |
| 108 | "location": { |
| 109 | "type": "string", |
| 110 | "description": "City and state/country. Format: 'City, State' for US |
| 111 | (e.g., 'San Francisco, CA') or 'City, Country' for international |
| 112 | (e.g., 'Tokyo, Japan'). Do not use ZIP codes or coordinates." |
| 113 | }, |
| 114 | "unit": { |
| 115 | "type": "string", |
| 116 | "enum": ["celsius", "fahrenheit"], |
| 117 | "description": "Temperature unit. Defaults to user's locale if not |
| 118 | specified. Use 'fahrenheit' for US users, 'celsius' for others." |
| 119 | } |
| 120 | } |
| 121 | """ |
| 122 | |
| 123 | ## 3. Use Enums When Possible |
| 124 | """ |
| 125 | Enums constrain the LLM to valid values: |
| 126 | |
| 127 | "priority": { |
| 128 | "type": "string", |
| 129 | "enum": ["low", "medium", "high", "critical"], |
| 130 | "description": "Task priority level" |
| 131 | } |
| 132 | |
| 133 | "action": { |
| 134 | "type": "string", |
| 135 | "enum": ["create", "read", "update", "delete"], |
| 136 | "description": "The CRUD operation to perform" |
| 137 | } |
| 138 | """ |
| 139 | |
| 140 | ## 4. Required vs Optional |
| 141 | """ |
| 142 | Be explicit about what's required: |
| 143 | |
| 144 | { |
| 145 | "type": "object", |
| 146 | "properties": { |
| 147 | "query": {...}, // Required |
| 148 | "limit": {...}, // Optional with default |
| 149 | "offset": {...} // Optional |
| 150 | }, |
| 151 | "required": ["query"], |
| 152 | "additionalProperties": false // Strict mode |
| 153 | } |
| 154 | """ |
| 155 | |
| 156 | ### Tool with Input Examples |
| 157 | |
| 158 | Using examples to guide LLM tool usage |
| 159 | |
| 160 | **When to use**: Complex tools with nested objects or format-sensitive inputs |
| 161 | |
| 162 | # TOOL USE EXAMPLES (Anthropic Beta Feature): |
| 163 | |
| 164 | """ |
| 165 | Examples show Claude concrete patterns that schemas can't express. |
| 166 | Improves accuracy from 72% to 90% on complex operatio |