Skip to main content
Glama

Get gateway stats

gateway_stats
Read-onlyIdempotent

Get gateway stats

What the gateway did over the last 24 hours (per hour) or 7 days (per day), from the request log: requests (a refused one counts its repeats), p95 latency, the error rate, the cache hit rate and how many requests were blocked; then each routing rule's count over the range and per bucket: fell back, retried (and how many retries), answered from cache (savedUsd: what the hits would have cost at the model's average price), rate limited, refused as not allowed, timed out, and the split per model. The same numbers as the console's gateway page.

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": {
      "name": "<name>"
    },
    "name": "gateway_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesThe gateway's name.
rangeNoThe last 24 hours (per hour) or the last 7 days (per day).24h

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds real behavioral detail beyond that: bucketing granularity changes with range, a refused request counts its repeats, and savedUsd is the hypothetical cost of cache hits at the model's average price — all non-obvious semantics an agent would otherwise have to guess.

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

Conciseness3/5

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

The opening line merely repeats the title, and the remainder is a single long run-on sentence packing many parentheticals and list items. Most items are informative given the absence of an output schema, but the density and lack of structure cost readability.

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 return-value burden and does so thoroughly, covering both the aggregate metrics and the per-rule per-bucket breakdowns. Combined with full schema coverage and read-only annotations, an agent has enough to call this correctly; only the absence of explicit sibling routing keeps it from a 5.

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%, so the baseline is 3. The description's only parameter-related content — 24 hours per hour or 7 days per day — restates the schema's own wording for the range enum rather than adding new meaning, and the name pattern is left entirely to the schema.

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 definition states a specific verb and resource (get gateway stats) and enumerates the exact metrics returned — requests, p95 latency, error rate, cache hit rate, blocked counts, plus per-rule breakdowns. It is clear this is a time-series metrics read rather than gateway metadata, though it never explicitly contrasts itself with get_gateway or gateway_decisions.

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 range enumeration (24h per hour vs 7d per day) and by the closing note that these match the console's gateway page, but there is no explicit when-to-use or when-not-to-use guidance and no named alternative for a different view of gateway activity.

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