skill
Load complete skill instructions with step-by-step guidance, examples, and file references for implementation.
Instructions
Load a skill's full instructions. Returns the complete SKILL.md content with step-by-step guidance, examples, and file references to follow.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Skill name from <available_skills> |
Implementation Reference
- src/skill-tool.ts:47-86 (handler)The async handler function for the "skill" MCP tool. It parses the skill name from args, retrieves the skill metadata from the map, loads the SKILL.md content using loadSkillContent, and returns it as markdown text or an error response.async (args): Promise<CallToolResult> => { const { name } = SkillSchema.parse(args); const skill = skillMap.get(name); if (!skill) { const availableSkills = Array.from(skillMap.keys()).join(", "); return { content: [ { type: "text", text: `Skill "${name}" not found. Available skills: ${availableSkills || "none"}`, }, ], isError: true, }; } try { const content = loadSkillContent(skill.path); return { content: [ { type: "text", text: content, }, ], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Failed to load skill "${name}": ${message}`, }, ], isError: true, }; } }
- src/skill-tool.ts:18-20 (schema)Zod input schema for the "skill" tool, defining the required 'name' parameter.const SkillSchema = z.object({ name: z.string().describe("Skill name from <available_skills>"), });
- src/skill-tool.ts:32-88 (registration)MCP server registration of the "skill" tool, providing title, description, schema, annotations, and handler.server.registerTool( "skill", { title: "Activate Skill", description: "Load a skill's full instructions. Returns the complete SKILL.md content " + "with step-by-step guidance, examples, and file references to follow.", inputSchema: SkillSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async (args): Promise<CallToolResult> => { const { name } = SkillSchema.parse(args); const skill = skillMap.get(name); if (!skill) { const availableSkills = Array.from(skillMap.keys()).join(", "); return { content: [ { type: "text", text: `Skill "${name}" not found. Available skills: ${availableSkills || "none"}`, }, ], isError: true, }; } try { const content = loadSkillContent(skill.path); return { content: [ { type: "text", text: content, }, ], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Failed to load skill "${name}": ${message}`, }, ], isError: true, }; } } );
- src/index.ts:74-74 (registration)Invocation of registerSkillTool during server initialization, passing the McpServer and skill map.registerSkillTool(server, skillMap);
- src/skill-discovery.ts:154-158 (helper)Helper function used by the skill tool handler to read the full content of SKILL.md file.* Load the full content of a skill's SKILL.md file. */ export function loadSkillContent(skillPath: string): string { return fs.readFileSync(skillPath, "utf-8"); }