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),
          }],
        };
      }
    );
Behavior3/5

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

With no annotations provided, description carries full burden. It discloses return content (per-tool latency, success/failure counts, action history) but omits safety profile (read-only vs destructive), rate limits, or authentication requirements that annotations would typically cover.

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 sentences with zero waste. First establishes scope (MCP server), second specifies metric types (latency, counts). Front-loaded and efficient.

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?

For a zero-parameter tool without output schema, description adequately compensates by enumerating specific metric categories returned. Minor gap on return format structure, but sufficient for agent selection given the tool's observational nature.

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?

Input schema contains zero parameters. Per scoring rules, zero parameters warrants baseline score of 4. Description appropriately does not fabricate parameter details where none exist.

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 uses specific verb 'Get' with clear resource 'performance metrics and action history for the MCP server'. Explicitly distinguishes from mobile automation siblings by specifying it targets the MCP server itself, not the device under test.

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 provided on when to invoke this tool (e.g., after test runs, during debugging) or when not to use it. No alternatives mentioned, though none exist in the sibling set, explicit context for invocation timing is absent.

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