Skip to main content
Glama

Read Gate operational metrics

gate_metrics
Read-onlyIdempotent

Returns project-wide 24-hour call aggregates, anomaly scores, idle apps and current-month usage; use it for operational trends rather than individual calls in gate_audit or one run in gate_run_timeline. Includes stored call counts by HTTP status and reason, measured duration through response headers (including upstream wait), per-app anomaly scores and 24-hour anomaly counts, idle apps (active apps whose key made no allowed call in the project's idle_days, default 14; a flag only, never a revoke), and separate current-month gateway usage: plan, used, allowed, plus upgrade URL and checkout path on Free at 80% or above. Only POST the checkout path when the admin asks to upgrade; reading metrics never starts checkout. Requires the project owner key or an active member key. Audit may be partial: invalid-key sampling and audit-off periods are disclosed. No upstream requests, quota use or policy changes; not a health certificate or performance guarantee. For individual calls use gate_audit.

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": {
      "project_id": "<project_id>",
      "admin_key": "<admin_key>"
    },
    "name": "gate_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
admin_keyYesThe project admin key (ga_...). Read it from the .env; never print it.
project_idYesThe project id from gate_create_project, e.g. p1a2b3...

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real context beyond them: required credential class (owner key or active member key), the caveat that audit data may be partial (invalid-key sampling, audit-off windows), and explicit non-effects ('No upstream requests, quota use or policy changes; not a health certificate'). It also preempts a dangerous misread by noting idle-app flags are 'a flag only, never a revoke' and that reading metrics never starts checkout.

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?

Purpose is front-loaded in the first clause and the sibling routing follows immediately, with no filler. The second sentence is a single ~90-word semicolon chain enumerating five return categories, which is dense but every clause carries non-redundant information.

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?

With no output schema, the description carries the full burden of describing return contents, and it enumerates the payload areas (status/reason counts, header-measured duration including upstream wait, anomaly scores and counts, idle apps with idle_days default 14, current-month plan/used/allowed plus upgrade URL and checkout path). Auth requirements, audit gaps, and the absence of side effects are all covered, leaving nothing an agent needs to call it correctly.

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?

Schema coverage is 100% and both params are simple identifiers, so the schema does most of the work. The description still adds meaning by clarifying the accepted credential class ('project owner key or an active member key'), which is slightly broader than the schema's 'project admin key' wording and helps an agent understand which key to supply.

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?

States a specific verb+resource+scope: 'Returns project-wide 24-hour call aggregates, anomaly scores, idle apps and current-month usage'. It immediately distinguishes itself from gate_audit (individual calls) and gate_run_timeline (one run), so an agent can route without opening the schema.

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?

Explicit when-to-use ('for operational trends'), explicit when-not ('rather than individual calls in gate_audit or one run in gate_run_timeline'), and closes with a routing rule ('For individual calls use gate_audit'). It also constrains the one hazardous-adjacent action: only POST the checkout path when the admin asks to upgrade.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources