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).
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). Keep it small: 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| path | Yes | ||
| select | Yes | ||
| matches | Yes | ||
| nextCursor | Yes | ||
| hasNextPage | Yes | ||
| totalMatches | Yes |