Skip to main content
Glama

use_skill

Load expert-crafted workflows and best practices to guide AI assistants through proven techniques for coding tasks, using community or custom skills.

Instructions

Load and read a specific skill to guide your work. Skills contain proven workflows, mandatory processes, and expert techniques.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skill_nameYesName of the skill to load (e.g., "superpowers:brainstorming", "my-custom-skill")

Implementation Reference

  • The main handler function for the 'use_skill' tool. It resolves the skill path using resolveSkillPath, reads and processes the SKILL.md file (extracting and stripping YAML frontmatter), constructs a header, and returns the skill content as text.
    if (name === 'use_skill') { const { skill_name } = args; const resolved = resolveSkillPath(skill_name); if (!resolved) { return { content: [{ type: 'text', text: `Error: Skill "${skill_name}" not found.\n\nRun find_skills to see available skills.` }] }; } const fullContent = fs.readFileSync(resolved.skillFile, 'utf8'); const { name: skillDisplayName, description } = extractFrontmatter(resolved.skillFile); const content = stripFrontmatter(fullContent); const skillDirectory = path.dirname(resolved.skillFile); const skillHeader = `# ${skillDisplayName || skill_name} # ${description || ''} # Supporting tools and docs are in ${skillDirectory} # ============================================`; return { content: [{ type: 'text', text: `${skillHeader}\n\n${content}` }] }; }
  • The input schema definition for the 'use_skill' tool, specifying the required 'skill_name' parameter.
    { name: 'use_skill', description: 'Load and read a specific skill to guide your work. Skills contain proven workflows, mandatory processes, and expert techniques.', inputSchema: { type: 'object', properties: { skill_name: { type: 'string', description: 'Name of the skill to load (e.g., "superpowers:brainstorming", "my-custom-skill")' } }, required: ['skill_name'] } }
  • The 'use_skill' tool is registered by including its definition in the tools list returned by the ListToolsRequest handler.
    const tools = [ { name: 'find_skills', description: 'List all available skills in the personal and superpowers skill libraries.', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'use_skill', description: 'Load and read a specific skill to guide your work. Skills contain proven workflows, mandatory processes, and expert techniques.', inputSchema: { type: 'object', properties: { skill_name: { type: 'string', description: 'Name of the skill to load (e.g., "superpowers:brainstorming", "my-custom-skill")' } }, required: ['skill_name'] } } ]; return { tools }; });
  • Helper function to resolve a skill name to its file path, checking personal skills first then superpowers skills.
    function resolveSkillPath(skillName) { const forceSuperpowers = skillName.startsWith('superpowers:'); const actualSkillName = forceSuperpowers ? skillName.replace(/^superpowers:/, '') : skillName; // Try personal skills first (unless explicitly superpowers:) if (!forceSuperpowers && personalSkillsDir) { const personalPath = path.join(personalSkillsDir, actualSkillName); const personalSkillFile = path.join(personalPath, 'SKILL.md'); if (fs.existsSync(personalSkillFile)) { return { skillFile: personalSkillFile, sourceType: 'personal', skillPath: actualSkillName }; } } // Try superpowers skills if (superpowersSkillsDir) { const superpowersPath = path.join(superpowersSkillsDir, actualSkillName); const superpowersSkillFile = path.join(superpowersPath, 'SKILL.md'); if (fs.existsSync(superpowersSkillFile)) { return { skillFile: superpowersSkillFile, sourceType: 'superpowers', skillPath: actualSkillName }; } } return null; }

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmcdice/superpower-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server