Guide

Agents

The same four 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/encodings/ai all call src/tool-operations.ts. Same arguments, same checks, same text back. A fix lands once. This site runs those executors too. Every Full tool response dialog here is exactly what a model reads.

ToolDoesArguments
encodings_encodeWrite text or bytes in an encodingencoding, input, inputFormat, options
encodings_decodeRead text back into bytesencoding, text, outputFormat
encodings_identifyRank the encodings a string decodes intext, limit
encodings_infoThe list, one family, or one encoding with its alphabetencoding or family, both optional

What a model reads

A header line, then the value.

text
bech32 → 20 bytes as hex (prefix "bc", witnessVersion 0):
751e76e8199196d454941c45d1b3a323f1433bd6

outputFormat is auto by default. Clean UTF-8 comes back as a quoted string, anything else as hex. Clean means no control characters, no bidi overrides, no line separators. Why so strict? A decoded string could rewrite the line it sits on, and a model would believe it. Ask for utf8 explicitly and you get it, escaped.

encodings_identify gives each candidate two lines. The rank, the encoding, the score and the reasons. Then the byte count and the bytes.

text
1. base32 0.593; padding fits the block length, decodes to readable text
   11 bytes, text "Hello World"

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

What they refuse

Every schema is closed. A misspelled argument is an error, not a quiet default.

text
Invalid arguments: unknown property "encodng"; takes encoding, input, inputFormat, options

A checksum that doesn't match is a tool error with the reason. The session carries on.

text
encodings_decode failed: base58check: checksum does not match

The bounds sit in the schema. The executor checks them again, since a host may skip schema validation. Text up to 100000 characters. Base58 up to 10000, because base58 is quadratic. Real ones are addresses and keys, nowhere near that long. At most 20 identify candidates. Nothing is written anywhere, and there's no network to reach.

MCP

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

Or in a client's config:

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

stdio, every tool read-only and idempotent.

Pi and OMP

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

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

AI SDK

ts
import { generateText } from "ai";
import { encodingAiTools } from "@agntn/encodings/ai";

await generateText({
  model,
  tools: encodingAiTools,
  prompt: "What does 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa decode to?",
});

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