mcp-tool-dev
Create MCP tools — individual tool functions exposed via Model Context Protocol. Use this skill whenever users mention MCP tools, tool handlers, tool functions, tool definitions, or want to add capabilities to an MCP server. Also use when the conversation involves designing tool schemas, writing tool descriptions, or implementing tool input validation. Covers FastMCP patterns, Anthropic tool description best practices, and testing strategies. Activate for: - "Create an MCP tool" - "Add a tool to my MCP server" - "Write a tool handler" - "Design a tool schema" - "Implement tool input validation" Do NOT use for: - Creating full MCP servers with multiple tools (use mcp-server-dev) - General API development without MCP - Claude Code slash commands or hooks
What this skill does
# MCP Tool Creation
Create individual MCP tool functions that follow Anthropic's tool design best practices and the Model Context Protocol specification.
## What MCP Tools Are
An MCP tool is a single function exposed via the Model Context Protocol that an LLM can invoke. Each tool has:
- **Name**: Verb-noun format (`search_documents`, `get_user`, `create_issue`)
- **Description**: 3-4 sentences explaining what the tool does, when to use it, and when not to
- **Input schema**: JSON Schema defining parameters with clear descriptions
- **Handler**: Async function that processes the input and returns MCP content blocks
Tools can be standalone (single-file utilities) or part of an MCP server (grouped related tools).
## When to Use This Skill
- Creating a single tool function for an existing or new MCP server
- Designing tool schemas and descriptions
- Implementing tool input validation and error handling
- Adding capabilities to a FastMCP server
## When NOT to Use
- Building a complete multi-tool MCP server from scratch — use `mcp-server-dev` instead
- Creating Claude Code agents, skills, or commands — use their respective creation skills
## Tool Anatomy
Every MCP tool consists of four parts:
### 1. Name
Use `snake_case` with verb-noun pattern. Be specific — `search_files_by_content` beats `search`.
### 2. Description
Write 3-4 sentences covering:
1. What the tool does (capability statement)
2. When to use it (primary use cases)
3. When NOT to use it (scope boundaries, suggest alternatives)
4. Key behavior notes (pagination, rate limits, return format)
Good descriptions prevent misuse and reduce wasted calls. Include parameter semantics — if "query" means regex vs full-text vs exact match, say so.
### 3. Input Schema
Define parameters using JSON Schema with:
- Clear `description` for each parameter explaining expected format and semantics
- `enum` constraints where values are known
- `default` values for optional parameters
- Required vs optional distinction
### 4. Handler Function
Async function that:
- Validates inputs early (fail fast with specific error messages)
- Returns MCP content blocks: `[{"type": "text", "text": "..."}]`
- Handles errors with corrective guidance (tell the caller what to do differently)
## Quick Reference: FastMCP Pattern (Primary)
```python
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
async def search_documents(query: str, max_results: int = 10) -> str:
"""Search documents by content.
Performs full-text search across all indexed documents. Use this tool
when the user wants to find documents containing specific terms or phrases.
Do not use for metadata-only searches — use list_documents with filters instead.
Args:
query: Full-text search query. Supports AND/OR operators.
max_results: Maximum results to return (1-100, default 10).
"""
if not query.strip():
return "Error: query cannot be empty. Provide a search term."
max_results = min(max(1, max_results), 100)
results = await do_search(query, max_results)
return format_results(results)
```
FastMCP infers the JSON Schema from the function signature and docstring. Type hints drive the schema; the docstring `Args:` section populates parameter descriptions.
## Creation Workflow
### Step 1: Design the Tool Interface
Define what the tool does before writing code:
- Name (verb_noun)
- 3-4 sentence description
- Parameters with types and descriptions
- Return format
- Error cases
### Step 2: Write the Schema
For FastMCP, the schema is implicit in the function signature. For manual schemas:
```python
TOOL_SCHEMA = {
"name": "search_documents",
"description": "Search documents by content...",
"inputSchema": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "Full-text search query"},
"max_results": {"type": "integer", "default": 10, "minimum": 1, "maximum": 100}
},
"required": ["query"]
}
}
```
### Step 3: Implement the Handler
Write the async handler function. Key principles:
- Validate inputs at the top
- Keep handlers focused — one tool, one job
- Return structured text (markdown tables, JSON snippets) rather than raw data dumps
- Include context in error messages
### Step 4: Write Tests
Test the handler directly by calling it with a dict:
```python
async def test_search_documents():
result = await search_documents("test query", max_results=5)
assert "results" in result.lower() or isinstance(result, str)
async def test_search_documents_empty_query():
result = await search_documents("")
assert "error" in result.lower()
```
### Step 5: Validate
- Verify the tool appears in `tools/list` response
- Test with Claude to check description clarity
- Confirm error messages guide the caller to correct usage
## Template Reference
Use `templates/mcp-tool-template.py` as a starting point. It includes the FastMCP decorator pattern, input validation, content block returns, and error handling.
## Common Mistakes
1. **Vague descriptions** — "Does stuff with files" gives the LLM no guidance on when to call the tool
2. **Missing parameter descriptions** — parameters without descriptions force the LLM to guess semantics
3. **Generic error messages** — "Error occurred" wastes a tool call; "Query too long (max 500 chars), truncate and retry" helps recovery
4. **Returning raw data** — dumping an entire JSON response; instead format key fields into readable text
5. **Too many parameters** — more than 5-6 parameters signals the tool should be split
6. **No input validation** — trusting all inputs leads to cryptic downstream errors
For detailed SDK examples, Anthropic best practices, and real-world patterns, see `references/tool-design-patterns.md`.
Related 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.