get_skill
Retrieve detailed documentation and specifications for AI agent skills to understand their capabilities and implementation requirements.
Instructions
Get detailed information and documentation for a specific skill
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skill_id | Yes | Unique identifier of the skill |
Implementation Reference
- src/server.ts:251-302 (handler)Main handler for the get_skill tool. Validates the skill_id parameter, calls executor.getSkillDocumentation() to retrieve skill content, calls executor.getSkill() to retrieve the skill metadata, and combines them into the response. Handles errors for missing parameters and skill not found cases.case 'get_skill': { const skillId = args?.skill_id as string; if (!skillId) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: { code: 'InvalidParams', message: 'Missing required parameter: skill_id', }, }), }, ], isError: true, }; } const result = await this.executor.getSkillDocumentation(skillId); const skill = this.executor.getSkill(skillId); if (!result.success || !skill) { return { content: [ { type: 'text', text: JSON.stringify(result), }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify({ id: skill.id, name: skill.name, description: skill.description, content: result.content, source: skill.source, parameters: skill.parameters, metadata: skill.metadata, }), }, ], }; }
- src/server.ts:106-154 (registration)Tool registration and schema definition for get_skill. Defines the input schema (requiring skill_id parameter) and output schema (returning id, name, description, content, source, parameters, and metadata). Also sets annotations for read-only and openWorld behavior.{ name: 'get_skill', description: 'Get detailed information and documentation for a specific skill', inputSchema: { type: 'object', properties: { skill_id: { type: 'string', description: 'Unique identifier of the skill', }, }, required: ['skill_id'], }, outputSchema: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, description: { type: 'string' }, content: { type: 'string' }, source: { type: 'string' }, parameters: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, type: { type: 'string' }, description: { type: 'string' }, required: { type: 'boolean' }, }, }, }, metadata: { type: 'object', properties: { author: { type: 'string' }, version: { type: 'string' }, tags: { type: 'array', items: { type: 'string' } }, requirements: { type: 'array', items: { type: 'string' } }, }, }, }, }, annotations: { readOnlyHint: true, openWorldHint: false, }, },
- src/services/skill-executor.ts:50-67 (handler)getSkillDocumentation method that retrieves the skill content. Uses registry.getSkill() to fetch the skill by ID, returns the skill.content as the result. Handles errors for skill not found and general execution errors with appropriate error codes.async getSkillDocumentation(skillId: string): Promise<InvocationResult> { const startTime = Date.now(); try { const skill = this.registry.getSkill(skillId); if (!skill) { const executionTime = Date.now() - startTime; return createErrorResult('SkillNotFound', `Skill not found: ${skillId}`, executionTime); } const executionTime = Date.now() - startTime; return createSuccessResult(skill.content, executionTime); } catch (error) { const executionTime = Date.now() - startTime; const errorMessage = error instanceof Error ? error.message : String(error); return createErrorResult('ExecutionError', errorMessage, executionTime); } }
- getSkill method that retrieves a skill object by ID. Delegates to registry.getSkill() for the actual lookup and returns the Skill object or undefined if not found.getSkill(skillId: string): Skill | undefined { return this.registry.getSkill(skillId); }
- src/models/registry.ts:55-57 (helper)Core getSkill method in SkillRegistry that performs the actual lookup from the internal Map storage. Returns the Skill object for the given ID or undefined if not found.getSkill(id: string): Skill | undefined { return this.skills.get(id); }