Skip to main content
Glama

Report agent usage

report_agent_usage
Destructive

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

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/5.0
Behavior4/5

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

The description adds real context beyond the annotations: it explains the idempotent upsert key (so a retry never doubles the spend), that omitted means 'not reported' not zero, and that editing the issue requires permission. The destructiveHint=true is consistent with an overwriting update, though the description never explicitly says an update replaces prior field values, which would fully explain the destructive flag.

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 sentences, front-loaded with what the tool records, then the idempotency rule, then the omission semantics, then the permission requirement. No sentence is redundant and nothing is buried.

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 16 parameters, no output schema, and already-present annotations, the description covers the things an agent most needs: the write/idempotency model, the omit-vs-zero distinction, and the permission requirement. It leaves open what happens on an invalid issue key or negative values, which is a minor gap rather than a blocking one.

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 coverage is 100%, so every parameter is already documented, including source/externalId idempotency and the agentSeconds 'machine time, not a worklog' note. The description groups the metrics conceptually ('tokens by kind and machine time') but adds no format or constraint detail beyond the schema, so the baseline 3 applies.

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 opens with a specific verb+resource: record what one agent run cost an issue, with tokens by kind and machine time. The parenthetical '(local or mirrored/upstream)' adds scope. It does not name the sibling tools (get_agent_usage, delete_agent_usage) that an agent might confuse it with, so it falls short of full differentiation.

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

Usage Guidelines4/5

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

It states the clear calling context (recording the cost of one agent run) and gives two explicit operational rules: re-sending the same source+externalId updates rather than duplicates, and omit metrics you did not measure rather than sending zero. It gives no explicit 'do not use this for X' exclusion or named alternative, which keeps it below a 5.

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