Skip to main content
Glama

get_metrics

Retrieve performance metrics and action history for Android device automation, including per-tool latency and success/failure counts.

Instructions

Get performance metrics and action history for the MCP server. Shows per-tool latency, success/failure counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'get_metrics' tool handler is defined within the registerAutomationTools function. It aggregates metrics from the metrics utility, screenshot cache, and UI cache.
      'get_metrics',
      {
        description: 'Get performance metrics and action history for the MCP server. Shows per-tool latency, success/failure counts.',
        inputSchema: {},
      },
      async () => {
        const toolMetrics = metrics.getToolMetrics();
        const recentHistory = metrics.getHistory(20);
        const screenshotCacheStats = getScreenshotCacheStats();
        const uiCacheStats = uiTreeCache.stats();
        const isLooping: Record<string, boolean> = {};
    
        // Check loop status for known devices
        for (const key of Object.keys(toolMetrics)) {
          // Not per-device, skip
        }
    
        return {
          content: [{
            type: 'text' as const,
            text: JSON.stringify({
              success: true,
              toolMetrics,
              caches: {
                screenshotCache: screenshotCacheStats,
                uiTreeCache: uiCacheStats,
              },
              recentActions: recentHistory.map(h => ({
                tool: h.tool,
                device: h.deviceId,
                durationMs: h.durationMs,
                success: h.success,
                ago: `${Math.round((Date.now() - h.timestamp) / 1000)}s`,
              })),
            }, null, 2),
          }],
        };
      }
    );

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