Skip to main content
Glama

list-servers

Retrieve a list of all active MCP servers created and managed by MCP Create Server to monitor and control server instances efficiently.

Instructions

List all running servers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for the 'list-servers' tool. It calls serverManager.listServers() to get the list of running server IDs and returns them as JSON in a text content block.
    case "list-servers": { const servers = serverManager.listServers(); return { content: [ { type: "text", text: JSON.stringify({ servers }), }, ], }; }
  • The Tool object definition for 'list-servers', including its name, description, and empty input schema (no parameters required).
    const listServersTool: Tool = { name: "list-servers", description: "List all running servers", inputSchema: { type: "object", properties: {}, }, };
  • index.ts:1011-1022 (registration)
    Registration of the 'list-servers' tool (as listServersTool) in the ListToolsRequest handler response, making it discoverable by clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: [ createServerFromTemplateTool, executeToolTool, getServerToolsTool, deleteServerTool, listServersTool, ], }; });
  • Helper method in ServerManager class that returns an array of all running server IDs from the servers Map.
    // List all servers listServers(): string[] { return Array.from(this.servers.keys()); }

Other Tools

Related 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/tesla0225/mcp-create'

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