Skip to main content
Glama

health_check

Verify the operational status of the Android MCP Server and ADB connectivity by checking server uptime, device connections, and configuration details.

Instructions

Check the health status of the MCP server and ADB connectivity. Returns server uptime, ADB availability, connected device count, and configuration summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that performs the health check logic, gathering ADB status, device info, and system metrics.
      async () => {
        return wrapHandler(async () => {
          const config = getConfig();
          const startTime = Date.now();
    
          // Check ADB is available
          let adbAvailable = false;
          let adbVersion = 'unknown';
          try {
            const versionResult = await adbExec(['version']);
            adbAvailable = versionResult.exitCode === 0;
            const versionMatch = versionResult.stdout.match(/Android Debug Bridge version ([\d.]+)/);
            if (versionMatch) adbVersion = versionMatch[1];
          } catch {
            adbAvailable = false;
          }
    
          // Count connected devices
          let deviceCount = 0;
          let devices: Array<{ id: string; status: string }> = [];
          try {
            const deviceList = await deviceManager.listDevices();
            devices = deviceList.map(d => ({ id: d.id, status: d.status }));
            deviceCount = deviceList.filter(d => d.status === 'device').length;
          } catch {
            // ADB may not be available
          }
    
          const toolMetrics = metrics.getToolMetrics();
          const totalCalls = Object.values(toolMetrics).reduce((sum, m) => sum + m.totalCalls, 0);
          const totalFailures = Object.values(toolMetrics).reduce((sum, m) => sum + m.failureCount, 0);
    
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({
                success: true,
                health: {
                  status: adbAvailable && deviceCount > 0 ? 'healthy' : adbAvailable ? 'degraded' : 'unhealthy',
                  adb: {
                    available: adbAvailable,
                    version: adbVersion,
                    path: config.adbPath,
                  },
                  devices: {
                    connected: deviceCount,
                    list: devices,
                  },
                  server: {
                    version: '1.0.0',
                    checkDurationMs: Date.now() - startTime,
                  },
                  config: {
                    maxActionsPerMinute: config.maxActionsPerMinute,
                    commandTimeoutMs: config.commandTimeoutMs,
                    maxRetries: config.maxRetries,
                    allowDestructiveOps: config.allowDestructiveOps,
                    allowedDeviceCount: config.allowedDevices.length,
                  },
                  metrics: {
                    totalToolCalls: totalCalls,
                    totalFailures: totalFailures,
                    successRate: totalCalls > 0 ? `${Math.round(((totalCalls - totalFailures) / totalCalls) * 100)}%` : 'N/A',
                  },
                },
              }, null, 2),
            }],
          };
        });
      }
    );
  • The MCP server tool registration for 'health_check'.
    server.registerTool(
      'health_check',
      {
        description: 'Check the health status of the MCP server and ADB connectivity. Returns server uptime, ADB availability, connected device count, and configuration summary.',
        inputSchema: {},
      },
Behavior4/5

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

No annotations provided, so description carries full burden. Compensates well by disclosing return values (uptime, ADB availability, device count, configuration summary) since no output schema exists. Could improve by mentioning idempotency/safety for repeated health checks.

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?

Two well-structured sentences: first defines action and scope, second documents return payload. No redundancy or filler. Every sentence delivers distinct value (purpose vs. return values).

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

Completeness5/5

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

For a zero-parameter health check tool without output schema, the description is complete. It explains both the check performed (server + ADB) and the data returned, covering everything an agent needs to invoke and interpret results.

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

Parameters4/5

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

Zero parameters with empty schema (100% coverage). Baseline 4 applies as there are no parameters requiring semantic clarification beyond the schema.

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?

Excellent specificity: verb 'Check' + resources 'health status of the MCP server and ADB connectivity' clearly defines scope. The mention of 'MCP server' distinguishes it from sibling device-manipulation tools (click_element, swipe, etc.) that operate on devices rather than server health.

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?

No explicit when-to-use guidance (e.g., 'call before operations to verify connectivity' or troubleshooting scenarios). While the diagnostic purpose is clear from naming, it lacks explicit differentiation from similar state-checking siblings like get_device_info or get_device_state.

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/divineDev-dotcom/android_mcp'

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