Skip to main content
Glama

sessions

Read-onlyIdempotent

List each Claude Code or Codex run's cost, sorted by expense or time, to track spending. Includes sub-agent runs as separate rows.

Instructions

Sessions in the window with what each cost, sorted by cost or by time, most expensive or most recent first. Includes sub-agent runs as their own rows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNo"cost" for most expensive first or "time" for most recent first; default time
limitNomaximum rows to return; default 20; 0 returns every row
sinceNowindow: 7d, 30d, 90d, all, or a YYYY-MM-DD start date; default 30d
sourceNorestrict to one tool: "claude-code" or "codex"; default both
projectNorestrict to one project directory, exact match, or a prefix if it ends with a path separator
currencyNooverride the detected plan: "usd" reports as charged, "share" reports as a subscription's list-price equivalent

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
planYes"api" or "subscription", re-detected on every scan
totalYesrows in the window before the limit
currencyYes"usd" when the figures were charged, "list_price_equivalent" when a subscription covered them and the figures are what the usage would have cost on the API
sessionsYes
scan_errorNowhy the most recent scan attempt failed, in which case the figures are from the last successful scan
age_secondsYesseconds since that scan; the server rescans when a tool is called more than 60 seconds after the last attempt, or on refresh
ingested_atYesRFC 3339 time of the last successful transcript scan; empty if none has succeeded yet
plan_reasonYeswhy that plan was chosen

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral fact not in the annotations: sub-agent runs appear as their own rows. Beyond that it discloses nothing about cost computation, auth, or limits.

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?

A single front-loaded sentence that states the resource, the row content, the sort options, and the sub-agent inclusion with no filler. Every clause 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?

With a full schema and an output schema, return values need not be explained; the description covers scope, ordering, and non-obvious row composition. The main missing context is how it relates to the 'session' and 'agents' siblings, which an agent must infer.

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 all six parameters (sort, limit, since, source, project, currency) are fully documented in the schema. The description's mentions of sorting and window mirror existing schema text without adding syntax or format meaning, so the baseline of 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 names the resource (sessions) and what each row contains (what each cost) plus the ordering options, so the agent knows this is a cost-oriented session listing. It does not distinguish itself from the sibling 'session' (singular) or 'agents' tools, so it falls short of a 5.

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 scope ('in the window') and default ordering imply this is a listing tool for session costs over a time window, but there is no explicit when-to-use, no when-not-to-use, and no alternative named despite the presence of a closely related 'session' sibling.

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