design_execute_plan
Instantiates a DesignPlan in Altium by emitting a batched schematic from Python or using the legacy IPC executor. Accepts placement hints and edit modes so refined or changed plans apply without redrawing hand-edited sheets.
Instructions
Instantiate a DesignPlan in Altium.
Two execution paths:
use_canvas=True(default): the new canvas-based pipeline. Plan -> SymbolExtractor -> SchematicCanvas (all in Python) -> one-shot batched emit to Altium. Layout decisions are made before any IPC; an SVG preview is written next to the project file so you can sanity-check the schematic without opening it.use_canvas=False: the legacy executor that interleaves layout with Altium IPC. Kept as a fallback while the new path stabilises.
Both halt early if the plan contains any needs_creation parts. Resolve those first by either picking an existing-lib equivalent or branching into a library-authoring sub-task.
Args:
plan_json: Either a DesignPlan JSON string, or the DesignPlan
as a JSON object/dict. The MCP framework auto-deserializes
JSON-object literals to dicts before the tool sees them,
so both shapes are accepted.
project_path: Absolute path to the target .PrjPcb. Created
if it does not exist.
use_canvas: Pick the execution path. Default True runs
the new canvas pipeline; pass False to fall back to
the legacy executor.
placement_hints: Optional {refdes: {"x": int, "y": int, "rotation": int}} partial anchors. Hinted refdes pin
to the supplied position; others run through the
algorithmic placement (Sugiyama + multi-try scoring).
Used by the agent-in-loop refinement workflow:
1. Run design_preview_plan -> see SVG + score.
2. If layout is bad, identify specific refdes that
should sit elsewhere; build hints dict.
3. Call design_preview_plan again with hints ->
iterate until score is acceptable.
4. Call design_execute_plan with the same hints
to emit the refined layout.
mode: How to reach the sheet. "auto" (default) EDITS a
sheet this tool has drawn before, moving only the parts
whose position changed, placing the new ones, deleting
the ones the plan dropped, and leaving every other
component exactly as it is. It draws from scratch when
there is no prior sheet. This is what makes re-running a
changed plan safe on a schematic somebody has worked on.
"full" re-places every component, discarding any
hand edit; use it when you want the sheet redrawn.
"delta" refuses rather than redraw.
The edit path only knows what is in the plan. To keep a
part where a person dragged it, read the sheet back with
``design_hints_from_sheet`` and pass the result as
``placement_hints``.Returns:
Result dict with ok / project_path / sheets_touched / placed
(list of placements) / failures / needs_creation / notes.
Canvas-path additions: canvas (the SchematicCanvas dict
snapshot) and preview_svg_path (where the SVG was written).
On an edit, delta lists the refdes added, moved, replaced,
removed and untouched; placed then covers only the parts
actually placed, which on an edit is the new ones.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | auto | |
| plan_json | Yes | ||
| use_canvas | No | ||
| project_path | Yes | ||
| placement_hints | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||