Guide

Agents

The same tools over MCP and Pi and OMP and the AI SDK. What they take and what they refuse and what the model reads back

Same tools, every host

Four hosts, one set of executors. The MCP server, the Pi and OMP extensions and @agntn/compressions/ai all call src/tool-operations.ts. Same arguments, same checks, same text back. This site runs those executors too, so every tool dialog here shows exactly what a model reads.

ToolDoesArguments
compressions_compressCompress text or bytes, give base64 or hex backformat, input, inputFormat, dataFormat, options
compressions_decompressDecompress, show a window of the resultformat, data, dataFormat, outputFormat, offset, length, partial, options
compressions_identifyRank the formats some bytes decompress in, or peel themdata, dataFormat, peel, depth
compressions_infoThe list, or one format with its containers and optionsformat, optional

Compressed bytes travel as base64 by default. A model can't send raw bytes, and base64 is what it gets handed most of the time anyway.

What a model reads

A header line, then the value:

text
deflate (container gzip) → 12 bytes, as utf8 (os 255, members 1):
"hello world!"

outputFormat is auto by default. Readable text comes back quoted, anything else as hex. Ask for utf8, hex or base64 and you get that.

compressions_identify with peel: true lists the layers, outermost first, and hands over the bottom:

text
3 layers, outermost first:
1. bzip2 container bzip2, confidence 90: starts with its magic number; checksum matches; decodes to the last byte (level 9, blocks 1)
   88 bytes, hex fd377a585a000004e6d6b4460200210116000000742fe5a3…
2. lzma container xz, confidence 90: starts with its magic number; checksum matches; decodes to the last byte (check "crc64", blocks 1)
   32 bytes, hex 1f8b08000000000000ffcb48cdc9c95728cf2fca495104006dc2b4030c000000
3. deflate container gzip, confidence 100: starts with its magic number; checksum matches; decodes to the last byte; decompresses to readable text (os 255, members 1)
   12 bytes, text "hello world!"
Innermost, 12 bytes as base64:
aGVsbG8gd29ybGQh

Everything the next call needs is in the text. An MCP client sees nothing else. Pi, OMP and the AI SDK get structured details as well.

What they refuse

Every schema is closed. A misspelled argument is an error, not a quiet default. An option that exists, but not for this format or this direction, gets named instead of swallowed:

text
Ignored, deflate does not take here: level

A broken stream is a tool error with the reason and the offset. The session carries on, and partial: true shows what came out before the damage. The output stops at 64 MiB and one answer shows 16 KiB unless length asks for more, up to 1 MiB. Limits has the rest. Nothing gets written to disk, and there's no network to reach.

MCP

shell
compressions mcp
claude mcp add compressions --scope user -- npx -y @agntn/compressions mcp

Or in a client's config:

json
{
  "mcpServers": {
    "compressions": { "command": "npx", "args": ["-y", "@agntn/compressions", "mcp"] }
  }
}

stdio, every tool read-only and idempotent.

Pi and OMP

shell
pi install npm:@agntn/compressions
omp install @agntn/compressions

Both extensions are declared in package.json and ship as source the host loads directly.

AI SDK

ts
import { generateText } from "ai";
import { compressionAiTools } from "@agntn/compressions/ai";

await generateText({
  model,
  tools: compressionAiTools,
  prompt: "What's inside H4sIAAAAAAAA/8tIzcnJVyjPL8pJUQQAbcK0AwwAAAA=?",
});

compressionAiTools holds all four under the same names. Each one is exported alone too, compressionsDecompressTool and friends, if you'd rather hand a model fewer.