Skip to main content
Glama

Context management health

context_status
Read-onlyIdempotent

Summarize context management over recent sessions: trims, token savings, fail-opens, stale proxy versions, and prompt-cache usage; use it instead of docker logs to check health.

Instructions

Summarize context management over recent sessions from the session store: trims, estimated tokens saved, fail-opens with their error type and location, the proxy code version (stale when it differs from the checkout), and provider-reported prompt-cache usage (hit ratio, cache-creation tokens on requests that made a new cut vs others, cache_control breakpoint counts). A fail-open means the request still succeeded but was sent untrimmed. Use this instead of docker logs; per-session detail is in smart_compact_sql's events table.

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": "context_status"
  }
}

Input Schema

NameRequiredDescriptionDefault
hoursNoWindow in hours, 1-720 (default 24)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, so the safety profile is covered. The description adds real behavioral context beyond that: it defines what a fail-open is ('the request still succeeded but was sent untrimmed'), explains when the proxy version is stale (differs from checkout), and clarifies that cache-creation tokens are split by whether the request made a new cut. It stops short of noting cost or latency of the aggregation, so not a 5.

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?

Front-loaded with the verb and scope, and every clause maps to an actual returned metric rather than filler. The metric enumeration is dense and somewhat run-on, but each item earns its place given there is no output schema to carry the field list.

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 no output schema, the description must carry the return-value burden, and it does so by naming each metric summarized plus the fail-open semantics. What is missing is any sense of output shape or aggregation granularity (per-session rows vs single rollup), which an agent might reasonably want.

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% and the single `hours` parameter is documented in-schema with its 1-720 range and default. The description adds no syntax or interpretation guidance for the window beyond what the schema already says, so the baseline 3 applies.

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?

States a specific verb (summarize) and resource (context management over recent sessions from the session store), then enumerates the exact metrics returned: trims, tokens saved, fail-opens, proxy version staleness, prompt-cache hit ratio. This is clearly distinguishable from sibling memory_* tools and from smart_compact_sql, which it names as the per-session drill-down.

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?

'Use this instead of docker logs' gives an explicit alternative plus the condition that selects this tool, and 'per-session detail is in smart_compact_sql's events table' routes the agent elsewhere when session-level granularity is needed. Both when-to-use and when-to-use-something-else are covered.

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