mcp-context-savinglisted
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.