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 this 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.6/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, and the description still adds substantial behaviour: errors are returned as data and must be read from `diagnostics` rather than raised, diagnostics carry byte spans, line/col, E_/W_ codes and sometimes an applicable fix. It also documents the multi-storey return contract (`output` = lowest storey, `pages[]` = every storey) and an environment limitation (no image renderer on the hosted server).

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?

Purpose is front-loaded and nearly every clause carries new information (output formats, lossy round-trip list, diagnostics contract, storey behaviour, png limitation). However, it is one long dense paragraph with run-on sentences, so key facts like the png restriction and the diagnostics rule are buried mid-block rather than structured.

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 7-parameter tool with nested objects and no output schema, the description functions as the return-value contract: it names `output`, `pages[]` ({ level, name, output }) and `diagnostics` with their fields. Combined with 100% schema coverage, nothing essential for a correct call 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%, so baseline is 3; the description earns above that by explaining what `plan_json` accepts and its lossy cases (sheet tables, styles, circular rooms, roofs, storeys, `place`, accessibility metadata), plus how `level` and `format` interact with the returned `pages[]`. It does not add much on `width`, `overlay` or `accessible` beyond the schema, keeping it at 4.

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+resource ("Compile ArchLang `.arch` source … to an SVG floor plan") and then enumerates the alternative outputs (txt, json, png) with what each yields. An agent can distinguish this from siblings like validate/lint/score without opening the schema.

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?

Gives concrete routing conditions: use `level` to render one storey, `plan_json` when you already have a plan object, and avoid `format: "png"` on the hosted server in favour of `svg` or GET /svg/<payload>. It also states the round-trip exclusion (plan features Plan JSON does not carry). It stops short of positioning itself against the validate/lint siblings, so a 4 rather than a 5.

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.