Compile a floor plan to a drawing
compileCompile 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
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | Render only this storey of a multi-storey plan. An undeclared level is an error, not a guess. | |
| width | No | png 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. | |
| format | No | svg (default), txt (zero-dependency ASCII), json (Plan JSON, the shape `plan_json` takes) or png (an image; needs the optional renderer). | |
| source | No | ArchLang source (a `plan "…" { … }`). Provide this OR plan_json. | |
| overlay | No | Draw an opt-in circulation overlay (SVG only). | |
| plan_json | No | Plan JSON (RPLAN shape) as an alternative to `source`; converted to .arch then compiled. | |
| accessible | No | Emit <title>/<desc>/role/aria accessibility metadata (SVG only). |