Skip to main content
Glama

co.build

Report a finished review's token usage

report_review_usage
Idempotent

After the main session submits one whole-mod review, report exact usage summed across its reviewing subagents: taskId, inputTokens (uncached), outputTokens, cacheReadTokens and cacheWriteTokens. All four counts are required together. totalTokens alone remains a fallback with unknown split. Claude Code: read transcripts by agentId, counting each assistant message.id once, never its displayed context-size total. Codex: use exact session log token-count events if available, otherwise skip. Only your own submitted reviews, within a day. Identical reports are a no-op; different counts or splits are refused. Never guess or send transcripts. AI tokens given to defense means total processed, the sum of all four.

Input Schema

NameRequiredDescriptionDefault
taskIdYesThe whole-mod task submitted by this account.
inputTokensNoUncached input tokens.
totalTokensNoFallback only: processed total with unknown split.
outputTokensNo
cacheReadTokensNo
cacheWriteTokensNo

Output Schema

NameRequiredDescriptionDefault
taskIdYes
recordedYes
alreadyReportedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true), it discloses write semantics the agent could not infer: identical reports are a no-op, differing counts or splits are refused, and guessing or sending transcripts is prohibited. The idempotency and refusal behavior is consistent with, and richer than, the annotation set.

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?

Purpose is front-loaded, but the middle is telegraphic run-on shorthand ('Claude Code: read transcripts by agentId, counting each assistant message.id once, never its displayed context-size total') that is hard to parse on first read. The closing sentence re-defines total usage already covered by the fallback clause, so there is mild redundancy.

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?

A write tool with an output schema, and the description covers the mutation semantics, idempotency, scope limits, and counting methodology needed to call it correctly. Minor gaps remain, such as what error surfaced a refused report returns and how the 'within a day' window is measured, but these are small against the supplied schema and annotations.

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 only 50%, and the description compensates by defining all five reported fields, stating that the four counts are required together despite taskId being the only required schema field, and explaining totalTokens as a split-unknown fallback. Host-specific counting rules (count each assistant message.id once, not the displayed context-size total) add real meaning the schema lacks.

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?

Names a specific verb and resource (report exact token usage) and pins the scope: summed across reviewing subagents for one whole-mod task already submitted. The sequencing ('After the main session submits one whole-mod review') separates it from submit_review and from the reporting siblings like prepare_installation_report.

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?

States the trigger (after submitting a whole-mod review), the eligibility constraint ('Only your own submitted reviews, within a day'), and the fallback path ('totalTokens alone remains a fallback'). It also gives an explicit skip condition for Codex when exact log events are unavailable, which is a rare and useful when-not-to-use clause.

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