Skip to main content
Glama
oaslananka

MCP Health Monitor

Get Health Dashboard

get_dashboard
Read-only

View a dashboard overview of all registered MCP servers with uptime and performance stats. Customize the time range up to 168 hours and optionally include tool statistics.

Instructions

Get a dashboard overview of all registered MCP servers with uptime and performance stats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNo
include_tool_statsNo

Implementation Reference

  • Handler function for the 'get_dashboard' tool. Fetches a dashboard report via getDashboardReport(), computes summary stats (total, up, down, avg uptime), and enriches each server entry with alerts and optional tool stats.
    server.registerTool(
      'get_dashboard',
      {
        title: 'Get Health Dashboard',
        description:
          'Get a dashboard overview of all registered MCP servers with uptime and performance stats.',
        inputSchema: GetDashboardSchema,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          openWorldHint: false
        }
      },
      async (input: GetDashboardInput) => {
        const report = getDashboardReport(input.hours);
        const uptimeValues = report
          .map((entry) => entry.uptime_percent)
          .filter((value): value is number => value !== null);
        const upCount = report.filter((entry) => entry.current_status === 'up').length;
    
        return formatResponse({
          period_hours: input.hours,
          summary: {
            total_servers: report.length,
            currently_up: upCount,
            currently_down: report.length - upCount,
            avg_uptime_percent:
              uptimeValues.length > 0
                ? Math.round(
                    uptimeValues.reduce((sum, value) => sum + value, 0) / uptimeValues.length
                  )
                : null
          },
          include_tool_stats: input.include_tool_stats,
          servers: report.map((serverReport) => {
            const latest = getLatestDashboardResult(serverReport);
            const payload = {
              ...serverReport,
              alerts: latest
                ? enrichWithAlerts(serverReport.name, latest, { hours: input.hours })
                : { has_alerts: false, findings: [] }
            };
    
            if (input.include_tool_stats) {
              return payload;
            }
    
            return {
              ...payload,
              tool_count: undefined
            };
          })
        });
      }
  • Input schema for get_dashboard: 'hours' (1-168, default 24) and 'include_tool_stats' (boolean, default true).
    export const GetDashboardSchema = z.object({
      hours: z.number().int().min(1).max(168).default(24),
      include_tool_stats: z.boolean().default(true)
    });
  • Core helper that queries the database for servers and health checks within the given time window, then computes per-server dashboard entries (uptime percent, average/p50/p95 response times, total checks, consecutive failures, tool count).
    export function getDashboardReport(hours: number): DashboardReportEntry[] {
      const db = getDb();
      const since = Date.now() - hours * 60 * 60 * 1000;
      const servers = db
        .prepare(
          `
            SELECT name, last_status, consecutive_failures
            FROM servers
            ORDER BY name ASC
          `
        )
        .all() as DashboardServerRow[];
      const checks = db
        .prepare(
          `
            SELECT server_name, status, response_time_ms, tool_count
            FROM health_checks
            WHERE timestamp > ?
            ORDER BY server_name ASC, timestamp DESC, id DESC
          `
        )
        .all(since) as DashboardCheckRow[];
      const checksByServer = new Map<string, DashboardCheckRow[]>();
    
      for (const check of checks) {
        const serverChecks = checksByServer.get(check.server_name) ?? [];
        serverChecks.push(check);
        checksByServer.set(check.server_name, serverChecks);
      }
    
      return servers.map((server) => {
        const serverChecks = checksByServer.get(server.name) ?? [];
        const responseTimes = serverChecks
          .map((check) => check.response_time_ms)
          .filter((value): value is number => value !== null);
        const upCount = serverChecks.filter((check) => check.status === 'up').length;
        const averageResponseTime =
          responseTimes.length > 0
            ? Math.round(responseTimes.reduce((sum, value) => sum + value, 0) / responseTimes.length)
            : null;
    
        return {
          name: server.name,
          current_status: server.last_status ?? 'unknown',
          uptime_percent:
            serverChecks.length > 0 ? Math.round((upCount / serverChecks.length) * 100) : null,
          avg_response_time_ms: averageResponseTime,
          p50_response_time_ms: calculatePercentile(responseTimes, 0.5),
          p95_response_time_ms: calculatePercentile(responseTimes, 0.95),
          total_checks: serverChecks.length,
          consecutive_failures: server.consecutive_failures ?? 0,
          tool_count: serverChecks[0]?.tool_count ?? null
        };
      });
    }
  • src/app.ts:635-641 (registration)
    Registration of the 'get_dashboard' tool via server.registerTool, with metadata, input schema reference, and annotations.
    server.registerTool(
      'get_dashboard',
      {
        title: 'Get Health Dashboard',
        description:
          'Get a dashboard overview of all registered MCP servers with uptime and performance stats.',
        inputSchema: GetDashboardSchema,
  • Type definition for DashboardReportEntry, the structure returned per server in the dashboard report.
    export interface DashboardReportEntry {
      name: string;
      current_status: RegisteredServer['last_status'];
      uptime_percent: number | null;
      avg_response_time_ms: number | null;
      p50_response_time_ms: number | null;
      p95_response_time_ms: number | null;
      total_checks: number;
      consecutive_failures: number;
      tool_count: number | null;
    }
Behavior4/5

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

Annotations already declare readOnlyHint and destructiveHint false. Description adds behavioral context: returns a dashboard of all servers with specific metrics (uptime, performance). No contradictions.

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

Conciseness5/5

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

Single, concise sentence that immediately conveys purpose. No fluff.

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

Completeness4/5

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

Adequate for a simple read-only dashboard tool with clear annotations. Could mention the return format or what 'performance stats' includes, but not critical given simplicity.

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

Parameters2/5

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

No parameter descriptions in either schema or tool description. Schema has 0% description coverage. While parameter names and defaults hint at meaning (hours for time range, include_tool_stats flag), the description fails to explain them, forcing inference.

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?

Clearly states it retrieves a dashboard overview of all registered MCP servers with uptime and performance stats. Distinct from sibling tools like get_uptime (specific server) and get_monitor_stats (detailed stats).

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

Usage Guidelines4/5

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

Provides clear context for use (overview of all servers), but does not explicitly mention when not to use or list alternatives. Suggests it's for high-level monitoring.

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