Skip to main content
Glama

report_agent_usage

Record what one agent run cost an issue (local or mirrored/upstream): tokens by kind and machine time. Re-sending the same 'source' + 'externalId' updates that record instead of adding a second one, so a retry never doubles the spend. Omit a metric you did not measure — omitted is 'not reported', which is different from zero. Requires permission to edit the issue.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesIssue key, e.g. 'UK-1'.
hostNoWhich host it ran on.
noteNoShort note, e.g. the outcome.
agentNoWhich agent did the work, e.g. 'claude-code'.
modelNoWhich model it ran on, e.g. 'claude-opus-5'.
runIdNoThe run this record belongs to, when one run reports several records (different models or hosts).
sourceYesWho is reporting, e.g. 'bg-agent-api'. Idempotency is scoped to it.
costUsdNoCost in USD, if you know the rates that applied.
endedAtNoWhen the run ended (ISO 8601).
startedAtNoWhen the run started (ISO 8601).
externalIdYesYour own key for this record (usually the run id). Re-sending it updates the record.
inputTokensNoInput (prompt) tokens.
agentSecondsNoWall-clock seconds the run took. Machine time, not a worklog.
outputTokensNoOutput (completion) tokens.
cacheReadTokensNoCache-read tokens.
cacheWriteTokensNoCache-write tokens.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does well: it discloses that re-sending the same source+externalId updates rather than duplicates, that omitted metrics mean 'not reported' rather than zero, and that edit permission on the issue is required. This meaningfully exposes the tool's mutation and idempotency behavior beyond the schema.

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?

Four short sentences, each earning its place: purpose, idempotency, omission semantics, and permission. The most important information is front-loaded, and there is no filler or repetition of the schema.

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 16-parameter write tool with no annotations and no output schema, the description covers the critical call-time semantics: what is recorded, the upsert behavior, the omitted-vs-zero distinction, and required permission. It does not explain the 'local or mirrored/upstream' qualifier or describe what the tool returns, but the core behavior an agent needs to call it correctly is present.

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?

Although schema coverage is 100%, the description adds real semantic weight: it identifies source+externalId as the idempotency key, maps 'tokens by kind' to the token parameters, and clarifies that null/omitted metrics are not to be interpreted as zero. The description does not need to re-explain every field, but it highlights the non-obvious meanings.

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 starts with a specific verb and resource: 'Record what one agent run cost an issue' and names the exact data categories collected (tokens by kind, machine time). This clearly distinguishes it from sibling tools like get_agent_usage and delete_agent_usage, which read or remove this data rather than report it.

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?

It gives practical guidance for retries and omission semantics, and states the edit-permission requirement. However, it never explicitly contrasts this tool with its read/delete siblings or states when an agent should choose get_agent_usage or delete_agent_usage instead. The intended usage is implied rather than explicitly framed against alternatives.

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