mcp-context-inspector
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-context-inspectorshow me the context timeline for session abc-123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.

Independent, unaffiliated open-source project. ctxwindow is not built, maintained, or endorsed by Anthropic. "Claude" and "Claude Code" are Anthropic's products; ctxwindow reads their publicly documented OpenTelemetry export and MCP protocol, nothing more.
The package/repo name on disk stays mcp-context-inspector; the product it ships is
called ctxwindow (after its domain, ctxwindow.uk).
Quick start
Live demo, no install: https://ctxwindow.uk
Not yet published to PyPI, so run it from source (Python 3.11+):
git clone https://github.com/sohaibsohail98/mcp-context-inspector
cd mcp-context-inspector && uv run python -m mcp_server.serverWith no MCP_AUTH_TOKEN set, the server generates and prints one on startup, using the
same trust model as a Jupyter server's printed token.
Then sign in at /auth/login (locally or on the live demo) and the page hands you one
command that writes the MCP connection and telemetry config into your own
~/.claude/settings.json (backed up first, merged, never overwritten):
curl -fsSL https://ctxwindow.uk/setup/install?t=<code> | shOn Windows the page's Windows (PowerShell) tab gives you the equivalent
irm "https://ctxwindow.uk/setup/install?os=windows&t=<code>" | iex instead.
The ?t= code is single-use and short-lived, so your real token is never in the command
itself. Close and reopen Claude Code afterward, since env vars only load at process
startup, then run one prompt and check "Test my connection" on the page.
Prefer to wire it up by hand, or connect claude.ai, the Messages API, or Copilot instead? See Usage and Run it locally.
Related MCP server: ai-usage-metrics-mcp
Documentation
Docs site, the full single-page reference (architecture, auth model, storage backends, deploying your own, environment variables, roadmap)
CONTRIBUTING.md, lint, tests, and what a good PR looks like here
LICENSE, MIT
Report a bug or ask a question. For a security issue, please open a private security advisory instead of a public issue.
Why this exists
Most agent observability tools re-show data your own UI already displays. ctxwindow shows something you normally can't see at all: system prompt, tool specs, reasoning, tool calls and results, and the final answer, in the order they actually entered context. Each block is measured against the model's real context window and marked as either visible to the user or invisible overhead. Token counts are honest, labeled estimates, not exact provider usage (see Architecture for why that tradeoff is the right one here).
Anthropic's Claude Code docs page, "Explore the context window", is an interactive simulation of what loads into a session and what each file read costs. It motivated wanting the same visibility for an arbitrary agent loop, not just Claude Code.
The 8 MCP tools
Tool | Returns | Read/write |
| Session metadata + per-prompt tokens/latency/cost | Read |
| Per-turn token/latency breakdown | Read |
| Tool call counts by status | Read |
| Ordered tool-call sequence for one session | Read |
| Estimated cost, one session or a time window | Read |
| Most recent sessions, newest first | Read |
| Full context-window block breakdown | Read |
| Records one agent execution's metrics | Write (append-only) |
Each tool ships explicit MCP annotations (readOnlyHint / destructiveHint /
idempotentHint / openWorldHint), so a client can auto-approve the seven reads and
prompt only for record_session. Nothing here reaches outside this server's own store
(openWorldHint is always false), and record_session only ever inserts a new session —
it never mutates or deletes one.
Plain REST equivalents are exposed under /api/*. Payload shapes are in
Architecture.
Contributing
See CONTRIBUTING.md for lint, tests, and what a good PR looks like
here. Run the suite with uv run pytest and lint with uv run ruff check ..
License
MIT licensed; see LICENSE. Developed alongside
sre-investigation-agent,
the reference chat UI and Bedrock agent this package was extracted from.
Available Tools
8 toolsget_agent_traceARead-onlyIdempotent
The ordered sequence of tool calls for one session -- each entry {name, args, status}.
Use to replay what the agent actually did, in execution order; use get_tool_metrics for aggregate counts.
session_id: id from get_recent_sessions / record_session.
Returns [] for an unknown or non-owned session.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds meaningful behavior beyond that: the ordered return shape (each entry with name, args, status) and the empty-array return for unknown or non-owned sessions, which is not implied by the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each purpose-specific: output definition, usage vs. alternative, and parameter sourcing. No filler and the most important information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter read-only tool with no output schema, the description provides the output format, ordering guarantee, empty-array edge case, and parameter provenance. Nothing essential is missing for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description compensates by documenting session_id as 'id from get_recent_sessions / record_session'. This tells the agent where to obtain the ID and what it refers to, which the bare string type does not convey.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description opens with 'The ordered sequence of tool calls for one session -- each entry {name, args, status}', which clearly states the verb, resource, and output structure. It explicitly contrasts with get_tool_metrics, so an agent can tell them apart.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description explicitly instructs: 'Use to replay what the agent actually did, in execution order; use get_tool_metrics for aggregate counts.' This names the alternative and the condition selecting it, leaving no ambiguity about when to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_context_timelineARead-onlyIdempotent
Ordered, categorized breakdown of everything that entered ONE session's context window.
Each block (system prompt, tool specs, injected context, user turns, reasoning, tool calls/results, final answer) is marked user-visible vs invisible overhead, with cumulative character-based token estimates against the model's real window size. Use for context-window composition analysis; use get_session_metrics for exact provider token usage. The estimates here are character-based, not exact Bedrock counts.
session_id: id from get_recent_sessions / record_session.
Returns [] for an unknown or non-owned session, or one recorded without the optional context_blocks field.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses that estimates are character-based rather than exact Bedrock counts, that it returns [] for unknown/non-owned sessions or sessions lacking the optional context_blocks field, and that blocks are classified as user-visible vs invisible overhead. These are non-obvious behaviors an agent would not know from the schema alone.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Every sentence earns its place: the first sentence states the core purpose, the second explains the breakdown format, the third gives usage guidance, and the final two cover parameters and return behavior. There is no filler, and the key differentiator is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one string parameter, read-only annotations, and no output schema, the description provides sufficient context: what the tool returns, how it behaves for missing/unknown sessions, what the session_id should be, and how the estimates differ from exact metrics. An agent can both select and safely invoke this tool without further assumptions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only defines session_id with no textual description (0% coverage), but the description explicitly says 'session_id: id from get_recent_sessions / record_session.' This completely compensates for the schema gap by telling the agent exactly where the id comes from.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific, differentiated statement: 'Ordered, categorized breakdown of everything that entered ONE session's context window.' It names the resource (a session's context window) and the operation's output form, and it later explicitly distinguishes itself from get_session_metrics by noting exact token usage is not what this returns.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use the tool: 'Use for context-window composition analysis.' It also names the alternative for exact token usage: 'use get_session_metrics for exact provider token usage.' This gives the agent an unambiguous routing decision.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cost_estimateARead-onlyIdempotent
Estimated USD cost as a float.
Pass session_id for one session's cost, or period_seconds for the summed cost of your sessions in the last N seconds. Give exactly one; non-owners are scoped to their own sessions. These are estimates from token counts and a static price table, not billed amounts.
session_id: optional session id. period_seconds: optional lookback window in seconds (e.g. 86400 for the last day).
Returns 0.0 for an unknown or non-owned session_id, and for a period with no matching sessions.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | ||
| period_seconds | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark this as read-only, idempotent, and non-destructive, so the bar is lower. The description adds meaningful behavioral context: estimates are not billed amounts, and unknown/non-owned session IDs as well as empty periods return 0.0. These are exactly the edge cases an agent needs to anticipate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the core meaning, then moves to usage modes, then edge cases. Each sentence earns its place; no filler or repetition of annotation values.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the annotations already cover safety and idempotency, and an output schema exists, the description supplies all remaining needed context: parameter semantics, exclusivity, scoping, estimate nature, and zero-value fallback behavior. An agent can invoke this tool correctly without further inference.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries the full burden for parameter meaning. It explains both parameters in plain language, gives an example value for period_seconds, and clarifies mutual exclusivity plus ownership scoping. This fully compensates for the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a precise statement of purpose: 'Estimated USD cost as a float.' It clearly identifies the resource (session cost) and the computation basis (token counts and a static price table), and distinguishes this from billed amounts, which separates it from related metrics tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit usage guidance: pass exactly one of session_id or period_seconds, explains what each mode computes, and notes non-owner scoping. It does not explicitly name sibling tools as alternatives, but for this tool the parameter-mode distinction is the main usage decision and it is covered clearly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_recent_sessionsARead-onlyIdempotent
List recent sessions, newest first: [{session_id, prompt, model_id, created_at, ...}].
Call this first to discover session_ids for the other get_* tools. Non-owners see only their own sessions; the owner token sees all.
limit: max rows to return (default 10), newest first.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly, idempotent, and non-destructive behavior, so the description does not need to restate those. It adds meaningful behavioral context by explaining ownership-based visibility: non-owners see only their own sessions while the owner token sees all, plus the output format in the sample.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded: a one-line summary, a usage-direction sentence, and a parameter note. Every sentence serves a distinct purpose with no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a low-complexity tool with one optional parameter. The description covers what it returns, how results are ordered, the visibility rules, and how it relates to sibling tools. There is no output schema, but the sample shape compensates adequately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description carries full responsibility for explaining the 'limit' parameter. It does so clearly: 'max rows to return (default 10), newest first.' This adds semantic meaning beyond the raw integer schema and fully compensates for the missing schema description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'List recent sessions, newest first' and includes a sample result shape. It also distinguishes this tool's role as the discovery entry point for session_ids used by the other get_* tools, making it easy for an agent to know exactly what it does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Call this first to discover session_ids for the other get_* tools' gives explicit sequencing and intent, which is strong usage guidance. It does not spell out exclusion cases, but the context makes it clear this is the intended first step before sibling get_* tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_session_metricsARead-onlyIdempotent
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).
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
TDQS
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.
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.
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.
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.
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.
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.
get_token_breakdownARead-onlyIdempotent
Per-turn input/output token and latency breakdown for one session, in turn order.
Use to see how token usage grew turn-by-turn within a session; use get_session_metrics for session totals.
session_id: id from get_recent_sessions / record_session.
Returns [] for an unknown or non-owned session.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already communicate read-only, idempotent, and non-destructive behavior. The description adds useful behavioral details beyond the annotations: results are in turn order, and an unknown or non-owned session returns an empty list. It does not specify units for latency, but the annotation coverage lowers the burden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: a definitional first sentence, a usage-routing second sentence, and a parameter/edge-case note. Every sentence earns its place without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter read-only operation, the description covers purpose, expected output shape, turn ordering, token and latency aspects, parameter provenance, and the empty-list edge case. No output schema exists, but the description provides enough conceptual shape to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides no description for session_id, so the description compensates by explaining that session_id comes from get_recent_sessions or record_session. This gives an agent the source and provenance of the parameter, which is meaningful given the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: it provides per-turn input/output token and latency breakdown for one session, in turn order. It also explicitly distinguishes itself from get_session_metrics, so an agent can tell when this tool applies.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives direct usage context: use this tool to see how token usage grew turn-by-turn within a session, and use get_session_metrics for session totals. This explicit routing to a sibling tool makes the selection criteria clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_tool_metricsARead-onlyIdempotent
Tool-call counts grouped by status (ok / error), for one session or aggregated.
Use for a quick success/failure summary; use get_agent_trace for the ordered call list. Non-owners only ever see their own sessions; the owner token sees everyone's.
session_id: optional. Omit for the aggregate across all your sessions; pass an id for just that session.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No |
TDQS
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 behavioral context: results are grouped by ok/error, omitting session_id aggregates across sessions, and non-owners only see their own sessions while the owner sees everyone's.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: core purpose first, then usage guidance, ownership caveat, and parameter detail. Every sentence earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter read-only metrics tool with no output schema, the description covers purpose, when to use an alternative, ownership scoping, and parameter semantics. Nothing essential is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description fully compensates by explaining the only parameter, session_id: omit for the aggregate across all sessions, or pass an id for just that session. This is exactly the semantic information an agent needs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: it returns tool-call counts grouped by status (ok/error) for one session or aggregated. It distinguishes itself from get_agent_trace by framing itself as a summary rather than an ordered call list.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to use this tool for a quick success/failure summary and to use get_agent_trace for the ordered call list. It also gives clear direction on omitting versus passing session_id, plus an ownership-based visibility caveat.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
record_sessionA
Append ONE agent execution's metrics to this server's store; returns the new session_id.
This is how a remote agent gets its own runs into the server, rather than only being able to query what the server owner recorded locally. Attributed to the connected identity: your Google account if you signed in via /auth/login, or owner=None for the owner token. NOT idempotent -- each call mints a new session_id. Never updates or deletes an existing session; the get_* tools read what this writes.
prompt: the user prompt that started the run. model_id: the provider model identifier, e.g. "anthropic.claude-3-5-sonnet-20241022-v2:0". loop_result: the run's token / latency / trace payload. Required keys: input_tokens (int), output_tokens (int), total_tokens (int), latency_ms (float), turns (list). Optional: trace (list), context_blocks (list -- omit if you don't have per-block context data; get_context_timeline needs it).
each
turnsitem: input_tokens (int), output_tokens (int), latency_ms (float); optional cache_read_input_tokens / cache_write_input_tokens (int, default 0).each
traceitem: tool (str), args (dict), status (str); optional latency_ms (float, default 0), timestamp (float epoch seconds, default record time).each
context_blocksitem: category (str), label (str), char_count (int), token_estimate (int); optional turn_n (int or null -- null for a pre-conversation block), status (str), content (str).
Example loop_result:
{
"input_tokens": 1200, "output_tokens": 340, "total_tokens": 1540,
"latency_ms": 4210.0,
"turns": [
{"input_tokens": 1200, "output_tokens": 340, "latency_ms": 4210.0,
"cache_read_input_tokens": 800, "cache_write_input_tokens": 0}
],
"trace": [
{"tool": "grep_logs", "args": {"pattern": "ERROR"}, "status": "ok",
"latency_ms": 120.0, "timestamp": 1756400000.0}
]
}
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| model_id | Yes | ||
| loop_result | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description explicitly notes non-idempotency, that each call mints a new session_id, that existing sessions are never updated or deleted, and that records are attributed to the connected identity (Google account or owner=None). This complements the annotations, which are structural hints, with concrete side-effect details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long, but every section earns its place: purpose and identity semantics are front-loaded, parameter details are systematically organized, and the example makes the nested structure concrete. Its length is proportional to the complexity of the tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a nested parameter object, an existing output schema, and complex optional branches, the description is complete: it covers auth attribution, return value, non-idempotency, required/optional fields, defaults, and a worked example.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, and the description fully compensates: it defines prompt, model_id, and loop_result, and enumerates required and optional nested keys for turns, trace, and context_blocks with a complete JSON example.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Starts with a specific verb and resource: 'Append ONE agent execution's metrics to this server's store; returns the new session_id.' It clearly identifies this as the write counterpart to the get_* read tools, so an agent can differentiate it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states when it is appropriate: 'This is how a remote agent gets its own runs into the server, rather than only being able to query what the server owner recorded locally.' It also clarifies it never updates or deletes and that read access happens through the get_* siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
8 tool updates
v0.4.0- First observed
get_agent_trace - First observed
get_context_timeline - First observed
get_cost_estimate - First observed
get_recent_sessions - First observed
get_session_metrics - First observed
get_token_breakdown - First observed
get_tool_metrics - First observed
record_session
TDQS
Each read tool targets a distinct slice of session data—totals, per-turn breakdown, tool-call counts, ordered trace, cost, context timeline, and session discovery—and the descriptions explicitly point to which tool to use. record_session is the only write tool and is clearly separated. No two tools are fungible.
All read tools follow a consistent get_<object>_<metric> snake_case pattern, and the single write tool uses the verb record_session. The naming is predictable and matches each tool's function without mixing conventions.
Eight tools is well-scoped for a session-metrics store: one intake tool, one session-discovery tool, and six focused query/analytics views. Each tool earns its place with no redundancy or bloat.
The server covers the full intended lifecycle: record_session ingests runs, get_recent_sessions discovers session IDs, and the get_* tools provide totals, turn-level detail, tool traces, cost estimates, and context-window composition. Update and delete are deliberately excluded from this append-only metrics store, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
- SpanlyOAuthcom.spanly
MCP observability. Query live traffic, errors, duration, and alerts from your AI agent.
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP-native agent evaluation and observability server. Log traces, evaluate output quality with 12 built-in rules (PII detection, prompt injection, cost thresholds), and track agent costs. Real-time dashboard, OTel-compatible spans. Self-hosted, MIT licensed.91299MIT
- AlicenseNot gradedqualityDmaintenanceA MCP server for tracking AI usage metrics and structured logs across applications. Monitor model calls, analyze usage patterns, track costs, and debug AI interactions.12MIT
- AlicenseAqualityBmaintenanceAn MCP server that provides cost and reliability observability for LLM and agent workflows. It records model calls and allows querying and aggregating telemetry data through MCP tools.6MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that gives AI agents observability over their own tool calls, enabling auditing, cost tracking, latency analysis, and alerting.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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