load_skills
Load and integrate multiple skills into an AI agent's knowledge base to enhance specialized task execution. Supports skill IDs and optional agent naming for targeted functionality.
Instructions
Load and combine multiple skills into an agent's knowledge base
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_name | No | Optional: name for the specialized agent (e.g. sql-expert) | |
| skill_ids | Yes | Array of skill IDs to load (e.g., ['clean-code-clarity-readability', 'testing-strategies']) |
Implementation Reference
- src/server.ts:253-331 (handler)The core handler function for the 'load_skills' tool. It validates input skill_ids array, fetches the corresponding skill prompts from promptManager, optionally appends an agent profile prompt if agent_name is provided, constructs a formatted markdown table and instructions for the skills, and returns it as text content.case "load_skills": if (!args || !Array.isArray(args.skill_ids)) { throw new McpError( ErrorCode.InvalidRequest, "skill_ids array is required" ); } const skillPrompts = []; for (const skillId of args.skill_ids) { const skill = await this.promptManager.getPrompt(skillId); if (skill) { skillPrompts.push(skill); } } if (skillPrompts.length === 0) { throw new McpError( ErrorCode.InvalidRequest, "No valid skills found with provided IDs" ); } let resultPrompt = ""; if ( args && args.agent_name && typeof args.agent_name === "string" && args.agent_name != "" ) { const agentName = args.agent_name; const agentPrompts = this.promptManager.searchPromptByProfile(agentName); const agentPrompt = agentPrompts.length > 0 ? agentPrompts[0] : undefined; if (agentPrompt) { resultPrompt += "# Your Profile" + "/nPlease read your profile carefully and try to imagine yourself in the role as much as possible. You embody this person."; resultPrompt = resultPrompt + "/n" + agentPrompt.prompt; resultPrompt = resultPrompt + +"/n/n" + (agentPrompt.examples || [])?.join("/n"); } } resultPrompt += "# Your Skillset" + "/nThese are your skills, please familiarize yourself with them and internalize them. It's like the religion you live. Respect the skills and be confident with them. Feel free to take notes and summarize them for yourself."; resultPrompt += `Your specialized Skills (${skillPrompts.length}): | title | description | examples | | -------- | -------- | -------- | ${skillPrompts.map( (skill) => `| ${skill.title} | ${skill.description} | ${(skill.examples || []) .map((item) => item.input) .join("\n")} |` )} Please acknowledge that you have integrated these skills and are ready to apply them in your responses. Use these skills naturally when relevant to user requests.`; logger.info(`Loaded ${skillPrompts.length} skills for your agent`); return { content: [ { type: "text", text: resultPrompt, }, ], };