Skip to main content
Glama

session

Read-onlyIdempotent

View a Claude Code or Codex session turn by turn to see model, effort, token counts, and cost per response. Accepts a full session id or unique prefix.

Instructions

One session turn by turn: model, effort, token counts and cost per model response. Accepts a full session id or a unique prefix. Never returns prompt text, tool output, or command lines; the database does not hold them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesfull session id or a unique prefix
currencyNooverride the detected plan: "usd" or "share"

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
usdYes
planYes"api" or "subscription", re-detected on every scan
turnsYes
sourceYes
projectYes
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
ended_atYes
subagentsYesthe sub-agent runs this session launched; empty for a session that launched none
agent_typeNo
scan_errorNowhy the most recent scan attempt failed, in which case the figures are from the last successful scan
started_atYes
tool_callsYes
turn_countYeslength of turns, so a caller can size the session without walking it
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
tool_errorsYestool results the harness marked as errors
parent_session_idNoset when this is itself a sub-agent run

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, closed-world), so the bar is lower. The description still adds genuine value by declaring the negative space — it never returns prompt text, tool output, or command lines, and states why (the database does not hold them) — which stops an agent from chasing unavailable data.

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?

Three short sentences, front-loaded with what is returned, followed by the accepted identifier form and the disclosure of what is withheld. Every clause carries information; nothing is padded.

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 an output schema present the description needn't explain return values, and it correctly focuses on scope and on the data it cannot supply. The one remaining gap is disambiguation from the `sessions` sibling, which matters given how similar the names are.

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 defines both parameters. The description's "full session id or a unique prefix" restates the `id` schema text verbatim and says nothing about the `currency` override or the ambiguity behavior of prefixes, so it adds essentially nothing beyond structured data.

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 (one session) and enumerates exactly what it returns — model, effort, token counts and cost per model response. That is concrete and distinguishes it from a generic listing tool, but it never distinguishes itself from the near-identically named sibling `sessions`, leaving the singular/plural split unexplained.

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?

Usage is only implied: the framing "one session" plus the id/prefix note suggests the caller already has a single session identifier. There is no explicit statement of when to use this versus `sessions`, `report`, or `agents`, and no mention of what happens when a prefix is ambiguous.

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