/context-engineering:mcp-tool-devfrom context-engineering
Creates individual MCP tool functions with schemas, descriptions, and handlers following Model Context Protocol and Anthropic best practices.
Ships in context-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create individual MCP tool functions that follow Anthropic's tool design best practices and the Model Context Protocol specification.
An MCP tool is a single function exposed via the Model Context Protocol that an LLM can invoke. Each tool has:
search_documents, get_user, create_issue)Tools can be standalone (single-file utilities) or part of an MCP server (grouped related tools).
mcp-server-dev insteadEvery MCP tool consists of four parts:
Use snake_case with verb-noun pattern. Be specific — search_files_by_content beats search.
Write 3-4 sentences covering:
Good descriptions prevent misuse and reduce wasted calls. Include parameter semantics — if "query" means regex vs full-text vs exact match, say so.
Define parameters using JSON Schema with:
description for each parameter explaining expected format and semanticsenum constraints where values are knowndefault values for optional parametersAsync function that:
[{"type": "text", "text": "..."}]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.
Define what the tool does before writing code:
For FastMCP, the schema is implicit in the function signature. For manual schemas:
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"]
}
}
Write the async handler function. Key principles:
Test the handler directly by calling it with a dict:
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()
tools/list responseUse templates/mcp-tool-template.py as a starting point. It includes the FastMCP decorator pattern, input validation, content block returns, and error handling.
For detailed SDK examples, Anthropic best practices, and real-world patterns, see references/tool-design-patterns.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub andisab/swe-marketplace --plugin context-engineering7 skills in this plugin
/agent-devUse this skill when creating or refining Claude Code sub-agent definitions. Helps design specialized AI assistants with proper YAML frontmatter, system prompts, tool access, and example-driven descriptions. Automatically invoked when user requests "create an agent", "design a sub-agent", "make a specialist", or mentions agent development. Ensures agents follow Anthropic best practices with focused responsibilities, discovery-optimized descriptions, and proper tool restrictions.
/command-devUse this skill when creating or refining custom Claude Code slash commands. Slash commands are user-invoked reusable prompts that can accept arguments, reference files, and execute bash operations. Helps design command syntax, argument handling, file references, bash execution, and frontmatter configuration. Automatically invoked when user requests "create a command", "make a slash command", "add a /command", or mentions custom command development.
/hook-devUse this skill when creating or refining Claude Code hooks. Hooks are shell commands that execute at specific lifecycle events (tool use, prompt submit, notifications, session events). Helps design event handlers for notifications, formatting, logging, feedback, and permission control. Automatically invoked when user requests "create a hook", "add automation", "event handler", "workflow automation", or mentions hook development.
/mcp-server-devCreate MCP servers — multi-tool services exposed via Model Context Protocol. Use this skill whenever users mention MCP servers, building servers, server scaffolding, tool registration, or want to package tools for distribution via uvx or npx. Also use when the conversation involves stdio transport, server lifecycle, or grouping multiple related tools into a service. Covers Python (FastMCP) and TypeScript (@modelcontextprotocol/sdk) patterns, packaging, and testing.
Activate for: - "Create an MCP server" - "Build a server with multiple tools" - "Package tools for uvx/npx" - "Set up stdio transport" - "Register tools on a server"
Do NOT use for: - Creating a single standalone tool function (use mcp-tool-dev) - General REST API development - Claude Code agents, skills, or commands
/plugin-devUse this skill when creating or refining Claude Code plugins. Plugins are bundled collections of agents, skills, commands, hooks, and MCP servers that provide cohesive functionality. Helps design proper directory structures, plugin.json configuration, marketplace distribution, and installation workflows. Automatically invoked when user requests "create a plugin", "bundle components", "distribute capabilities", or mentions plugin development.
/skill-devUse this skill when creating or refining Claude Code skill definitions. Skills are model-invoked capabilities that Claude activates autonomously based on context. Helps design focused skills with discovery-optimized descriptions, proper directory structures, and supporting resources. Automatically invoked when user requests "create a skill", "make a capability", "add autonomous behavior", or mentions skill development. Ensures skills follow Anthropic specifications with clear activation triggers.
Other plugins' skills for the same job