Skip to main content
Glama

usage_attribution

Report token usage with its accounted share, denominators, and metric labels to reveal incomplete sub-agent coverage and avoid misleading totals.

Instructions

Report token usage together with how much of it can actually be accounted for.

Read-only. Every token number comes back alongside its denominator (dispatches_total) and its metric label, because a token count without those two is meaningless: this repo carries two orthogonal metrics that measure 5-25x apart, and sub-agent usage coverage is incomplete (the response reports the measured share). There is deliberately no total field: cache_read dominates the four layers, so a lone total is mostly a cache-read count in disguise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoLook-back window in days, counted on row creation time. 0 means all history. Never windowed on measurement time — that would drop unmeasured rows out of the denominator and pin coverage at 100%.
scopeNoAttribution level — project / session / workflow_run / agent / task. Leave empty to get the coverage matrix (all dispatch paths plus per-hop link coverage) instead of one scope's usage.
scope_idNoID at that level. Empty means "do not filter on this dimension", i.e. aggregate across the whole ledger.
populationNoDispatch path — "subagent" or "leader_session". These are never merged: one leader session can outweigh every sub-agent combined, which would drown the sub-agent numbers.subagent

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.2

TDQS

A3.7/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 load and does real work: it declares read-only, explains the deliberate absence of a total field (cache_read dominates), warns that sub-agent coverage is incomplete, and notes two orthogonal metrics that diverge 5-25x. Permissions or failure behavior are not covered, but behavioral disclosure is well above baseline.

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

Conciseness4/5

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

The key constraint (read-only, every count paired with a denominator) is front-loaded, and the remaining sentences explain non-obvious design choices rather than padding. It is somewhat dense and the 'no total field' rationale is verbose, but each sentence carries information.

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 tool with an output schema, the description need not describe return values, yet it helpfully frames the response shape (denominator plus metric label, measured share of sub-agent coverage). Given the complexity of dual metrics and partial coverage, this is mostly complete; only guidance on choosing it over sibling analytics tools is missing.

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 schema already documents all four parameters thoroughly, including the days/measurement-time subtlety and scope levels. The description adds cross-cutting rationale (why denominators and metric labels accompany every number) but does not extend the per-parameter meanings 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 opening sentence states a specific verb+resource: reporting token usage together with accounted-for coverage. It is clearly distinct from siblings like prompt_effectiveness or agent_activity_query, but it never names an alternative or explicitly frames what makes it the right pick over them.

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?

The description implies usage through the scope semantics (empty scope returns the coverage matrix, populated scope returns one level's usage), which effectively tells an agent which mode it will get. There is no explicit when-to-use/when-not or comparison to sibling reporting tools, so guidance is implied rather than stated.

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

Deploy Server

Other Tools