Skip to main content
Glama
oaslananka

MCP Health Monitor

Check All Projects Health

check_all_projects
Read-only

Assess both MCP server health and Azure DevOps pipeline status for all registered projects, identifying issues to ensure system uptime.

Instructions

Check both MCP server health and Azure DevOps pipeline status across all registered projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeout_msNo

Implementation Reference

  • The main handler function for the 'check_all_projects' tool. It lists all MCP servers and Azure pipeline groups, then concurrently checks health for each. Returns a summary with up/down counts.
    async (input: CheckAllProjectsInput) => {
      const servers = listServers({});
      const pipelineGroups = listAzurePipelineGroups();
    
      const [mcpResults, pipelineResults] = await Promise.all([
        Promise.allSettled(
          servers.map(async (listedServer) => {
            const serverConfig = getServer(listedServer.name);
            if (!serverConfig) {
              return {
                name: listedServer.name,
                type: 'mcp_server',
                ...buildErrorResult(new Error(`Server not found: ${listedServer.name}`))
              };
            }
    
            const result = await checkServer(serverConfig, input.timeout_ms);
            recordHealthCheck(listedServer.name, result);
            return {
              name: listedServer.name,
              type: 'mcp_server',
              ...result
            };
          })
        ),
        Promise.allSettled(
          pipelineGroups.map(async (groupName) => {
            const groupRows = listAzurePipelines(groupName);
            const pipelines = await Promise.all(
              groupRows.map(async (row) => {
                if (!row.pipeline_id) {
                  return {
                    pipeline: row.pipeline_name,
                    status: 'unknown'
                  };
                }
    
                const run = await getLatestRun(
                  row.organization,
                  row.project,
                  row.pipeline_id,
                  decodePatToken(row.pat_token_encrypted)
                );
    
                if (!run) {
                  return {
                    pipeline: row.pipeline_name,
                    status: 'unknown'
                  };
                }
    
                recordPipelineRun(row.group_name, row.pipeline_name, run);
                return {
                  pipeline: row.pipeline_name,
                  ...run
                };
              })
            );
    
            return {
              group: groupName,
              type: 'azure_pipeline',
              pipelines
            };
          })
        )
      ]);
    
      const mcp = mcpResults.map((result) =>
        result.status === 'fulfilled' ? result.value : { error: String(result.reason) }
      );
      const pipelines = pipelineResults.map((result) =>
        result.status === 'fulfilled' ? result.value : { error: String(result.reason) }
      );
      const mcpDown = mcp.filter(
        (result) =>
          typeof result === 'object' &&
          result !== null &&
          'status' in result &&
          result.status !== 'up'
      ).length;
      const pipelineFailed = pipelines
        .flatMap((group) =>
          typeof group === 'object' && group !== null && 'pipelines' in group
            ? ((group.pipelines as Array<Record<string, unknown>>) ?? [])
            : []
        )
        .filter((pipeline) => pipeline.status === 'failed').length;
    
      return formatResponse({
        summary: `MCP: ${mcp.length - mcpDown}/${mcp.length} up | Pipelines: ${pipelineFailed} failed`,
        mcp_servers: mcp,
        azure_pipelines: pipelines
      });
    }
  • Zod schema defining the input for check_all_projects: timeout_ms (1000-30000, default 5000).
    export const CheckAllProjectsSchema = z.object({
      timeout_ms: z.number().int().min(1000).max(30000).default(5000)
    });
  • src/app.ts:525-633 (registration)
    Registers the 'check_all_projects' tool with metadata (title, description, inputSchema, annotations) on the MCP server.
    server.registerTool(
      'check_all_projects',
      {
        title: 'Check All Projects Health',
        description:
          'Check both MCP server health and Azure DevOps pipeline status across all registered projects.',
        inputSchema: CheckAllProjectsSchema,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          openWorldHint: true
        }
      },
      async (input: CheckAllProjectsInput) => {
        const servers = listServers({});
        const pipelineGroups = listAzurePipelineGroups();
    
        const [mcpResults, pipelineResults] = await Promise.all([
          Promise.allSettled(
            servers.map(async (listedServer) => {
              const serverConfig = getServer(listedServer.name);
              if (!serverConfig) {
                return {
                  name: listedServer.name,
                  type: 'mcp_server',
                  ...buildErrorResult(new Error(`Server not found: ${listedServer.name}`))
                };
              }
    
              const result = await checkServer(serverConfig, input.timeout_ms);
              recordHealthCheck(listedServer.name, result);
              return {
                name: listedServer.name,
                type: 'mcp_server',
                ...result
              };
            })
          ),
          Promise.allSettled(
            pipelineGroups.map(async (groupName) => {
              const groupRows = listAzurePipelines(groupName);
              const pipelines = await Promise.all(
                groupRows.map(async (row) => {
                  if (!row.pipeline_id) {
                    return {
                      pipeline: row.pipeline_name,
                      status: 'unknown'
                    };
                  }
    
                  const run = await getLatestRun(
                    row.organization,
                    row.project,
                    row.pipeline_id,
                    decodePatToken(row.pat_token_encrypted)
                  );
    
                  if (!run) {
                    return {
                      pipeline: row.pipeline_name,
                      status: 'unknown'
                    };
                  }
    
                  recordPipelineRun(row.group_name, row.pipeline_name, run);
                  return {
                    pipeline: row.pipeline_name,
                    ...run
                  };
                })
              );
    
              return {
                group: groupName,
                type: 'azure_pipeline',
                pipelines
              };
            })
          )
        ]);
    
        const mcp = mcpResults.map((result) =>
          result.status === 'fulfilled' ? result.value : { error: String(result.reason) }
        );
        const pipelines = pipelineResults.map((result) =>
          result.status === 'fulfilled' ? result.value : { error: String(result.reason) }
        );
        const mcpDown = mcp.filter(
          (result) =>
            typeof result === 'object' &&
            result !== null &&
            'status' in result &&
            result.status !== 'up'
        ).length;
        const pipelineFailed = pipelines
          .flatMap((group) =>
            typeof group === 'object' && group !== null && 'pipelines' in group
              ? ((group.pipelines as Array<Record<string, unknown>>) ?? [])
              : []
          )
          .filter((pipeline) => pipeline.status === 'failed').length;
    
        return formatResponse({
          summary: `MCP: ${mcp.length - mcpDown}/${mcp.length} up | Pipelines: ${pipelineFailed} failed`,
          mcp_servers: mcp,
          azure_pipelines: pipelines
        });
      }
    );
  • Helper function formatResponse that wraps the result payload into a ToolResponse with JSON text content.
    function formatResponse(payload: unknown): ToolResponse {
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(payload, null, 2)
          }
        ]
      };
    }
  • Helper function buildErrorResult used in the handler to create error result objects for failed server checks.
    function buildErrorResult(error: unknown): CheckResult {
      return {
        status: 'error',
        response_time_ms: null,
        tool_count: null,
        error_message: error instanceof Error ? error.message : 'Unknown error',
        tools: null
      };
    }
Behavior3/5

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

Annotations already indicate read-only and non-destructive behavior. The description adds the scope (across all projects) but omits potential issues like partial failures or rate limits.

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 sentence with 14 words, front-loaded with key action, no extraneous information.

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

Completeness3/5

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

Adequate for a simple health check tool, but missing details about output format and the timeout parameter's role. No output schema exists to compensate.

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?

The schema has one parameter (timeout_ms) with 0% description coverage, and the description does not mention it, failing to provide guidance on usage or impact.

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?

The description clearly states it checks both MCP server health and Azure DevOps pipeline status across all projects, distinguishing it from sibling tools like check_pipeline_status (single pipeline) and check_server (single server).

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

Usage Guidelines3/5

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

The description implies use for a comprehensive health overview but does not explicitly clarify when to prefer this tool over siblings like check_all or get_monitor_stats. No exclusion criteria are provided.

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