encode
Bring your own text -> the cheapest substrate for your reader — the MCP twin of HTTP POST /v1/encode.
Not a search-result rendering trick: this is Glyph as a language anyone can speak.
Give it a tool result, a RAG chunk, a document — it comes back as whichever form
(dense photo-glyph image or plain text) is genuinely cheaper for your reader model's
token billing, with the honest manifest attached. The trailing JSON block always
carries a `selection` object {substrate, reader, reader_class, tier, rationale,
estimates} so the choice is auditable from the token math — the same object the
HTTP route returns.
Billed at the flat query rate regardless of which substrate is chosen — text and
glyph cost the same here, unlike retrieve_auto's answer substrate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Your text to encode — a tool result, a RAG chunk, a document. Max 40,000 chars. | |
| reader | No | Your reader model — used to pick the cheapest legible substrate. Flat-tile billers ('gemini', 'qwen') can get a dense glyph; pixel billers ('claude', 'gpt-4o') get text. Unknown/None is treated as pixel-billed — the safe default (text), never an overclaimed saving. | |
| verbatim | No | Set true if this text must stay exact (code, hashes, quotes) — it then never picks glyph, which paraphrases. None (default) auto-detects fenced code blocks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |