Skip to main content
Glama

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

NameRequiredDescriptionDefault
pointsYesThe points (x, y) in mm. Each point after the first ends a segment.
file_pathYesThe .kicad_sch file.
snap_to_gridNoTrue: 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

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so substantively: it discloses segment merging, merging with touching same-line wires, removal of the span between two pins of a two-pin symbol, and junction insertion at three-way meetings. It also names the grid source and the ERC consequence of off-grid endpoints. The only gap is that it never states plainly that the .kicad_sch file is modified in place.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first clause, then behavior, then constraints, which is a sensible order. The middle paragraph is dense but each clause carries distinct information; the lead-in 'As the schematic editor of KiCad' is the one phrase that does little work.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter geometry tool with a full output schema, the description covers the geometry model (points in mm, segments), snapping side effects, auto-merge behavior, and junction reporting. Treating return values as covered by the output schema is legitimate here. It stops short of stating persistence or failure modes, which keeps it from a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already defines all three parameters including snap_to_grid's behavior. The description adds one genuinely new fact, that the connection grid is schematic.connection_grid_size with a 1.27 mm default, which lets an agent predict snapping, but otherwise restates what the schema documents. Baseline 3 reflects schema doing most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Add a wire to the schematic: a line through two or more points" gives a specific verb and resource and immediately grounds it in KiCad's SCH_LINE model. It doesn't explicitly distinguish itself from siblings like add_label or add_component_from_library, but the object it creates is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through the description of connecting points and pins, and the grid/ERC notes hint at when precision matters. However, there is no explicit guidance on when to use this versus add_label or add_component, and no stated preconditions such as whether the target sheet must already exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.