Skip to main content
Glama

Compile a floor plan to a drawing

compile
Read-onlyIdempotent

Compile ArchLang .arch source (or a Plan-JSON object) to an SVG floor plan, or with format to a plain-text ASCII plan ("txt"), Plan JSON ("json") or an image ("png"). Format "json" returns the plan as an object, with schema naming its JSON Schema; passed back as plan_json it compiles to the same drawing, unless the plan uses a part of the language Plan JSON does not carry (sheet tables, styles, circular rooms, roofs, storeys, place, accessibility metadata). Returns the output plus diagnostics; a diagnostic usually carries a byte span with line/col and an E_/W_ code, and often a fix, sometimes one the fix tool can apply. Errors come back as data, never as exceptions: read diagnostics and correct the source. A multi-storey plan (level <n> { … }) returns the lowest storey in output and every storey in pages[] ({ level, name, output }); pass level to render just one. format "png" is unavailable on the hosted server, which has no image renderer: use format "svg", or GET /svg/ on the hosted server for an image URL.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "compile"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoRender only this storey of a multi-storey plan. An undeclared level is an error, not a guess.
widthNopng only (any other format refuses it): the image width in pixels, clamped to 256-4096, and narrower for a tall plan so neither side exceeds 4096; default 1600.
formatNosvg (default), txt (zero-dependency ASCII), json (Plan JSON, the shape `plan_json` takes) or png (an image; needs the optional renderer).
sourceNoArchLang source (a `plan "…" { … }`). Provide this OR plan_json.
overlayNoDraw an opt-in circulation overlay (SVG only).
plan_jsonNoPlan JSON (RPLAN shape) as an alternative to `source`; converted to .arch then compiled.
accessibleNoEmit <title>/<desc>/role/aria accessibility metadata (SVG only).

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?

Beyond the read-only/idempotent annotations, it discloses the error model (errors come back as data, never as exceptions), diagnostic structure (byte span with line/col, E_/W_ codes, often a fix), multi-storey behavior (lowest storey in `output`, all in `pages[]`), and an environment-specific capability gap (no image renderer on hosted). That is exactly the behavioral 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-loaded with the core action and output formats, then layers round-trip, diagnostics, storeys, and hosting caveats. Every sentence carries information, but it is one dense paragraph with long parenthetical clauses that could be split for faster scanning.

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?

There is no output schema, and the description compensates fully by describing the return shape (`output`, `diagnostics`, `pages[]` with level/name/output) and the diagnostic fields. For a 7-parameter tool with nested plan_json and enum formats, nothing an agent needs to invoke it correctly appears 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 already 100%, so the baseline is 3; the description still adds cross-parameter meaning the schema lacks — the source-XOR-plan_json relationship, which plan features Plan JSON cannot round-trip (sheet tables, styles, circular rooms, roofs, storeys, `place`, accessibility metadata), and why `level` matters. It stops short of describing defaults or clamping beyond what the schema already states.

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?

Opens with a specific verb and resource: compile ArchLang `.arch` source (or Plan-JSON) into an SVG floor plan, with named alternative outputs (txt/json/png). The scope is precise enough that an agent can distinguish this from siblings like lint, validate, or fix, which appear only as downstream/upstream helpers in the text.

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 guidance for each format, states the round-trip rule (json output passed back as `plan_json`), warns that png is unavailable on the hosted server and points to format "svg" or GET /svg/<payload> as the alternative. It also routes fixes to the `fix` tool and says to correct the source when diagnostics appear, which is real alternative-selection guidance.

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.