Skip to main content
Glama

Convert a whole document

geml_to
Read-only

Convert a whole document between GEML, Markdown, JSON, or HTML and return it as text, including importing Markdown to GEML. Use it to read or transform files, then write results with other block tools.

Instructions

Convert a WHOLE document and get the result back as text — the read half of the CLI's geml <file> --to <fmt>. to: "geml" on a Markdown file is the importer, the one thing the block tools cannot do; to: "md" projects a GEML document out (lossy); to: "json" returns the full document model, for when geml_list plus geml_get is not enough. Nothing is written — pass the result to geml_add or geml_set to land it. to: "html" also works but returns a whole self-contained page, usually tens of kilobytes this server cannot save: prefer the CLI (geml <file> --to html -o out.html) unless you want the markup in the conversation. A document with errors returns its diagnostics instead of a conversion, and a file that is not under the server root is an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoTarget format. Default is the CLI's: a GEML input becomes json, a Markdown input becomes geml. `html` is a whole page — large, and not writable from here.
fileYesDocument path relative to the server's --root directory, e.g. notes/spec.geml
fromNoOverride the input format, which is otherwise inferred from the extension (.md -> md, .json -> json, else geml).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=true: states nothing is written and tells the agent to pass results to geml_add/geml_set to persist, discloses that md output is lossy, that html is large and unwritable from the server, that erroneous documents return diagnostics not a conversion, and that out-of-root files error. This is exactly the extra operational context annotations cannot carry.

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

Conciseness4/5

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

Front-loads the core action, then layers format-specific guidance and error semantics. Dense but each clause adds a distinct fact. The single long paragraph is information-rich yet slightly cramped; minor formatting would help but nothing is wasted.

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

Completeness5/5

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

For a read-only conversion tool with no output schema, the description covers defaults, per-format tradeoffs, lossiness, error returns, root-scoping, and how to persist results. Nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100% and the schema already documents each parameter, so baseline is 3. The description adds real value: it explains the per-enum behavior of `to` (json = full model, md = lossy projection, geml = importer), which the schema only sketches, plus defaulting behavior linking to the CLI.

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?

States a precise verb+resource: convert a WHOLE document to text. It explicitly frames itself as the read counterpart to the CLI write path and differentiates from sibling block tools ('the one thing the block tools cannot do'). An agent can distinguish it from geml_get/geml_list immediately.

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

Usage Guidelines5/5

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

Gives explicit when-to-use per target format, names alternatives (CLI for html; geml_list+geml_get for partial reads), and states a when-not ('prefer the CLI ... unless you want the markup in the conversation'). Routing guidance is concrete and actionable.

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