Skip to main content
Glama

Query a KiCad file's structure

query_design
Read-onlyIdempotent

Use to read a KiCad file as STRUCTURE rather than text: pass a file path from list_board_files and a select path of node names from the root, and get the matching nodes back as data. For example select ["kicad_pcb","layers"] for the layer stack, ["kicad_pcb","footprint"] for the footprints, ["kicad_pcb","via"] / ["kicad_pcb","segment"] for raw via and track nodes, ["kicad_pcb","zone"] for copper pours, ["kicad_sch","lib_symbols"] for symbol definitions, or use read_file for JSON .kicad_pro design rules and net classes. Far cheaper and more reliable than reading a multi-megabyte board as raw text with read_file. For schematic CONNECTIVITY prefer read_schematic; for copper nets, vias and pads prefer read_pcb. Use this for what those two do not carry (zones, stackup details, footprint properties, design rules). Run one query_design call at a time and keep depth at 3 or less on a .kicad_pcb: parallel calls contend for a small parse budget and a deep expansion of a board is a very large response.

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": "<board>",
      "path": "<path>",
      "select": "<select>"
    },
    "name": "query_design"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesThe exact file path within the board, as returned by list_board_files. Do not guess.
boardYesA board: handle/slug or a boardrepo.com URL. Use search_boards for public boards or list_my_boards for personal and authorised organisation boards. Do not invent references.
depthNoHow many levels of children to expand (default 2, at most 5). Keep it at 3 or less on a .kicad_pcb: a deep expansion of a large board is a large response.
cursorNoOpaque pagination cursor from a previous call; pass to fetch the next page of matches.
selectYesNode names from the root downward, e.g. ["kicad_pcb","layers"], ["kicad_pcb","via"], ["kicad_pcb","zone"], or ["kicad_sch","lib_symbols","symbol"]. The first entry is the file's root node.
versionNoWhich saved version to read: a version number (3 or "v3"), a versionId from list_board_versions, "latest", or a release tag such as "rev-A". Omit for the latest version. Results echo the version they read; pass its id back to stay on it.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / depth / description
      Previous value: -"How many levels of children to expand (default 2). Keep it small: a deep expansion of a large board is a large response."New value: +"How many levels of children to expand (default 2, at most 5). Keep it at 3 or less on a .kicad_pcb: a deep expansion of a large board is a large response."
    • addedInput schema / properties / version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "maxLength": 64,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Which saved version to read: a version number (3 or \"v3\"), a versionId from list_board_versions, \"latest\", or a release tag such as \"rev-A\". Omit for the latest version. Results echo the version they read; pass its id back to stay on it."
      +}
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "hasNextPage": {
      +        "type": "boolean"
      +      },
      +      "matches": {
      +        "items": {
      +          "additionalProperties": true,
      +          "properties": {},
      +          "required": [],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "nextCursor": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "note": {
      +        "type": "string"
      +      },
      +      "path": {
      +        "type": "string"
      +      },
      +      "select": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "totalMatches": {
      +        "type": "integer"
      +      },
      +      "version": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "id": {
      +            "type": "string"
      +          },
      +          "latest": {
      +            "type": "boolean"
      +          },
      +          "number": {
      +            "type": "integer"
      +          },
      +          "tags": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "number",
      +          "latest",
      +          "tags"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "select",
      +      "totalMatches",
      +      "matches",
      +      "hasNextPage",
      +      "nextCursor"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "appError": {
      +        "type": "string"
      +      },
      +      "bytesNeeded": {
      +        "type": "integer"
      +      },
      +      "cause": {
      +        "type": "string"
      +      },
      +      "currentHead": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "currentPolicyHash": {
      +        "type": "string"
      +      },
      +      "docsUrl": {
      +        "type": "string"
      +      },
      +      "fix": {
      +        "type": "string"
      +      },
      +      "freeBytes": {
      +        "type": "integer"
      +      },
      +      "issues": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "message": {
      +              "type": "string"
      +            },
      +            "path": {
      +              "type": "string"
      +            },
      +            "received": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "path",
      +            "message"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "operationId": {
      +        "type": "string"
      +      },
      +      "projectsLeft": {
      +        "type": "integer"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "resetsAt": {
      +        "type": "string"
      +      },
      +      "retryAfterMs": {
      +        "type": "integer"
      +      },
      +      "retryable": {
      +        "type": "boolean"
      +      },
      +      "sourceSaved": {
      +        "type": "boolean"
      +      },
      +      "storedResultAvailable": {
      +        "type": "boolean"
      +      },
      +      "suggestions": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "board": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            },
      +            "url": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "board",
      +            "name",
      +            "url"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "uploadLinks": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "bytes": {
      +              "type": "integer"
      +            },
      +            "expiresAt": {
      +              "type": "string"
      +            },
      +            "headers": {
      +              "type": "object"
      +            },
      +            "method": {
      +              "const": "PUT"
      +            },
      +            "path": {
      +              "type": "string"
      +            },
      +            "sha256": {
      +              "type": "string"
      +            },
      +            "uploadUrl": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "path",
      +            "bytes",
      +            "sha256",
      +            "uploadUrl",
      +            "method",
      +            "headers",
      +            "expiresAt"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "url": {
      +        "type": "string"
      +      },
      +      "visibility": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "reason",
      +      "message"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties
      Removed value: -{
      -  "hasNextPage": {
      -    "type": "boolean"
      -  },
      -  "matches": {
      -    "items": {
      -      "additionalProperties": true,
      -      "properties": {},
      -      "required": [],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "nextCursor": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "note": {
      -    "type": "string"
      -  },
      -  "path": {
      -    "type": "string"
      -  },
      -  "select": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "totalMatches": {
      -    "type": "integer"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "path",
      -  "select",
      -  "totalMatches",
      -  "matches",
      -  "hasNextPage",
      -  "nextCursor"
      -]
  2. Changed1 schema field changed
    • changedInput schema / properties / select / description
      Previous value: -"Node names from the root downward, e.g. [\"kicad_pcb\",\"layers\"] or [\"kicad_sch\",\"lib_symbols\",\"symbol\"]. The first entry is the file's root node."New value: +"Node names from the root downward, e.g. [\"kicad_pcb\",\"layers\"], [\"kicad_pcb\",\"via\"], [\"kicad_pcb\",\"zone\"], or [\"kicad_sch\",\"lib_symbols\",\"symbol\"]. The first entry is the file's root node."
  3. Changed1 schema field changed
    • changedInput schema / properties / board / description
      Previous value: -"A public board: handle/slug (e.g. alice/keezyboost40) or a boardrepo.com URL. Discover it with search_boards; do not invent one."New value: +"A board: handle/slug or a boardrepo.com URL. Use search_boards for public boards or list_my_boards for personal and authorised organisation boards. Do not invent references."
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, openWorld and non-destructive behavior, so the bar is lower. The description still adds real behavioral context beyond them: parallel calls contend for a small parse budget, deep expansion produces very large responses, and results echo the version read so the caller can stay pinned. It does not cover error behavior (e.g. invalid select path), which would be the last piece.

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 paragraph is front-loaded with purpose and examples, then alternatives, then operational constraints, so an agent can stop reading early and still act correctly. It is dense rather than padded, though the select examples partially duplicate the schema's own examples and the alternative-routing sentence is long.

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?

With an output schema present and full parameter coverage, the description need not explain return shapes; it instead supplies exactly what structured fields cannot: sibling routing, intent-to-select mapping, concurrency limits and response-size warnings. Nothing an agent needs in order to invoke it correctly appears to be 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 description coverage is 100%, so baseline is 3. The description adds meaning beyond the schema by giving worked select paths tied to user intents and by explaining the version-echo workflow ("pass its id back to stay on it"), which the schema only gestures at.

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 opens with a specific verb and an explicit conceptual framing: "read a KiCad file as STRUCTURE rather than text", plus the two inputs (file path, select path of node names). It then contrasts itself with read_file, read_schematic and read_pcb, so an agent can place it among siblings without opening schemas.

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

Usage Guidelines5/5

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

It names concrete select paths to use for each intent (layers, footprint, via/segment, zone, lib_symbols) and explicitly routes competing intents elsewhere: read_file for .kicad_pro, read_schematic for connectivity, read_pcb for copper nets/vias/pads. It also states the tool's residual niche ("what those two do not carry") and adds an operational rule: one call at a time, depth <= 3 on .kicad_pcb.

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.