Skip to main content
Glama

Autonomous 0-DRC PCB Routing Foundry & Hardware MCP Server

Analyze KiCad PCB Layout

analyze_kicad_pcb
Read-onlyIdempotent

Parse a KiCad .kicad_pcb layout to extract copper layers, board outline, SMD/THT pads, routed segments, arcs, and vias. Call first before DFM audits or cloud routing. Accepts raw pcb_text or local project_path; falls back to built-in 2l_rp2040 if omitted. Returns JSON layer, pad, and track counts. Example: project_path='board.kicad_pcb'.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_path": "board.kicad_pcb"
    },
    "name": "analyze_kicad_pcb"
  }
}

Input Schema

NameRequiredDescriptionDefault
pcb_textNoRaw UTF-8 KiCad .kicad_pcb S-expression text for remote calls.
project_pathNoLocal filesystem path to a .kicad_pcb file (STDIO mode).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / pcb_text / description
      Previous value: -"Raw UTF-8 KiCad .kicad_pcb S-expression file content (must begin with '(kicad_pcb'). Required for remote HTTP calls when project_path is unavailable. Example: '(kicad_pcb (version 20240108) ...)'."New value: +"Raw UTF-8 KiCad .kicad_pcb S-expression text for remote calls."
    • changedInput schema / properties / pcb_text / examples
      Previous value: -[
      -  "(kicad_pcb (version 20240108) (generator \"pcbnew\") ...)"
      -]New value: +[
      +  "(kicad_pcb (version 20240108))"
      +]
    • changedInput schema / properties / project_path / description
      Previous value: -"Local filesystem path to a .kicad_pcb file on the client workstation (used in local STDIO mode; ignored over remote HTTP). Example: 'hardware/board.kicad_pcb'."New value: +"Local filesystem path to a .kicad_pcb file (STDIO mode)."
    • changedInput schema / properties / project_path / examples
      Previous value: -[
      -  "board.kicad_pcb",
      -  "2l_rp2040"
      -]New value: +[
      +  "board.kicad_pcb"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / pcb_text / examples
      Added value: +[
      +  "(kicad_pcb (version 20240108) (generator \"pcbnew\") ...)"
      +]
    • addedInput schema / properties / project_path / examples
      Added value: +[
      +  "board.kicad_pcb",
      +  "2l_rp2040"
      +]
  3. Changed3 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / pcb_text / description
      Previous value: -"Raw .kicad_pcb S-expression."New value: +"Raw UTF-8 KiCad .kicad_pcb S-expression file content (must begin with '(kicad_pcb'). Required for remote HTTP calls when project_path is unavailable. Example: '(kicad_pcb (version 20240108) ...)'."
    • changedInput schema / properties / project_path / description
      Previous value: -"Path to .kicad_pcb file."New value: +"Local filesystem path to a .kicad_pcb file on the client workstation (used in local STDIO mode; ignored over remote HTTP). Example: 'hardware/board.kicad_pcb'."
  4. Changed3 schema fields changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "pcb_text": "(kicad_pcb (version 20240108))"
      -  }
      -]New value: +[
      +  {
      +    "project_path": "board.kicad_pcb"
      +  }
      +]
    • removedInput schema / properties / pcb_text / examples
      Removed value: -[
      -  "(kicad_pcb (version 20240108))"
      -]
    • removedInput schema / properties / project_path / examples
      Removed value: -[
      -  "board.kicad_pcb"
      -]
  5. Changed5 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "pcb_text": "(kicad_pcb (version 20240108))"
      +  }
      +]
    • changedInput schema / properties / pcb_text / description
      Previous value: -"Raw `.kicad_pcb` S-expression text"New value: +"Raw .kicad_pcb S-expression."
    • addedInput schema / properties / pcb_text / examples
      Added value: +[
      +  "(kicad_pcb (version 20240108))"
      +]
    • changedInput schema / properties / project_path / description
      Previous value: -"Local filesystem path to a `.kicad_pcb` file"New value: +"Path to .kicad_pcb file."
    • addedInput schema / properties / project_path / examples
      Added value: +[
      +  "board.kicad_pcb"
      +]
  6. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, non-destructive, closed-world behavior, so the bar is low. The description still adds non-obvious behavior beyond them: a silent fallback to the built-in 2l_rp2040 board when no input is supplied, and the fact that it returns JSON counts rather than the parsed geometry itself. That fallback is exactly the kind of surprise an agent needs warned about.

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?

Three tight sentences plus an example, with the highest-value facts (what it parses, when to call it) front-loaded and the fallback disclosed before the trailing example. The closing example largely duplicates the schema's examples field, so the last sentence is the weakest, but overall there is no padding.

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 two-optional-parameter read-only tool with no output schema, the description covers everything needed to call it correctly: inputs and their modes, the default when both are omitted, sequencing relative to downstream audits, and a summary of the returned JSON. Nothing an agent needs 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 both parameters are already documented, giving a baseline of 3. The description earns an extra point by adding the omission semantics — that leaving both inputs out falls back to a built-in sample board — which is a behavioral default the schema does not state and which materially changes what a zero-argument call does.

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 (Parse) and resource (.kicad_pcb layout) and enumerates exactly what is extracted: copper layers, board outline, SMD/THT pads, segments, arcs, vias. It also positions itself against siblings by declaring it should be called before DFM audits or cloud routing, so an agent can distinguish it from audit_pcb_dfm_rules and the routing tools without opening either 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?

Gives explicit sequencing guidance ('Call first before DFM audits or cloud routing') and explains the input-mode choice between raw pcb_text and local project_path. It stops short of naming the alternative sibling tools directly or stating when not to use it, but the ordering rule covers the main selection decision.

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.