Board outline, holes, rules
pcb_setupConfigure a KiCad board's outline, mounting holes, copper layers, fab design rules, net classes, and silkscreen text; only supplied settings are changed.
Instructions
Board setup: outline, corner mounting holes, copper layer count, fab design rules + net classes, silkscreen text size. Only what you pass is changed. Outline, one of: width x height mm rectangle (optional radius; REPLACES the existing outline), polygon, auto_size=true (smallest comfortable rectangle for the parts, unrouted boards only), or outline_file='case.step' (STEP, DXF, SVG, STL; 'auto' = the one file in mechanical/): the board body or an enclosure's cavity with its arcs, cutouts and mounting holes; an uncertain pick lists candidates (outline_pick), outline_dry_run=true only analyses. First setup applies the design rules of the project's fab profile (rules='fab'). power_nets adds nets / patterns to the Power net class. Examples: pcb_setup(width=40, height=30) · pcb_setup(width=50, height=50, radius=2, holes='M3', layers=4) · pcb_setup(outline_file='mechanical/case.step', outline_dry_run=true) · pcb_setup(power_nets=['VBAT','SW'], power_track=0.8)
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": "pcb_setup"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| via | No | Default via [diameter, drill] mm | |
| holes | No | Corner mounting holes | |
| rules | No | Design-rule preset: fab | <fab profile>[_advanced] | jlc | jlc_advanced | relaxed | none (default on first setup: the project's fab profile) | |
| width | No | Board width mm | |
| height | No | Board height mm | |
| layers | No | Copper layers | |
| origin | No | Top-left corner [x,y] mm (default [100,100]) | |
| radius | No | Corner radius mm (0 = square) | |
| render | No | attach a PNG (default false) | |
| polygon | No | Custom outline [[x,y],...] instead of width/height | |
| project | No | project path (default: active) | |
| hole_net | No | Use plated holes tied to this net (e.g. GND) | |
| auto_size | No | Pick the board size from the parts (no tracks/zones/locked parts) | |
| silk_text | No | Reference designator height mm (most fabs print ≥ 0.8; default 1.0) | |
| hole_inset | No | Hole centre distance from the board edges mm (default 3.5) | |
| power_nets | No | Extra Power-class nets / wildcard patterns, e.g. ['VBAT','BATN','SW','*_PWR'] | |
| while_open | No | refuse (default) | revert | |
| power_track | No | Power net class track width mm (keeps the project's value if omitted) | |
| outline_axis | No | Which way is up (component side / enclosure opening) | |
| outline_file | No | CAD file for the outline (.step .stp .stpz .dxf .svg .stl) or 'auto' | |
| outline_flip | No | Mirror left-right (drawn from the solder side) | |
| outline_mode | No | board = file is the PCB; enclosure = fit into its cavity; face = use outline_pick | |
| outline_pick | No | Candidate id from an earlier result's candidates[] | |
| default_track | No | Default net class track width mm (keeps the project's value if omitted) | |
| outline_holes | No | mounting (default): 1.8-6.6 mm circles become mounting holes; all: every inner contour is cut | |
| outline_layer | No | DXF layer / SVG group id or label holding the outline | |
| outline_units | No | Units for STL / unit-less DXF, SVG | |
| outline_dry_run | No | Analyse and show the pick, write nothing | |
| outline_clearance | No | Inward offset mm (default 0; 0.5 for an enclosure) | |
| outline_keep_position | No | Keep the file's coordinates instead of moving to origin |