Pcb Drc
pcb_drcRun KiCad design rule checks on a .kicad_pcb copy to return error, warning, unconnected, and violation counts with type, severity, and location details.
Instructions
Run KiCad's design rule check (kicad-cli pcb drc, user-installed) on a copy of a .kicad_pcb. Values: error_count, warning_count, unconnected_count, violation_count. data.violations lists them by type and severity (type is a KiCad key such as clearance, track_width, invalid_outline, via_dangling) with the description and the position in mm of each item involved; data.unconnected lists missing connections; data.rule_set says which rules were used: KiCad's built-in defaults, or an allow-listed copy of the numbers in the .kicad_pro and the .kicad_dru next to the board (use_project_files=false ignores them), plus the min_clearance / min_track_width you pass (e.g. '0.15 mm'). A board with no Edge.Cuts outline always gets one invalid_outline error. The raw KiCad report is an artifact. Footprint libraries are not visible to the run, so lib_footprint_issues warnings can appear: they are split out in data.violations.library_warnings (and values.library_warning_count) from the findings about the board. kicad-cli stops listing a kind of violation at 499 (clearance) or 199 (track_width and others): a count equal to that is a lower bound, flagged in data.violations.at_kicad_limit and a warning. Refuses non-KiCad files, absurd coordinates and deep nesting before KiCad starts; needs kicad-cli.
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": {
"board_path": "<board_path>"
},
"name": "pcb_drc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| board_path | Yes | Path to a .kicad_pcb file, at most 50 MB | |
| refill_zones | No | True: refill zones before checking (slower); false: use the fills stored in the file | |
| min_clearance | No | Optional minimum copper clearance with unit, 0 to 100 mm, e.g. '0.2 mm'; empty = the rule set's own | |
| max_violations | No | How many violations to list (0 to 1000); counts by type are complete up to kicad-cli's own limit (499 clearance, 199 others) | |
| min_track_width | No | Optional minimum track width with unit, 0 to 100 mm, e.g. '0.15 mm'; empty = the rule set's own | |
| use_project_files | No | True: use the allow-listed rules of <name>.kicad_pro and <name>.kicad_dru next to the board if they exist; false: KiCad defaults only |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | Non-quantity payload (reports, listings) | |
| error | No | ||
| value | No | Primary quantity result | |
| values | No | All named quantity results (includes the primary) | |
| warnings | No | ||
| artifacts | No | ||
| provenance | Yes | What produced the result and from which inputs. | |
| review_status | No | unreviewed |