Skip to main content
Glama

ts_stale_context

Read-onlyIdempotent

Scan recent session transcripts to find tool results made obsolete later in the same session, then return stale refs so you can drop or refetch them.

Instructions

Scan the recent session transcript(s) and list tool results made obsolete later in the SAME session — a file read then re-read, a file read then edited, a Bash command re-run. Returns the stale refs so you can drop that content or refetch the fresh copy, keeping the context window lean. Agent-agnostic, read-only, PII-safe. format='table' (default) or 'json'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoCap the number of stale refs returned (default unlimited).
formatNoOutput format. 'table' (default) or 'json'.
projectNoFilter to project dirs whose name contains this substring (omit = all recent).
since_daysNoOnly consider events newer than now - since_days (default 1 = the current session).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.24.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the 'read-only' phrasing adds little; however 'agent-agnostic' and 'PII-safe' deliver real extra context, and the description clarifies what a returned stale ref actually represents. It does not elaborate on pagination or ref shape.

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?

Two tight sentences with the primary action front-loaded, the qualifying examples compressed into a dash-separated list, and the closing note on format. Nothing is wasteful or buried.

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?

For a read-only, no-output-schema scan tool, the description covers purpose, staleness criteria, and intended use of the result. It could say slightly more about the shape of the returned refs, but an agent has enough to invoke it correctly.

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%, so limit, format, project, and since_days are already fully documented. The description only restates the format default ('table' vs 'json'), adding no syntax or semantics beyond the schema. Baseline 3.

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 (scan/list) and resource (obsolete tool results in the recent session transcript), and pins down the exact staleness semantics with concrete examples (read-then-reread, read-then-edit, Bash re-run). No sibling covers this niche, so an agent can identify it distinctly from ts_search, ts_execute, or memory_* 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.

Usage Guidelines4/5

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

Gives clear context and payoff ('so you can drop that content or refetch the fresh copy, keeping the context window lean'), which implies when to reach for it. It never names an alternative or an explicit when-not condition, so it stops short of full routing guidance.

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