feat: add get_pin_net tool for direct net/pin queries

Answers "what net is pin X of component Y on?" without requiring
callers to triangulate from list_schematic_nets or know a wire
coordinate first.

Accepts either {reference, pin} (resolved via PinLocator) or {x, y}
coordinate. Returns net label name (or null for unnamed nets), all
connected pins, wire segments, and the resolved query point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Eugene Mikhantyev
2026-04-12 15:19:14 +01:00
parent 9387683368
commit 5f3c20d308
5 changed files with 543 additions and 0 deletions

View File

@@ -1523,6 +1523,44 @@ SCHEMATIC_TOOLS = [
"required": ["schematicPath", "x", "y"],
},
},
{
"name": "get_pin_net",
"title": "Get Pin Net",
"description": (
"Returns the net name and all connected component pins for a query. "
"Accepts either a component reference + pin number (e.g. reference='U1', pin='3') "
"or a schematic coordinate (x, y in mm). "
"If a net label or power symbol is reachable from the query point, its name is "
"returned as 'net'; otherwise 'net' is null (unnamed net). "
"The 'pins' list contains every component pin on that same net."
),
"inputSchema": {
"type": "object",
"properties": {
"schematicPath": {
"type": "string",
"description": "Path to the schematic file (.kicad_sch)",
},
"reference": {
"type": "string",
"description": "Component reference (e.g. U1, R1). Pair with pin.",
},
"pin": {
"type": "string",
"description": "Pin number or name (e.g. '3', 'SDA'). Pair with reference.",
},
"x": {
"type": "number",
"description": "X coordinate of a wire endpoint in mm. Pair with y.",
},
"y": {
"type": "number",
"description": "Y coordinate of a wire endpoint in mm. Pair with x.",
},
},
"required": ["schematicPath"],
},
},
{
"name": "get_schematic_pin_locations",
"title": "Get Schematic Pin Locations",