agent-tool-builder
Tools are how AI agents interact with the world. A well-designed tool is the difference between an agent that works and one that hallucinates, fails silently, or costs 10x more tokens than necessary. This skill covers tool design from schema to error handling.
What this skill does
# Agent Tool Builder
Tools are how AI agents interact with the world. A well-designed tool is the
difference between an agent that works and one that hallucinates, fails
silently, or costs 10x more tokens than necessary.
This skill covers tool design from schema to error handling. JSON Schema
best practices, description writing that actually helps the LLM, validation,
and the emerging MCP standard that's becoming the lingua franca for AI tools.
Key insight: Tool descriptions are more important than tool implementations.
The LLM never sees your code - it only sees the schema and description.
## Principles
- Description quality > implementation quality for LLM accuracy
- Aim for fewer than 20 tools - more causes confusion
- Every tool needs explicit error handling - silent failures poison agents
- Return strings, not objects - LLMs process text
- Validation gates before execution - reject, fix, or escalate, never silent fail
- Test tools with the LLM, not just unit tests
## Capabilities
- agent-tools
- function-calling
- tool-schema-design
- mcp-tools
- tool-validation
- tool-error-handling
## Scope
- multi-agent-coordination → multi-agent-orchestration
- agent-memory → agent-memory-systems
- api-design → api-designer
- llm-prompting → prompt-engineering
## Tooling
### Standards
- JSON Schema - When: All tool definitions Note: The universal format for tool schemas
- MCP (Model Context Protocol) - When: Building reusable, cross-platform tools Note: Anthropic's open standard, widely adopted
### Frameworks
- Anthropic SDK - When: Claude-based agents Note: Beta tool runner handles most complexity
- OpenAI Functions - When: OpenAI-based agents Note: Use strict mode for guaranteed schema compliance
- Vercel AI SDK - When: Multi-provider tool handling Note: Abstracts differences between providers
- LangChain Tools - When: LangChain-based agents Note: Converts MCP tools to LangChain format
## Patterns
### Tool Schema Design
Creating clear, unambiguous JSON Schema for tools
**When to use**: Defining any new tool for an agent
# TOOL SCHEMA BEST PRACTICES:
## 1. Detailed Descriptions (Most Important)
"""
BAD - Too vague:
{
"name": "get_stock_price",
"description": "Gets stock price",
"input_schema": {
"type": "object",
"properties": {
"ticker": {"type": "string"}
}
}
}
GOOD - Comprehensive:
{
"name": "get_stock_price",
"description": "Retrieves the current stock price for a given ticker
symbol. The ticker symbol must be a valid symbol for a publicly
traded company on a major US stock exchange like NYSE or NASDAQ.
Returns the latest trade price in USD. Use when the user asks
about current or recent stock prices. Does NOT provide historical
data, company info, or predictions.",
"input_schema": {
"type": "object",
"properties": {
"ticker": {
"type": "string",
"description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
}
},
"required": ["ticker"]
}
}
"""
## 2. Parameter Descriptions
"""
Every parameter needs:
- What it is
- Format expected
- Example value
- Edge cases/limitations
{
"location": {
"type": "string",
"description": "City and state/country. Format: 'City, State' for US
(e.g., 'San Francisco, CA') or 'City, Country' for international
(e.g., 'Tokyo, Japan'). Do not use ZIP codes or coordinates."
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Temperature unit. Defaults to user's locale if not
specified. Use 'fahrenheit' for US users, 'celsius' for others."
}
}
"""
## 3. Use Enums When Possible
"""
Enums constrain the LLM to valid values:
"priority": {
"type": "string",
"enum": ["low", "medium", "high", "critical"],
"description": "Task priority level"
}
"action": {
"type": "string",
"enum": ["create", "read", "update", "delete"],
"description": "The CRUD operation to perform"
}
"""
## 4. Required vs Optional
"""
Be explicit about what's required:
{
"type": "object",
"properties": {
"query": {...}, // Required
"limit": {...}, // Optional with default
"offset": {...} // Optional
},
"required": ["query"],
"additionalProperties": false // Strict mode
}
"""
### Tool with Input Examples
Using examples to guide LLM tool usage
**When to use**: Complex tools with nested objects or format-sensitive inputs
# TOOL USE EXAMPLES (Anthropic Beta Feature):
"""
Examples show Claude concrete patterns that schemas can't express.
Improves accuracy from 72% to 90% on complex operations.
"""
{
"name": "create_calendar_event",
"description": "Creates a calendar event with optional attendees and reminders",
"input_schema": {
"type": "object",
"properties": {
"title": {"type": "string", "description": "Event title"},
"start_time": {
"type": "string",
"description": "ISO 8601 datetime, e.g. 2024-03-15T14:00:00Z"
},
"duration_minutes": {"type": "integer", "description": "Event duration"},
"attendees": {
"type": "array",
"items": {"type": "string"},
"description": "Email addresses of attendees"
}
},
"required": ["title", "start_time", "duration_minutes"]
},
"input_examples": [
{
"title": "Team Standup",
"start_time": "2024-03-15T09:00:00Z",
"duration_minutes": 30,
"attendees": ["[email protected]", "[email protected]"]
},
{
"title": "Quick Chat",
"start_time": "2024-03-15T14:00:00Z",
"duration_minutes": 15
},
{
"title": "Project Review",
"start_time": "2024-03-15T16:00:00-05:00",
"duration_minutes": 60,
"attendees": ["[email protected]"]
}
]
}
# EXAMPLE DESIGN PRINCIPLES:
# - Use realistic data, not placeholders
# - Show minimal, partial, and full specification patterns
# - Keep concise: 1-5 examples per tool
# - Focus on ambiguous cases
### Tool Error Handling
Returning errors that help the LLM recover
**When to use**: Any tool that can fail
# ERROR HANDLING BEST PRACTICES:
## Return Informative Errors
"""
BAD:
{"error": "Failed"}
{"error": true}
GOOD:
{
"error": true,
"error_type": "not_found",
"message": "Location 'Atlantis' not found in weather database.
Please provide a real city name like 'San Francisco, CA'.",
"suggestions": ["San Francisco, CA", "Los Angeles, CA"]
}
"""
## Anthropic Tool Result with Error
"""
{
"type": "tool_result",
"tool_use_id": "toolu_01A09q90qw90lq917835lq9",
"content": "Error: Location 'Atlantis' not found in weather database.
Please provide a real city name like 'San Francisco, CA'.",
"is_error": true
}
"""
## Error Categories to Handle
"""
1. Input Validation Errors
- Missing required parameters
- Invalid format
- Out of range values
2. External Service Errors
- API unavailable
- Rate limited
- Timeout
3. Business Logic Errors
- Resource not found
- Permission denied
- Conflict/duplicate
4. Internal Errors
- Unexpected exceptions
- Data corruption
"""
## Implementation Pattern
"""
from dataclasses import dataclass
from typing import Union
@dataclass
class ToolResult:
success: bool
content: str
error_type: str = None
suggestions: list[str] = None
def to_response(self) -> dict:
if self.success:
return {"content": self.content}
return {
"content": f"Error ({self.error_type}): {self.content}",
"is_error": True
}
def get_weather(location: str) -> ToolResult:
# Validate input
if not location or len(location) < 2:
return ToolResult(
success=False,
content="Location must be at least 2 characters",
error_type="validation_error"
)
try:
data = weather_api.fetch(location)
return ToolResult(
success=True,
content=f"Temperature: {data.temp}°F, Conditions: {daRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.