Summary
Add an ignore_pour_layers input option to the auto_route MCP tool. The option must exclude selected copper layers from the automatic full-board GND pours created after autoroute import.
This option affects only the generated GND pours. It must not change the layers available to the autorouter and must not disable GND stitching vias.
Motivation
auto_route currently creates or rebuilds a full-board GND pour on every copper layer when pour_gnd is enabled. Some boards need signal-only layers, controlled impedance layers, antenna keepout layers, or layers whose copper pours will be created manually.
At the moment, avoiding a GND pour on one of these layers requires disabling all automatic GND pours with pour_gnd: false. Users should be able to keep automatic pours enabled while excluding individual layers.
This is a small extension of the existing full-board GND pour implementation. It is not intended to introduce or define the API of the future polygon engine.
Proposed API
Add the following property to AutoRouteInputSchema in mcp/src/tools/pcb/pcb-routing.ts:
ignore_pour_layers: z
.array(PcbRoutingLayerSchema)
.default([])
.describe(
'Copper layers excluded from automatic GND pours, e.g. ["TOP"] or ["INNER_1","INNER_2"]. Does not affect routing or GND stitching vias.',
),
Use the plural name ignore_pour_layers, because the option accepts multiple layers.
Example
{
"route_layers": ["TOP", "BOTTOM"],
"pour_gnd": true,
"ignore_pour_layers": ["TOP"],
"suture_gnd": true
}
Expected result:
- the autorouter may route tracks on both
TOP and BOTTOM;
- the generated full-board GND pour is created on
BOTTOM but not on TOP;
- GND stitching vias are still generated according to the existing suture settings.
Required changes
MCP server
- Add
ignore_pour_layers to AutoRouteInputSchema with an empty-array default.
- Pass the value through the
import-pcb-autoroute-json bridge request.
- Use camelCase (
ignorePourLayers) in the internal bridge payload, consistently with the existing pourGround and sutureGround fields.
- Do not reuse or modify
route_layers: routing layer selection and pour layer exclusion are separate concerns.
EasyEDA client bridge
- Read and validate
body.ignorePourLayers as a string array.
- Pass the normalized values to
pourDefaultGroundAndSutureVias().
- Missing input must behave as an empty exclusion list for backward compatibility.
GND pour generation
- Extend the existing ground-pour options with
ignorePourLayers?: string[].
- Filter the result of
getCopperLayers() by its canonical names: TOP, BOTTOM, and INNER_1 through INNER_30.
- Continue removing previous Copilot-generated GND pours before rebuilding. This ensures that a pour generated by an earlier run is also removed when its layer is excluded by a later run.
- Never delete user-created pours. Cleanup must remain limited to pours whose names start with the existing Copilot GND pour prefix.
- Do not apply the exclusion list to GND stitching vias.
Behavior and edge cases
- Default
ignore_pour_layers: [] preserves the current behavior.
- When
pour_gnd is false, ignore_pour_layers has no effect.
- Layers listed in
ignore_pour_layers may still be used for routing when included in route_layers.
- Duplicate layer names must not cause errors or otherwise change the result.
- The Zod schema must reject unsupported layer names.
- Layers that are valid copper layer names but are not present in the current PCB stack may be ignored without failing the autoroute operation.
- If every copper layer in the current stack is excluded, remove existing Copilot-generated GND pours, create no new pours, emit a clear warning, and allow the successful route import to remain successful.
- An empty or missing board outline must keep the existing warning/error behavior.
Acceptance criteria
Out of scope
- A generic polygon or copper-pour engine.
- Creating pours for nets other than
GND.
- Per-layer clearance, priority, thermal relief, or polygon geometry settings.
- Changing how GND stitching via candidates are generated.
- Changing the
pour_gnd or suture_gnd defaults.
- Removing the existing post-autoroute GND workflow.
Implementation notes
The current data flow is:
AutoRouteInputSchema
-> import-pcb-autoroute-json bridge request
-> pourDefaultGroundAndSutureVias()
-> drawDefaultGroundPours()
-> getCopperLayers()
The exclusion list should be threaded through this path and applied only when drawDefaultGroundPours() selects the copper layers to rebuild. Keeping the filter near the existing layer enumeration prevents accidental coupling with autorouter layer selection.
Summary
Add an
ignore_pour_layersinput option to theauto_routeMCP tool. The option must exclude selected copper layers from the automatic full-board GND pours created after autoroute import.This option affects only the generated GND pours. It must not change the layers available to the autorouter and must not disable GND stitching vias.
Motivation
auto_routecurrently creates or rebuilds a full-board GND pour on every copper layer whenpour_gndis enabled. Some boards need signal-only layers, controlled impedance layers, antenna keepout layers, or layers whose copper pours will be created manually.At the moment, avoiding a GND pour on one of these layers requires disabling all automatic GND pours with
pour_gnd: false. Users should be able to keep automatic pours enabled while excluding individual layers.This is a small extension of the existing full-board GND pour implementation. It is not intended to introduce or define the API of the future polygon engine.
Proposed API
Add the following property to
AutoRouteInputSchemainmcp/src/tools/pcb/pcb-routing.ts:Use the plural name
ignore_pour_layers, because the option accepts multiple layers.Example
{ "route_layers": ["TOP", "BOTTOM"], "pour_gnd": true, "ignore_pour_layers": ["TOP"], "suture_gnd": true }Expected result:
TOPandBOTTOM;BOTTOMbut not onTOP;Required changes
MCP server
ignore_pour_layerstoAutoRouteInputSchemawith an empty-array default.import-pcb-autoroute-jsonbridge request.ignorePourLayers) in the internal bridge payload, consistently with the existingpourGroundandsutureGroundfields.route_layers: routing layer selection and pour layer exclusion are separate concerns.EasyEDA client bridge
body.ignorePourLayersas a string array.pourDefaultGroundAndSutureVias().GND pour generation
ignorePourLayers?: string[].getCopperLayers()by its canonical names:TOP,BOTTOM, andINNER_1throughINNER_30.Behavior and edge cases
ignore_pour_layers: []preserves the current behavior.pour_gndisfalse,ignore_pour_layershas no effect.ignore_pour_layersmay still be used for routing when included inroute_layers.Acceptance criteria
auto_routeexposesignore_pour_layerswith a default value of[].ignore_pour_layers: ["TOP"]prevents creation of the Copilot GND pour onTOP.route_layersbehavior is unchanged.auto_routedocumentation includes an example that explains the difference betweenroute_layersandignore_pour_layers.Out of scope
GND.pour_gndorsuture_gnddefaults.Implementation notes
The current data flow is:
The exclusion list should be threaded through this path and applied only when
drawDefaultGroundPours()selects the copper layers to rebuild. Keeping the filter near the existing layer enumeration prevents accidental coupling with autorouter layer selection.