Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Pcb Drc

pcb_drc

Run 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

NameRequiredDescriptionDefault
board_pathYesPath to a .kicad_pcb file, at most 50 MB
refill_zonesNoTrue: refill zones before checking (slower); false: use the fills stored in the file
min_clearanceNoOptional minimum copper clearance with unit, 0 to 100 mm, e.g. '0.2 mm'; empty = the rule set's own
max_violationsNoHow 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_widthNoOptional minimum track width with unit, 0 to 100 mm, e.g. '0.15 mm'; empty = the rule set's own
use_project_filesNoTrue: 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

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4/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 burden and does it well: it discloses the external kicad-cli dependency, that it operates on a copy, refusal conditions (non-KiCad files, absurd coordinates, deep nesting), the guaranteed invalid_outline error without Edge.Cuts, and that library footprint issues are split into a separate bucket. It also flags a real trap — kicad-cli's 499/199 truncation limits making counts lower bounds, surfaced via at_kicad_limit.

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?

The purpose is front-loaded, but the body is a dense telegraphic block mixing return-field inventory, limit caveats, and library-warning behavior without structure. The opening 'Values: error_count, warning_count...' list partly duplicates the output schema and could be cut.

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?

For a high-complexity tool wrapping an external CLI, the description covers the prerequisites, the failure modes, the truncation caveat, and the warnings split. An output schema exists yet the description still orients the agent to the key result fields, so nothing needed to call it 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, and the description adds genuine meaning on top: it explains how min_clearance/min_track_width layer over the rule set's own values (with example units), and that use_project_files=false falls back to KiCad defaults. Only refill_zones is left entirely to the schema.

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

Purpose4/5

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

The first clause gives a specific verb and resource: run KiCad's design rule check (kicad-cli pcb drc) on a copy of a .kicad_pcb. That is unambiguous about what the tool does. It stops short of an explicit contrast with the sibling pcb_erc, leaving the DRC-vs-ERC distinction to be inferred from the domain.

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

Usage Guidelines3/5

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

Usage conditions are implied through behavioral notes: use_project_files=false ignores the project rule files, refill_zones trades speed for accuracy. There is no explicit when-to-use/when-not statement or named alternative, so the agent must infer the selection criteria.

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

Deploy Server

Other Tools