Skip to main content
Glama

vi_edit

Edits an existing LabVIEW VI by removing nodes, adding code, and rewiring existing objects and loop or case contents while preserving diagram layout; backs up and reverts broken edits.

Instructions

Change an existing VI: remove nodes, add code, and wire it to what is already there, including inside existing loops and case frames. The rest of the diagram keeps its layout. Call vi_dump first to get node ids.

spec = the vi_create spec plus: "remove": ["increment_4", ...] vi_dump node ids to delete, with their wires "existing": {spec name: what} objects already in the VI that the spec refers to: "Gain" a front-panel control/indicator by label {"node": "multiply_7"} a vi_dump node (function, subVI, constant, loop, case) {"node": "for_loop_3", "functions": [...], ...} new code inside an existing loop {"node": "case_structure_5", "cases": {"1": {...}}} new code inside case frame 1 {"node": "for_loop_3", "shift_registers": ["acc"], ...} new shift registers on a loop (wire "acc.left" / "acc.right" like in vi_create) {"node": "case_structure_5", "remove_cases": [2], "add_cases": [{"value": 5, "outputs": {"tunnel_9": "five"}, ...contents}, {"value": "7..9", "default": true}]} remove frames (by index) and add frames (value, range or string as the selector takes); "outputs" gives the new frame's value for existing output tunnels (vi_dump tunnel ids) "move": {"for_loop_3": [300, 200]} move block-diagram objects "rename": {"Gain": "Gain (dB)"} relabel front-panel controls/indicators "values": {"Gain": 2.5, "constant_6": 10} a control's default value (by label) or a constant's value (vi_dump id) "retype": {"Count": "i32", "constant_6": "u8"} change a number's type (control or constant) "disconnect": ["out_12", "multiply_7.x"] cut the wire into these vi_dump wire ends (a wire's other branches stay); then wire a new source in "wires": {"disconnect": ["x2_5"], "existing": {"a": {"node": "add_8"}, "o": "x2"}, "wires": [["a.x+y", "o"]]} Existing nodes are wired like new ones ("m.x", "L.i", "C.selector"). Code put in a case frame may only be wired to code in that frame and to existing objects; crossing the border makes a tunnel. Example, replace out = x + 1 with out = x * 3: {"remove": ["increment_4"], "existing": {"x": "x", "o": "out"}, "constants": [{"name": "k", "type": "dbl", "value": 3}], "functions": [{"name": "m", "function": "Multiply"}], "wires": [["x", "m.x"], ["k", "m.y"], ["m.x*y", "o"]]} An input that is already wired cannot take a second source (remove its node first). New controls stay off the connector pane unless they set "connector". rewire=true deletes with LabVIEW's Quick Drop "Remove and Rewire" (joins loose ends of matching type) instead. A copy is saved to .lvmcp-backup/ next to the VI first (backup=false skips it). If the edit leaves the VI broken, or a requested wire could not be made, the VI is reverted and not saved (allow_broken=true saves a broken result anyway).

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": {
      "path": "<path>",
      "spec": "<spec>"
    },
    "name": "vi_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
specYes
backupNo
rewireNo
allow_brokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.40.1

TDQS

A4.6/5.0
Behavior5/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 thoroughly: it discloses the automatic backup to .lvmcp-backup/ (and backup=false), revert-on-broken-or-unwired behavior, allow_broken, the Quick Drop 'Remove and Rewire' semantics of rewire, the constraint that a wired input cannot take a second source, connector-pane defaulting, and case-frame wiring restrictions.

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?

Purpose and the vi_dump prerequisite are front-loaded, and the dense spec-key listing is organized and example-driven rather than padded. It is long, but the length reflects genuine complexity; only the inline pseudo-JSON could be tightened.

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

Completeness5/5

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

For a highly complex mutation tool with no annotations and no output schema, the description covers inputs, failure behavior, backup, and a worked before/after rewrite example. An agent could construct a valid call from this text alone.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it documents the spec keys (remove, existing, move, rename, values, retype, disconnect) in detail with examples, plus the effect of backup, rewire, and allow_broken. The 'path' parameter is never explained beyond being required, leaving one small gap.

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

Purpose5/5

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

The first sentence names a specific verb and resource ('Change an existing VI') plus concrete scope: remove nodes, add code, wire to existing objects, including inside loops and case frames. It distinguishes itself from vi_create by explicitly building on the vi_create spec, and the 'layout keeps its layout' clause separates it from a rebuild.

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

Usage Guidelines4/5

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

It gives a concrete prerequisite workflow ('Call vi_dump first to get node ids') and ties the spec to vi_create's spec, so the agent knows the relationship to the sibling. It does not explicitly state when to prefer vi_edit over vi_create or vi_text, so it falls short of full when/when-not routing.

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