Skip to main content
Glama

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

NameRequiredDescriptionDefault
unitNo"mm" (default) or "mil".mm
widthNoThe width of the board in the unit (default 100).
heightNoThe height of the board in the unit (default 100).
overwriteNoTrue replaces an existing .kicad_pcb file. Set it only after the user agreed to lose the existing board.
schematic_pathYesThe .kicad_sch file. The board gets its name and its title.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full disclosure burden and does so thoroughly: file format follows the installed KiCad, a version mismatch produces a warning the agent must relay to the user, the project file is untouched, an existing .kicad_pcb causes an error instead of a write, and overwrite destroys all footprints, tracks and zones. These are exactly the destructive and side-effect facts an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first sentence front-loads the action and the rest is organized as content, prerequisites, versioning, and overwrite safety. Some redundancy exists between "the tool does not write it and returns an error" and the following sentence about removing footprints/tracks/zones, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description covers prerequisites, artifact contents, side effects, version-compatibility caveats, and the overwrite safety protocol. Nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description goes beyond it by explaining the consequence of overwrite=True (loss of all footprints, tracks and zones on the existing board) and the blocking error when the file exists. Width, height, unit and schematic_path semantics are left to the schema, which already documents them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ("Make a new board with an outline, next to the schematic") and then enumerates exactly what the artifact contains: a name taken from the schematic, a rectangle on Edge.Cuts, two copper layers, default design rules, and no footprints/tracks/nets. That level of specificity makes it distinguishable from analysis/export siblings without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear operational context: a Python with pcbnew is required, footprints come from KiCad's "Update PCB from Schematic" rather than this tool, and the user must be asked before setting overwrite=True. It stops short of naming an MCP sibling alternative (e.g. create_kicad_project) or stating that a schematic must already exist, so routing guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.