Skip to main content
Glama

get_ai_usage

Retrieve AI gateway usage grouped by UTC day, app, and alias to track requests, prompt and completion tokens, and upstream errors.

Instructions

AI gateway usage per (UTC day, app, alias): requests, prompt and completion tokens, upstream errors. No cost estimate, no prompt trace.

Input Schema

NameRequiredDescriptionDefault
daysNoUTC days back, today included (1-90).
serviceNoOnly this app's usage; omit for every app.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses the aggregation dimensions, included metrics, and two important exclusions, but it does not mention permissions, pagination, ordering, rate limits, or the exact return format.

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?

The description is two compact sentences with no waste. The core resource and metrics are front-loaded, and the limitations are stated briefly afterward.

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 two-parameter, read-only usage reporting tool with a fully described input schema, the definition is largely complete. It explains the included metrics and exclusions, though without an output schema it could say slightly more about the returned grouping structure.

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?

The input schema has 100% description coverage, with both parameters documented directly. The description reinforces that usage is reported per UTC day and app, but it does not add parameter details beyond the schema's existing descriptions.

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 clearly states the resource and metrics returned: AI gateway usage grouped by UTC day, app, and alias, including requests, tokens, and upstream errors. It is specific enough for an agent to understand what the tool provides, though it does not explicitly distinguish itself from sibling stats tools such as cluster_stats or service_stats.

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 description: this tool is for AI gateway usage reporting. The note 'No cost estimate, no prompt trace' usefully excludes expected content, but there is no explicit guidance about when to choose this tool over sibling statistics or audit tools.

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