add_wire
Draws schematic wires through two or more points, merging collinear segments, removing wire portions between symbol pins, and adding junctions where wires meet.
Instructions
Add a wire to the schematic: a line through two or more points.
A KiCad wire has two points (SCH_LINE). The tool adds one wire for each segment, as KiCad saves a line with corners.
As the schematic editor of KiCad, the tool merges the segments that are on one straight line, merges a new wire with a wire of the sheet on the same straight line that it touches, removes the part of a new wire between the two pins of a symbol with two pins, and adds a junction where three or more wire directions meet (a wire end or a pin in the middle of a wire). The output tells each junction and each changed wire.
The connection grid is schematic.connection_grid_size of the project file (default 1.27 mm). ERC finds a wire end off this grid (endpoint_off_grid).
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": {
"file_path": "<file_path>",
"points": "<points>"
},
"name": "add_wire"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| points | Yes | The points (x, y) in mm. Each point after the first ends a segment. | |
| file_path | Yes | The .kicad_sch file. | |
| snap_to_grid | No | True: move each point to the nearest point of the connection grid. A point on a connection point of the sheet (a pin, a wire end, a junction, a label) stays. A point in the middle of a wire moves only along the wire. A horizontal or vertical segment stays horizontal or vertical. False: use the points as they are. The output tells the points off the grid. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |