Skip to main content
Glama
beeltec

context-usage-mcp

by beeltec

Get context usage

get_context_usage

Check your current session's raw token usage from the host transcript (Claude Code or OpenAI Codex CLI) with a full breakdown and metadata.

Instructions

Reports the current session's raw token usage, read directly from the host's own session transcript/rollout (auto-detected: Claude Code or OpenAI Codex CLI). Returns raw counts only — context_tokens (input + cache_creation + cache_read) plus a full breakdown and session metadata (session_id, model, timestamp) — with no percentage or context-window detection. May be unavailable early in a session before the first model response; then it returns { available: false, reason } instead of failing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
reasonYes
availableYes
breakdownYes
timestampYes
session_idYes
context_tokensYes
Behavior5/5

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

With no annotations, the description carries full burden and delivers richly. It discloses the source (host's session transcript/rollout), exactly what is returned (raw counts with breakdown and metadata), what is not included (percentages, context-window detection), and the fallback behavior when unavailable ({ available: false, reason }). This is a model of behavioral transparency.

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?

The description is front-loaded with the core purpose, then adds essential details about what is returned, what is excluded, and edge-case behavior. It is concise given the information density—every sentence contributes meaning without redundancy or fluff.

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?

For a tool with no parameters, no annotations, and no siblings, the description fully covers the tool's behavior: return contents, source, limitations, and failure mode. An output schema exists for structured return data, so the description doesn't need to enumerate every field—it complements the schema well. The description is complete for effective selection and invocation.

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?

The tool has zero parameters, so the schema is empty and schema coverage is 100%. The rubric assigns a baseline of 4 for zero-parameter tools. The description doesn't need to explain parameters, and it adds value by detailing return semantics instead, which is appropriate.

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?

The description clearly states the tool's purpose: 'Reports the current session's raw token usage'. It specifies the resource (current session's token usage) and the action (reports), which is specific and non-tautological. No sibling tools are present, so differentiation isn't applicable, but the description still achieves full clarity.

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?

The description gives clear context on when the tool is useful (e.g., for raw token counts) and its limitations (no percentage/context-window detection; may be unavailable early in a session). However, it stops short of explicitly naming alternatives or saying 'use for X, not for Y', so it lacks explicit exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/beeltec/context-usage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server