Skip to main content
Glama
oaslananka

MCP Health Monitor

List Registered Servers

list_servers
Read-only

List all registered MCP servers and view their current status (up, down, or unknown) to monitor server health.

Instructions

List all registered MCP servers with their current status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
statusNo

Implementation Reference

  • src/app.ts:707-726 (registration)
    Registration of the 'list_servers' tool with the MCP server, including title, description, inputSchema, annotations, and handler callback.
    server.registerTool(
      'list_servers',
      {
        title: 'List Registered Servers',
        description: 'List all registered MCP servers with their current status.',
        inputSchema: ListServersSchema,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          openWorldHint: false
        }
      },
      async (input: ListServersInput) => {
        const servers = listServers(input);
        return formatResponse({
          count: servers.length,
          servers
        });
      }
    );
  • Core handler function `listServers` that queries the SQLite database using a CTE to fetch servers with latest health check info and 24h uptime percentage, then filters by optional tags and status.
    export function listServers(options: ListServersInput): ServerStatus[] {
      const since24Hours = Date.now() - 24 * 60 * 60 * 1000;
      const rows = getDb()
        .prepare(
          `
            WITH latest_checks AS (
              SELECT
                server_name,
                tool_count,
                ROW_NUMBER() OVER (
                  PARTITION BY server_name
                  ORDER BY timestamp DESC, id DESC
                ) AS row_number
              FROM health_checks
            ),
            uptime_24h AS (
              SELECT
                server_name,
                CAST(ROUND(100.0 * SUM(CASE WHEN status = 'up' THEN 1 ELSE 0 END) / COUNT(*)) AS INTEGER) AS uptime_24h_percent
              FROM health_checks
              WHERE timestamp > ?
              GROUP BY server_name
            )
            SELECT
              s.*,
              latest_checks.tool_count AS latest_tool_count,
              uptime_24h.uptime_24h_percent
            FROM servers s
            LEFT JOIN latest_checks
              ON latest_checks.server_name = s.name
             AND latest_checks.row_number = 1
            LEFT JOIN uptime_24h
              ON uptime_24h.server_name = s.name
            ORDER BY s.name ASC
          `
        )
        .all(since24Hours) as ListServerRow[];
    
      return rows
        .filter((row) => {
          if (!options.tags?.length) {
            return true;
          }
    
          const tags = parseJsonArray(row.tags);
          return options.tags.some((tag: string) => tags.includes(tag));
        })
        .map(buildServerStatus)
        .filter((serverStatus) => {
          if (!options.status) {
            return true;
          }
    
          return serverStatus.status === options.status;
        });
    }
  • Zod schema `ListServersSchema` defining input validation: optional `tags` (array of strings) and optional `status` (one of 'up', 'down', 'unknown').
    export const ListServersSchema = z.object({
      tags: z.array(z.string()).optional(),
      status: ListableStatusSchema.optional()
    });
  • Helper function `buildServerStatus` that maps a database row to the `ServerStatus` interface, including optional url/command fields.
    function buildServerStatus(row: ListServerRow): ServerStatus {
      const status: ServerStatus = {
        name: row.name,
        type: row.type,
        status: mapStatus(row.last_status),
        last_checked: row.last_checked,
        last_response_time_ms: row.last_response_time_ms,
        tool_count: row.latest_tool_count,
        uptime_24h_percent: row.uptime_24h_percent,
        consecutive_failures: row.consecutive_failures ?? 0,
        tags: parseJsonArray(row.tags)
      };
    
      if (row.url) {
        status.url = row.url;
      }
    
      if (row.command) {
        status.command = row.command;
      }
    
      return status;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds nothing beyond stating the action. It does not disclose any additional behavioral traits such as rate limits, data freshness, or implications of filtering.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence, no fluff, but lacks essential information about parameters. It is concise at the expense of completeness. For a tool with 2 optional params, a brief mention of filtering would improve without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has two optional parameters and no output schema, the description should explain the filtering options and return value. It only says 'with their current status' which is vague. The description is insufficient for an agent to understand the full capability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not explain the 'tags' or 'status' parameters. The description mentions 'all' servers but does not hint at optional filtering, leaving the agent unaware of how to use the input parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'list' and resource 'registered MCP servers', with 'current status' added. This distinguishes it from sibling tools like check_server (which likely checks a specific server) and register/unregister (which mutate). The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like check_all, get_dashboard, etc. The description does not provide context about typical use cases or comparisons, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/oaslananka/mcp-health-monitor'

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