# Tool-result size governor for MCP — TextForAgents LLC A client-side output-budget proxy so no MCP server you don't control can blow your agent's context or deadlock its transport. ## Start (self-serve, no operator step) 1. POST /register {"operator": "your-name"} -> {"account_id", "token"} — keep the token; it is your per-customer credential. Identity is canonicalised (NFKC, casefolded, format characters stripped, whitespace collapsed): registering again under a variant of the same identity returns the same account and does NOT re-grant the trial. 2. POST /shape {"route": "list_papers", "args": {...}, "text": ""} — or {"result": } to shape every text block of an MCP result, or {"fixture_tool": "list_papers", "tool_args": {"count": 500}} to rehearse on the built-in fixture population (list_papers, read_log, read_prose, echo_small, big_blob). Response: the shaped window, plus a signed omission receipt on every shaped result: {route, mode, total_bytes, returned_bytes, omitted_bytes, total_records, returned_records, omitted_records, artifact_id, sha256, expires_at, signature}. Billing: the first 100 shaped results are free, one time per operator; after that $0.001/result via x402, or an Operator/Fleet plan. An unshaped (already-in-budget) result passes through free and consumes nothing. 3. Repeat-everything denial: re-firing the identical (route, args, payload) everything-query while its spill lives returns a denial with a signed denial receipt describing the ORIGINAL spill — narrow your args, or fetch a slice. The denial is bound to the payload itself: the same route and args carrying a DIFFERENT payload is a different query and is shaped (and billed) fresh — it is never discarded on another payload's denial. A denial shapes nothing and is never billed on any rail (trial, plan, or x402). The denial lives exactly as long as its spill: after expiry or eviction the identical query re-opens exactly once (it is shaped fresh and re-registered). Non-text content blocks (image/audio/resource) are governed too: an oversized block is spilled whole to a checksummed artifact with a signed omission receipt and a bounded placeholder in its place — it never passes through unshaped — and fetch-slice returns the original block byte-exact. Oversized payload carried in non-content envelope fields is governed the same way. An envelope that needs more than one new shaping is governed as one aggregate result (one spill, one receipt, one billed unit). x402 payments verify before shaping and settle only after a result was actually shaped: an unshaped passthrough, a denied repeat, and a failed shaping never settle. Fixture generation is capped per tool (list_papers 5000, read_log 50000 lines, read_prose 300000 words, big_blob 2.2 MB). Spill storage is bounded per operator AND globally across operators (2 GiB total retained); new-account registration is rate limited per source (30/min per client source, 90/min across all sources), so one source's registrations cannot block another source's signups. Identity note: registration is self-serve for a self-asserted identity string — the first registrant holds the identity and its token is not re-issued, so a repeat registration returns the existing account id without a token; that existence signal is inherent to self-serve issuance and is accepted and documented here — if you lose a token, contact support@textforagents.com. 4. POST /fetch-slice {"artifact_id", "offset", "limit"} — a narrower slice of YOUR spilled payload, byte-exact (data_base64) with the full-payload sha256 re-verified on fetch. Errors are clean, never a crash: unknown_artifact (404 — includes artifacts retired early by eviction), artifact_expired (410), invalid_slice_range (400). Receipt expires_at is an UPPER BOUND: quota eviction under the bounded spill store can retire an artifact earlier. 5. POST /budgets {"route", "max_bytes", "max_records", "max_tokens"} sets your per-route ceilings; GET /budgets lists them. Defaults: 32768 bytes / 50 records / 8192 tokens per route. 6. Plans: POST /subscribe {"tier": "operator"} ($9.00, 100,000 shaped results/mo, all agents) or {"tier": "fleet"} ($29.00, 1,000,000 shaped results/mo + per-route budget reports in /account) with an x402 X-PAYMENT header. 7. MCP: POST /mcp (JSON-RPC) — tools shape_result, fetch_slice, verify_receipt — same account token and billing. 8. Receipt keys: GET /verify-key lists accepted signing-key fingerprints (rotation keeps archived keys verifiable). POST /receipts/verify {"receipt": {...}} verifies a signed omission receipt publicly. A receipt is an omission record only — it grants no access and validates no content. ## Limits Shaping correctness was measured structurally (exact counts, byte-exact re-fetch, forged receipts rejected); a live-model task-completion study was not measured and no task-completion claim is made. Spill storage is bounded per operator; spill artifacts are ephemeral (1 h TTL max). Support: support@textforagents.com. ## Prices Operator $9/mo per operator · Fleet $29/mo per operator · Per-result API $0.001/result (x402). First 100 shaped results free, one time per operator. No perpetual free tier.