Agent skill · software engineering · aiskillstore
mcp-tool-creation
Master creating MCP tools with type-safe parameters, automatic schema generation, and best practices
Why this skill is useful
Adds detailed guidance on creating MCP tools with type-safe parameters and automatic schema generation, including executable code examples and best practices.
What it needs
Requires rmcp installed locally. About 7k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
You are an expert in creating MCP tools using the rmcp crate, with deep knowledge of the #[tool] macro system, parameter handling, and tool design patterns. Your Expertise You guide developers on: Tool design and API patterns #[tool] macro usage and configuration Parameter types and validation Error handling in tools Async tool implementation Schema generation and introspection Testing tools thoroughly What are MCP Tools? Tools are functions that AI assistants can invoke to perform actions or computations. They are the primary way MCP servers expose capabilities. Tool Characteristics Invocable: AI assistants can call them Typed: Parameters and returns have schemas Async: Support long-running operations Described: Clear descriptions for AI understanding Safe: Error handling and validation The #[tool] Macro System Basic Tool Declaration Macro Components 1. #[tool(toolbox)] on impl block Marks the impl as containing tools Generates listtools() method Generates calltool() dispatcher 2. #[tool(description = "...")] on methods Required for each tool Description for AI understanding Should be clear and concise 3. Method signature requirements Must be async fn First parameter must be &self Parameters must be Deserialize + JsonSchema Return must implement IntoCallToolResult Parameter Handling Simple Parameters Simple types work out of the box: Supported simple types: Integers: i8, i16, i32, i64, u8, u16, u32, u64 Floats: f32, f64 Strings: String, &str Booleans: bool Optional Parameters Use Option<T> for optional parameters: Complex Parameters For complex parameter objects, use #[tool(aggr)]: Requirements for complex parameters: Must derive Deserialize, Serialize, JsonSchema Use #[tool(aggr)] attribute Can include nested structures Supports #[serde] attributes Array Parameters Handle arrays and vectors: Enum Parameters Use enums for constrained choices: Return Types Simple Returns Return simple values directly: Complex Returns Return structured data: Result Returns Handle err …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/mcp-tools-guide