Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: {} } },
  • 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); } }
  • 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()); }
  • Input schema for agent_list tool: accepts an empty object (no parameters required).
    inputSchema: { type: 'object', properties: {} } },

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/hlsitechio/mcp-instruct'

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