setup_pcb_layout
Creates a new KiCad PCB file with a rectangular Edge.Cuts outline, two copper layers and default design rules, named after the schematic, so you can start layout and add footprints via Update PCB from Schematic.
Instructions
Make a new board with an outline, next to the schematic.
The board has the name of the schematic, a rectangle on Edge.Cuts, two copper layers and the default design rules. It has no footprints, tracks or nets: use "Update PCB from Schematic" of KiCad for the footprints.
pcbnew of the installed KiCad makes the board (a Python with pcbnew is necessary), thus the board has the file format of the installed KiCad, as when the user makes it in the PCB editor. When that is newer than the KiCad of the schematic, the output has a warning: tell the user that the older KiCad cannot open the board. The tool does not change the project file.
When the .kicad_pcb file exists, the tool does not write it and returns an error. A new board removes all footprints, tracks and zones of the existing board. Ask the user before you set overwrite=True.
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": {
"schematic_path": "<schematic_path>"
},
"name": "setup_pcb_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | No | "mm" (default) or "mil". | mm |
| width | No | The width of the board in the unit (default 100). | |
| height | No | The height of the board in the unit (default 100). | |
| overwrite | No | True replaces an existing .kicad_pcb file. Set it only after the user agreed to lose the existing board. | |
| schematic_path | Yes | The .kicad_sch file. The board gets its name and its title. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |