P&ID: From Spec
pid_from_specDraws a P&ID from a spec in one all-or-nothing transaction: places equipment, valves, instruments and connectors, routes lines port-to-port, and rolls back on invalid items or stale revision.
Instructions
Equipment, valves, instruments and connectors placed, then every line
drawn port-to-port, inside one transaction: any bad item rolls the whole
sheet back and the error names it (lines[2].to); so does an interruption
(a client cancellation mid-run leaves no half-drawn sheet and no open
transaction on either engine — the live one goes back to the UNDO Mark
transaction_begin set, so it never waits at an AutoCAD prompt; should
that rollback itself fail, the failure is logged, the cancellation is what
the client sees, and the drawing must be checked before a retry).
A non-finite coordinate, rotation, scale or stub is refused
by path before anything is placed. The response carries the graph read
back from the drawing and the P&ID critique issues, so the caller sees
dangling ends or duplicate tags in the same round trip. dry_run returns
the planned vertices and crossings without touching the drawing; crossings
are counted, on both runs, against the spec's own lines and the P&ID lines
already on the current layout (crossings_scope). The dry run also returns
the routing region and a preview whose precondition is the fingerprint
of every entity in that region. Applied with the preview's revision
(expected_revision) and/or preconditions, the run is refused with kind
stale_revision and nothing drawn when anything in the region (or the
revision) changed; a region precondition taken from another spec is
refused by path. A guarded run reports revision ({checked, after,
interleaved}).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spec": "<spec>"
},
"name": "pid_from_spec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | {sheet, equipment[], valves[], instruments[], lines[], connectors[]} — see the P&ID prompt | |
| dry_run | No | Validate and route in memory; draw nothing | |
| preconditions | No | A dry run's `preview.preconditions` (the routing region's fingerprint): draw only if nothing in the region changed; otherwise refused stale_revision and nothing is drawn. | |
| expected_revision | No | Draw only at this content revision (a dry run's `preview.revision`); otherwise refused stale_revision and nothing is drawn. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||