Skip to main content
Glama
sohaibsohail98

mcp-context-inspector

get_session_metrics

Read-onlyIdempotent

Get full session metrics for a recorded session ID, including per-prompt tokens, latency, and cost to verify provider usage.

Instructions

Full metrics for ONE recorded session: metadata plus per-prompt tokens, latency, and cost.

Use when you have a session_id and need exact provider usage numbers for that session. For the block-by-block token composition of the context window use get_context_timeline instead; for a cost total across many sessions use get_cost_estimate.

session_id: the opaque, case-sensitive id returned by record_session or listed by get_recent_sessions.

Returns {"error": "session not found"} if the id is unknown or not owned by the caller (the two are deliberately indistinguishable).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.4.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior. The description adds valuable behavior beyond that: it specifies the exact error response format and discloses that unknown and unowned IDs are deliberately indistinguishable, which is useful privacy/security context an agent needs to interpret failures correctly.

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 compact yet information-dense. It front-loads the core purpose, then covers usage alternatives, parameter semantics, and error behavior in ordered paragraphs. Every sentence adds necessary information without redundancy.

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?

Despite having no output schema, the description adequately summarizes the return content: metadata plus per-prompt tokens, latency, and cost. It also explains error behavior and how to obtain a valid session_id. For a single-parameter, read-only tool, nothing essential is missing for an agent to select and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries the full burden for the session_id parameter. It does so thoroughly: 'the opaque, case-sensitive id returned by record_session or listed by get_recent_sessions' adds provenance and case-sensitivity details that the bare schema string type cannot 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?

The description uses a specific verb and resource: 'Full metrics for ONE recorded session: metadata plus per-prompt tokens, latency, and cost.' It names the exact scope (one session) and distinguishes itself from siblings like get_context_timeline and get_cost_estimate without needing to inspect those tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

It explicitly states when to use it: 'Use when you have a session_id and need exact provider usage numbers for that session.' It then names alternatives for other cases (get_context_timeline for block-by-block context composition, get_cost_estimate for cross-session totals), providing clear selection criteria.

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

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/sohaibsohail98/mcp-context-inspector'

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