Skip to main content
Glama

Ctx Stats

ctx_stats
Read-onlyIdempotent

Reports measured token usage and savings for a session, helping you track how much context compression reduces token costs.

Instructions

Report measured token usage and savings for a session.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ctx_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idNodefault

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is fully covered elsewhere. The description adds the useful nuance that figures are "measured" rather than estimated and that "savings" are reported, but it omits behavior for an unknown or expired session_id.

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?

One short, front-loaded sentence with no padding. It is efficient, though the terseness leaves the session-scoping behavior implicit rather than stated.

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

Completeness3/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 values need not be explained, and annotations cover the safety profile. Still, a stats tool whose meaning hinges on "measured" and "savings" should say a word about what those cover and how the default session is treated.

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 0%, so the single session_id parameter is undocumented except for its default. The phrase "for a session" implies what the parameter scopes, but not what a session identifier is or what happens when it is omitted or invalid.

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 gives a specific verb ("report") and specific subject matter ("measured token usage and savings") scoped to a session, which is meaningfully distinct from siblings like ctx_vector_stats or ctx_health. It does not explicitly name those siblings to differentiate, so it stops 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance and no reference to alternatives such as ctx_vector_stats (index-level stats) or ctx_profile. An agent must infer from the name alone which stats tool to pick.

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