Skip to main content
Glama

encode

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
textYesYour text to encode — a tool result, a RAG chunk, a document. Max 40,000 chars.
readerNoYour 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.
verbatimNoSet 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

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite annotations already declaring readOnly, idempotent, and openWorld hints, the description adds significant behavioral context: flat billing regardless of substrate, safe default for unknown readers, verbatim handling to preserve exact text, and the auditability of the selection manifest. It also explains the token-math rationale behind substrate choices, going well beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is overly verbose and includes promotional language like 'Not a search-result rendering trick: this is Glyph as a language anyone can speak.' Multiple paragraphs could be condensed without losing meaning. The essential content is buried in fluff, reducing clarity and violating the principle that every sentence should earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers critical operational details: the selection object's fields, billing equivalence, reader-dependent behavior, and verbatim mode. With an output schema present and rich annotations, the description is sufficiently complete to guide usage, though a more explicit statement of return structure would slightly improve it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides complete descriptions for all three parameters (text, reader, verbatim), including maxLength, default values, and behavioral notes. The description adds some explanatory color (e.g., what reader types imply for billing) but does not materially exceed the schema's coverage, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool encodes user-provided text into either a glyph image or plain text, selecting the substrate that is cheaper for the reader model. It uses a specific verb ('encode') and resource ('your text'), and differentiates itself from the sibling tool 'retrieve_auto' by clarifying it is not a search-result rendering trick but a standalone encoding endpoint.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description indicates appropriate use cases such as feeding tool results, RAG chunks, or documents, and explains the `verbatim` flag for code/hashes. It explicitly contrasts with retrieve_auto's answer substrate, providing some alternative guidance, though it stops short of exhaustive when-to-use/when-not-to-use scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.9/5.0
Disambiguation2/5

Several tools overlap significantly: fillin_query, glyph_search, and retrieve_auto all perform post-cutoff retrieval and differ only in output substrate, and fillin_health and fillin_stats both report corpus stats. This creates ambiguity for agents choosing between them.

Naming Consistency3/5

Tool names mix three conventions: fillin_* (fillin_query, fillin_mint), query_* (query_cves, query_papers), and bare names (encode, glyph_search, retrieve_auto). While readable and mostly snake_case, the lack of a uniform prefix or verb pattern makes naming inconsistent.

Tool Count4/5

14 tools is within the acceptable range for a multi-feature server, but there is some redundancy (two health/stats tools, three retrieval variants), making the count feel slightly inflated.

Completeness5/5

The server covers retrieval (text/glyph/auto), encoding, marketplace operations (mint, search, buy), and domain-specific queries (CVEs, frontier AI, markets, papers), with no obvious missing capabilities.

Resources