agent_list
Discover available AI agent personas to select the right assistant for your task, enabling personalized interactions through the MCP Instruct server's knowledge storage system.
Instructions
List all available AI agent personas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:878-896 (handler)Handler for the agent_list tool: initializes the AgentManager instance, retrieves all agent templates using getTemplates(), maps them to a simplified structure (id, name, category, truncated role), and returns as JSON text content.case 'agent_list': { await am.initialize(); const agents = am.getTemplates(); return { content: [ { type: 'text', text: JSON.stringify({ agents: agents.map(a => ({ id: a.id, name: a.name, category: a.metadata.category, role: a.metadata.role?.substring(0, 100) + '...' })) }, null, 2) } ] }; }
- src/index.ts:340-347 (registration)Registration of the agent_list tool in the tools array, including name, description, and input schema (empty object). This array is served via ListToolsRequestHandler.{ name: 'agent_list', description: 'List all available AI agent personas', inputSchema: { type: 'object', properties: {} } },
- src/AgentManager.ts:35-53 (helper)Helper method that dynamically loads agent templates from .md files in the 'agents/' directory, extracts metadata (role, expertise, category), and stores them in memory for listing.private async loadTemplates(): Promise<void> { const files = await readdir(this.agentsPath); const mdFiles = files.filter(file => extname(file) === '.md'); for (const file of mdFiles) { const filePath = join(this.agentsPath, file); const content = await readFile(filePath, 'utf-8'); const id = file.replace('.md', ''); const template: AgentTemplate = { id, name: this.formatName(id), content, metadata: this.extractMetadata(content) }; this.templates.set(id, template); } }
- src/AgentManager.ts:99-102 (helper)Helper method directly called by the handler to retrieve the full list of loaded agent templates.// Get all available templates getTemplates(): AgentTemplate[] { return Array.from(this.templates.values()); }
- src/index.ts:343-347 (schema)Input schema for agent_list tool: accepts an empty object (no parameters required).inputSchema: { type: 'object', properties: {} } },