Skip to main content
Glama
orchestra-hq

Orchestra MCP Server

Official
by orchestra-hq

Get agent token usage

get_agent_usage
Read-only

Retrieve the input and output tokens spent by agent sessions in the account, summed across every agent and LLM connection, as totals for the period and in consecutive time buckets. A session counts towards the bucket it was created in.

Instructions

Retrieve the input and output tokens spent by agent sessions in the account, summed across every agent and LLM connection, as totals for the period and in consecutive time buckets. A session counts towards the bucket it was created in.

Requires permission to view account settings.

Input Schema

NameRequiredDescriptionDefault
time_toNoEnd of the period as an ISO 8601 datetime with a UTC offset, for example `2026-10-01T00:00:00Z`.
time_fromNoStart of the period as an ISO 8601 datetime with a UTC offset, for example `2026-09-01T00:00:00Z`.
bucket_sizeNoLength of each time bucket in minutes. Defaults to 1440 (one day); minimum 15, maximum 527040 (366 days).
X-Orchestra-Account-IdNoAct on this account rather than the one the credential resolves to. Omit it to use the credential's own account. An API key is issued to a single account, so it may only name that account; an OAuth token may name any account its grant covers.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2026.10.12-0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so safety is covered; the description adds genuinely non-obvious behavior — that a session counts toward the bucket it was created in (aggregation rule), the permission prerequisite, and the request period limits. It omits pagination, rate limits, or whether results are cached/eventually consistent, so it is useful but not exhaustive.

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?

Front-loads the core purpose in one strong sentence, then a scoped Note block for time-window behavior. It is a bit long and the Note partially restates the schema's own time_from/time_to and bucket_size descriptions, which dilutes efficiency slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return shape need not be spelled out, and the description still covers aggregation semantics, account scope, permissions, and period limits. An agent has everything needed to call it correctly with no defaults left ambiguous.

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 100%, so the baseline is 3, and every parameter is already documented in the schema. The description adds real meaning beyond it by explaining the paired semantics of time_from/time_to (when only one is given the window is 30 days after/before it) and the consecutive-bucket nature of the output, which the schema does not convey.

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?

States a precise verb and resource: retrieve input/output tokens spent by agent sessions in the account, summed across every agent and LLM connection, as totals plus time buckets. This is clearly distinguishable from siblings like list_agent_sessions or get_agent, which cover session inventory rather than usage aggregates.

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?

Gives clear context for invocation: times are optional, omit both for the last 30 days, one-only yields a 30-day window, max 366 days, and it requires permission to view account settings. It does not, however, name an alternative tool or state when not to use this one, so it stops short of full when/when-not routing.

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