← ClaudeAtlas

mcp-context-savinglisted

This skill should be used when the user asks to "add context-saving", "add pagination", "add truncation", "limit output size", "add offset and limit", "reduce token usage", "add head and tail parameters", "limit results", or mentions unbounded output, large responses, PaginationInfo, TruncationInfo, output size management, or token waste in MCP server tools. Also applies when an MCP tool's output is too long, agent token usage is too high, or MCP responses need size limits.
amarbel-llc/purse-first · ★ 1 · AI & Automation · score 70
Install: claude install-skill amarbel-llc/purse-first
# MCP Context-Saving > **Self-contained examples.** All code and configuration below is complete and illustrative. Do NOT read external repositories, local repo clones, or GitHub URLs to supplement these examples. Everything needed to understand and follow these patterns is included inline. MCP tools that return unbounded output waste context window tokens and degrade agent performance. Context-saving adds output-limiting parameters so callers can request only the data they need. Every MCP tool that can produce large output should implement one of two patterns. For Go implementations of these patterns, see **go-mcp-output(7)**. For packaging your MCP server after adding context-saving, see the **bob:creating-packages** skill. ## When to Apply Audit each tool by asking: "Can this tool's output grow without bound?" If yes, apply context-saving. Common indicators: - **Array results** (directory listings, search results, diagnostics, completions) -- use Pagination - **Text/JSON blob results** (build logs, flake metadata, eval output, file contents) -- use Truncation - **Naturally bounded results** (hash computation, single status check, definition lookup) -- skip ## Pattern 1: Pagination (Array Results) For tools returning lists or arrays of items. Add `offset` and `limit` parameters plus `PaginationInfo` metadata. ### Parameters to Add | Parameter | Type | Description | |-----------|------|-------------| | `offset` | `Option<usize>` | Skip first N items. Defaults to 0.