pcb_get_all_primitives
Retrieve all PCB primitives of a given type—components, tracks, vias, pads, pours, or regions—with optional net, layer, and lock filters to inspect or export board data.
Instructions
Get all primitives of a specific type on the PCB, with optional filters. Filters by type: component(layer), track/polyline/arc(net,layer), via(net), pad(layer,net), pour/fill(layer,net), region(layer). Component fields: primitiveId, designator, name, layer, x, y, rotation, primitiveLock, addIntoBom. Track fields: primitiveId, net, layer, startX, startY, endX, endY, lineWidth. Via fields: primitiveId, net, x, y, holeDiameter, diameter, viaType. Pad fields: primitiveId, net, layer, padNumber, x, y.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| net | No | Filter by net name | |
| type | Yes | Primitive type to query | |
| layer | No | Filter by layer (e.g. "TopLayer", "BottomLayer") | |
| limit | No | Truncate result array to at most N items | |
| fields | No | Project results to only these top-level keys. Response includes _availableFields showing all keys. IMPORTANT: Always specify fields when you know what you need — without it, responses include every property and can be extremely large (100KB+), wasting context. | |
| filter | No | Keep items matching all conditions (AND). Exact: {key: value}, prefix glob: {key: "R*"}, OR: {key: ["a","b"]} | |
| document | Yes | Target document UUID — auto-switches to this document before executing. Get UUIDs from list_instances or editor_get_open_tabs. | |
| instance_id | No | Target EasyEDA instance ID (8-char hex). Required when multiple instances are connected. Omit when only one instance is connected (auto-selected). Use list_instances to see connected instances. | |
| primitiveLock | No | Filter by lock status (true=locked only, false=unlocked only) |