Skip to main content
Glama

get_agent_metrics

Read-onlyIdempotent

Monitor an AI agent's production performance and costs with aggregated LLM metrics, including call volume, errors, token usage, and latency, plus tool usage samples and session data.

Instructions

Retorna métricas agregadas de um agente: chamadas LLM (calls, errors, success_rate, tokens, custo, latência p50/p95 — agregação em SQL, sem cap de linhas), uso de tools (amostra das últimas 2000 chamadas, com flag sample_truncated) e sessões. Útil para monitorar performance e custos de um agente em produção. Para saúde de infra do tenant (erros sem agente), use get_tenant_health.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoPeríodo de análise: 1d (último dia), 7d (última semana), 30d (último mês)7d
agent_idYesUUID do agente
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral details beyond those: SQL aggregation without row cap, tool-call metrics computed from a sample of the last 2000 calls with a sample_truncated flag, and specific latency percentiles. This goes beyond what annotations alone provide.

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 deliver dense, useful information with no filler. The first sentence front-loads what the tool returns, and the second provides use case and routing to an alternative. Every part earns its place.

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?

With no output schema, the description carries the responsibility of explaining the return content, and it names the key metrics (calls, errors, success_rate, tokens, custo, latency p50/p95, sample_truncated, sessions). Minor details about the exact shape of the sessions portion are omitted, but the tool is callable and its results are sufficiently scoped.

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 both parameters already have clear descriptions: agent_id is a UUID and period has an enum with date ranges and defaults. The description does not add new parameter-level semantics, so a baseline of 3 is appropriate.

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 uses a specific verb ('Retorna') and resource ('métricas agregadas de um agente'), then lists the concrete metric families: LLM calls, tool usage, and sessions. It also explicitly distinguishes itself from get_tenant_health, so an agent can tell this tool apart from a closely related sibling.

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

Usage Guidelines5/5

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

It states the intended use case: 'monitorar performance e custos de um agente em produção.' It also gives an explicit exclusion with an alternative: for tenant infra health, use get_tenant_health. This gives clear when-to-use versus when-not-to-use guidance.

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

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/zihin-ai/zihin-mcp'

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