Skip to main content
Glama

get_agent_metrics

Read-onlyIdempotent

Retrieve execution metrics for an AI agent over 1d, 7d, or 30d to analyze LLM calls, errors, success rate, tokens, cost, latency, tool usage, and sessions.

Instructions

Execution metrics by period (1d, 7d, 30d): LLM calls, errors, success rate, tokens, cost, p50/p95 latency (aggregated server-side — no row cap), tool usage (sampled, with sample_truncated disclosure) and sessions

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "get_agent_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNoAnalysis period: 1d (last day), 7d (last week), 30d (last month)7d
agent_idYesAgent UUID

Output Schema

NameRequiredDescriptionDefault
llmNo
sinceNo
toolsNo
periodNo
successNo
sessionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.4
    • changedInput schema / properties / agent_id / description
      Previous value: -"UUID do agente"New value: +"Agent UUID"
    • changedInput schema / properties / period / description
      Previous value: -"Período de análise: 1d (último dia), 7d (última semana), 30d (último mês)"New value: +"Analysis period: 1d (last day), 7d (last week), 30d (last month)"
  2. Changed1 schema field changedv2.2.3
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "success"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "error": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "code": {
      +              "type": "string"
      +            },
      +            "message": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "message"
      +          ],
      +          "type": "object"
      +        },
      +        "success": {
      +          "const": false
      +        }
      +      },
      +      "required": [
      +        "success",
      +        "error"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "properties": {
      +    "llm": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "period": {
      +      "type": "string"
      +    },
      +    "sessions": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "since": {
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "tools": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description still adds real behavioral context the annotations cannot: aggregation happens server-side with no row cap, and tool usage is sampled with a sample_truncated disclosure flag. That sampling caveat is exactly the kind of behavioral trait an agent needs before trusting counts.

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

Conciseness4/5

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

It is a single, front-loaded sentence that leads with the purpose and the period values, then lists outputs. Dense but readable; the parenthetical about server-side aggregation and sampling is worth its space. Slightly crammed, but no filler sentences.

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?

An output schema exists, so return-value documentation is unnecessary. With only two parameters, full schema coverage, and explicit disclosure of aggregation and sampling limits, an agent has what it needs to call this correctly. The only gap is routing guidance against sibling diagnostic/trace tools.

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

Parameters3/5

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

Schema description coverage is 100% and the period enum is already documented in the schema, so the description's restatement of `1d`/`7d`/`30d` adds nothing new. No additional meaning is given for agent_id. Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the resource (execution metrics) and enumerates the exact outputs: LLM calls, errors, success rate, tokens, cost, p50/p95 latency, tool usage and sessions. That is far more specific than a generic 'get metrics' label. It does not explicitly contrast itself with sibling read tools such as get_execution_diagnostics or get_execution_trace, so it stops short of a 5.

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?

Usage is implied by the period enum and the required agent_id: fetch per-agent aggregates for a time window. There is no explicit statement of when to prefer this over get_execution_trace or get_execution_diagnostics, and no exclusions or preconditions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools