Skip to main content
Glama

Plecs Model Edit

plecs_model_edit
Destructive

Structurally edit .plecs schematic files by adding or removing components, setting parameters and orientations, and connecting terminals; use it when PLECS RPC cannot modify a schematic.

Instructions

Edit a .plecs file structurally (PLECS RPC cannot modify a schematic).

Operations (applied in order)::

{"op": "add_component", "type": "Resistor", "name": "R2",
 "position": [400, 200], "direction": "right", "flipped": "off",
 "parameters": {"R": "10"}}
{"op": "remove_component", "name": "R2"}
{"op": "set_parameter", "component": "R2", "variable": "R", "value": "22"}
{"op": "set_orientation", "component": "R2", "direction": "up", "flipped": "on"}
{"op": "set_position", "component": "R2", "position": [400, 240]}
{"op": "connect", "source": "V_dc", "source_terminal": 1,
 "target": "R2", "target_terminal": 1, "points": [[110, 200], [400, 200]]}
{"op": "add_outport", "name": "Vout", "position": [600, 200]}

direction is right/left/up/down and flipped is on/off: set them when the component is added (or use set_orientation later) so the terminal sides match the intended signal flow. Rotating a placed component invalidates explicit Points; drop them or re-run connect so PLECS re-routes.

In-place editing requires confirm=true, obeys the same write policy as other tools (allowed roots, no install dirs), and creates a .bak-<ms> backup; pass output to write elsewhere. validate loads the result in PLECS and rolls back the in-place edit if loading fails.

Input Schema

NameRequiredDescriptionDefault
pathYes
outputNo
confirmNo
validateNo
operationsYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare destructiveHint=true; the description adds the details that matter: confirm=true is mandatory for in-place edits, the write policy (allowed roots, no install dirs) applies, a .bak-<ms> backup is created, output redirects the write, and validate rolls back a failed load. It also warns that rotating a placed component invalidates explicit Points — a genuine behavioral gotcha not encoded anywhere in structured fields.

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 sentence is front-loaded, then the op catalogue, then the behavioral caveats in roughly priority order. The JSON examples are bulky but each op variant earns its space since the schema is untyped; a few (remove_component, set_position) could be compressed to one line each.

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 destructive, multi-op file mutation, the description covers the safety story (confirm, write policy, backup, rollback via validate), the operation vocabulary, and the terminal/orientation pitfall. An output schema exists, so return values need no explanation. Atomicity of a failing op list is the one unaddressed question, and it is minor.

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 carries the full burden, and it does: path (in-place target), output ("pass output to write elsewhere"), confirm (required for in-place), validate (loads result, rolls back on failure), and operations (seven worked op examples with field names and value formats). The only gap is that the op catalogue may not be exhaustive and there is no statement of failure/partial-application semantics for a bad op in the list.

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?

States a specific verb and resource ("Edit a .plecs file structurally") and immediately distinguishes itself from the RPC path in the same sentence ("PLECS RPC cannot modify a schematic"). An agent can tell this apart from plecs_set, plecs_rpc, and plecs_connect without opening any schema.

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?

Gives a clear selection rationale: use this when the change is structural/schematic, because RPC cannot modify a schematic. It also explains that validate re-loads in PLECS and that in-place editing needs confirm=true. It stops short of naming a specific sibling to use for the non-structural case, so it is not a full when/when-not/alternatives statement.

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