Skip to main content
Glama

Set design rules

set_design_rules

Set the project design rules (.kicad_pro) and copper layer count. Works on a board workspace and on a generated design (create_design → start_board). On a generated design the rules go into circuit.kicad_pro/.kicad_dru in place (the previous ones are snapshotted under rules_revisions/), are kept by every later project write (project.zip, a new board run), the copper is not changed and KiCad DRC judges the board against them at once: the reply carries the DRC counts and whether the Gerbers are released; the next start_board routes to the default_* values. copper_layers, stackup and board_thickness_mm are workspace-only (a generated design changes them with a new board). preset "jlcpcb" applies JLCPCB's published minimums for the layer count and writes their per-feature limits (plated rings, pad hole spacing, hole-to-track) as KiCad custom rules (.kicad_dru) that run_drc checks; explicit values override the minimums. Board minimums (min_*), the Default net class (default_*), and named net classes with their net patterns. route_board routes with these rules and run_drc checks against them. Changing copper_layers rebuilds the stackup; tracks on removed layers are reported. copper_layers 1 is a single-sided board (hand etching): the KiCad file keeps F.Cu and B.Cu, and from then on the routers hold to one face (B.Cu as soon as a THT pad exists, else F.Cu) and place no via; copper on the other face is removed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
presetNo
wait_sNoSeconds to wait for the job (default 55). A job still running comes back with status "running": follow it with get_board_job.
stackupNoJLCPCB's 4-layer 1.6 mm impedance stackups, written into the board: 7628 (0.21 mm prepreg, their default) or 3313 (0.1 mm prepreg: thinner pairs for the same impedance). Needed before a net class states diff_impedance_ohm.
design_idYesThe design id returned by import_kicad_project or list_designs.
net_classesNo
min_track_mmNo
copper_layersNo
hole_to_hole_mmNo
default_track_mmNo
min_clearance_mmNo
hole_clearance_mmNo
board_thickness_mmNoFinished board thickness; the stackup is rebuilt to it. JLCPCB FR4: 0.4, 0.6, 0.8, 1.0, 1.2, 1.6, 2.0 mm.
min_via_annular_mmNo
min_via_diameter_mmNo
default_clearance_mmNo
default_via_drill_mmNo
min_through_drill_mmNo
default_via_diameter_mmNo
copper_edge_clearance_mmNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Far exceeds the annotations (which only say readOnly=false, destructive=false, openWorld=false). It discloses that previous rules are snapshotted under rules_revisions/, that rules persist across project.zip and new board runs, that copper_layers rebuilds the stackup and reports tracks on removed layers, that the reply carries DRC counts and Gerber release state, and the full single-sided behavior of copper_layers 1.

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

Conciseness3/5

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

Purpose is front-loaded, but the body is a dense near-run-on paragraph with very long sentences and no separators, forcing the reader to parse a wall of text. Most content earns its place, but structure and scanability suffer.

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

Completeness4/5

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

For a 19-parameter mutation with no output schema and no annotations covering behavior, the description supplies substantial behavioral and return context (DRC counts, Gerber release, rule persistence, stackup rebuild). Coverage of individual numeric parameters is the only notable gap.

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 description coverage is only 21%, so the description must compensate, and it does for the high-impact params: min_* board minimums, default_* net classes, named net classes with net patterns, preset 'jlcpcb', copper_layers=1 single-sided semantics, and stackup defaults. It still leaves several individual min_*/default_* fields unlabeled, so it doesn't fully close the coverage gap.

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?

States a specific verb and resource (set project design rules in .kicad_pro plus copper layer count) and clearly separates itself from siblings like check_net_rules, run_drc and set_keepouts. An agent can identify what this does 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?

Explains the two operative contexts (board workspace vs generated design created via create_design → start_board) and notes that route_board and run_drc consume these rules, plus that copper_layers/stackup/board_thickness_mm are workspace-only. It gives clear usage context but no explicit 'do not use this when' exclusion against a near-neighbor.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources