Skip to content

Progressive disclosure

A full tool result or search hit often holds far more than the next step needs. Each character in the window can be sent again on later model calls. Progressive disclosure compacts what the agent sees, and keeps a full copy on disk when it fits the mount limits.

Stash writes each result as a file when it fits the result and cache limits. It then shows the agent a compacted view. A result that is too large to store still gets a preview.

One large tool result. The agent searches the issue tracker, an MCP server, and needs only a few records. 1, the tracker returns 2,000 records, 144 KiB of JSON, to the Stash daemon. 2, the daemon writes the full result to the mount, all 2,000 records in one file, and gives the context window a preview: a compact table of items with number, title, and state, then 'and 1840 more records of items', which is 8% of the result in this example. The preview names the file. 3, the next step runs one jq filter on the file, and only the rows the agent needs enter the context window. The rule: a result of up to 20,000 characters shows whole; a longer result, like this one, shows a preview.

A small result is compacted without loss. Up to 20,000 characters, the agent sees the whole result. JSON prints as a compact table that writes each field name once and keeps every value.

A large result becomes a preview. Past that size, the agent sees a preview. When Stash saves the full result, the preview names its path and says how to read the rest with jq, grep, or sed. When the result does not fit, the preview says that Stash did not save it.

This compaction works for each configured MCP server. You do not need a compaction rule for each tool.

With first-party sources. Each first-party source has an opinionated view of its own, so the agent gets more from fewer characters:

  • A memory record shows its gist, such as the topics of a summary.
  • A knowledge-base passage gets more room when it ranks higher.
  • A web search fetches each cited page, and saves it as a Markdown file.
  • An AWS Context search saves the answer, its context, and its citations in one file.

The ticketing server returns INC-4412 with its comments as JSON:

{"id": "INC-4412", "status": "open", "comments": [
{"author": "oncall", "kind": "update", "text": "p99 at 1.4 s after deploy 2026-11-20.3"},
{"author": "oncall", "kind": "update", "text": "rolled back, p99 back to 300 ms"},
{"author": "sre-lead", "kind": "update", "text": "pool size change is the suspect"}
]}

The agent sees the same data as a table. The field names show once, and a value that is the same in every row shows once:

[table of the JSON, every value kept: ...]
id: "INC-4412"
status: "open"
comments[3]{author,text} same {"kind":"update"}
["oncall","p99 at 1.4 s after deploy 2026-11-20.3"]
["oncall","rolled back, p99 back to 300 ms"]
["sre-lead","pool size change is the suspect"]

Stash uses a table only when it saves at least 300 characters, so a real ticket with many comments gets one. With 400 comments, the agent sees the first rows and a line that says how many it left out. The preview also names the full-result path when Stash saves the file.

Start with a ready ops mount whose ticketing MCP source exposes a get_ticket tool. The One interface example shows the source config and its prerequisites.

Terminal window
stash tool call ops ticketing/get_ticket --input '{"id": "INC-4412"}'
jq '.comments[-3:]' \
/tmp/ops-context/mcp/ticketing/_tools_results/get_ticket/*/content/1.json

A follow-up question about INC-4412 can read the saved file without a remote call while the file is in the cache.