← ClaudeAtlas

mcp-overflow-delegate-summarylisted

Use when an MCP tool result is dumped to a tool-results/*.txt file because it exceeded the token cap — delegate the read+summarize to a general-purpose subagent (or jq the file for targeted extraction) so the raw payload stays out of the main context.
hjr15/claude-kit · ★ 0 · AI & Automation · score 73
Install: claude install-skill hjr15/claude-kit
# MCP Overflow → Delegate Summary ## Overview MCP tool results that exceed the token cap are spilled to a `tool-results/*.txt` file with a message telling you to read it in chunks. **Don't read it back into the main context** — reading chunks re-introduces the bytes that were too big to fit. Either delegate a full read+summarize to a subagent, or `jq` the file for a targeted extraction. ## When to Use - Any MCP tool result returns "Error: result (X characters) exceeds maximum allowed tokens. Output has been saved to /path/to/tool-results/*.txt" - The file is JSON/structured data and you need an extract or summary - The data would otherwise need manual offset/limit Read skimming ## Two paths **Targeted extraction (counts, one field, a filter) → `jq` from the main context.** Faster than a subagent round-trip. The file is on disk; parse it directly: ```bash jq -r '.issues.nodes[] | "\(.key) [\(.fields.issuetype.name)] parent=\(.fields.parent.key // "NONE")"' /path/to/tool-results/X.txt ``` **Multi-page bulk result (a whole-project query that overflows on *every* page) → paginate at the edge, reduce each page to TSV, then analyse offline.** Never re-read a giant JSON page into context. Loop: probe structure once (`jq 'type, (.issues.nodes|length), .issues.pageInfo' <file>`); per page append a compact TSV (`jq -r '.issues.nodes[] | [.key, .fields.status.name, (.fields.parent.key//""), ...] | @tsv' <file> >> all.tsv`); paginate via `pageInfo.endCursor` / `nextPageToken` unt