Query a KiCad file's structure
query_designUse 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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The exact file path within the board, as returned by list_board_files. Do not guess. | |
| board | Yes | 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. | |
| depth | No | 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. | |
| cursor | No | Opaque pagination cursor from a previous call; pass to fetch the next page of matches. | |
| select | Yes | 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. | |
| version | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||