Skip to main content
Glama

edit_directive

Add or remove SPICE directives and schematic comments in LTspice circuit files. Supports exact or regex matching for deletion.

Instructions

Add or remove a SPICE directive or .asc free-text comment. Set kind=comment for annotation text; default is a SPICE directive. Works on .cir/.net and .asc; kind=comment is .asc-only. remove matches against directives AND comments, so callers can delete either kind without knowing which it is.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to circuit file (.cir, .net, or .asc)
actionYesWhether to add or remove the directive
instructionYesSPICE directive text (e.g., '.tran 10m', '.ac dec 100 1 1G'). For ``kind='comment'`` this is the comment text instead. For remove: literal exact match by default — copy the line verbatim from ``read_circuit``. Pass ``regex:<pattern>`` to use a regex (matches against directives AND comments). Raises an error when nothing matched, so a typo can't silently leave the directive in place.
kindNo``directive`` (default) — emit a SPICE directive line. ``comment`` — emit a free-text annotation. .asc-only; the tool refuses ``kind='comment'`` on .cir/.net since plain netlists already accept ``*`` / ``;`` comments inline.directive
xNoOptional X coordinate when adding to an .asc schematic. Default: directives are auto-placed in free space near the schematic's lower-left; comments default to the sheet origin (0,0).
yNoOptional Y coordinate (see ``x``).
sizeNoFont size (.asc only). 1=small, 2=normal (default), 3=large.
Behavior3/5

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

The description discloses that the tool modifies files (add/remove) and specifies constraints like .asc-only for comments and remove behavior. However, with annotations providing no safety hints (all false), the description could add more about idempotency or side effects.

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

Conciseness5/5

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

The description is concise at three sentences, front-loaded with the main action, and contains no unnecessary words or repetition.

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?

Given the tool has 7 parameters (3 required) and no output schema, the description covers the essential high-level behavior and constraints. The schema fills in parameter details, making the overall definition adequately complete for an LLM agent.

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 description coverage is 100%, so baseline is 3. The description adds little beyond the schema: it reiterates default kind and remove matching behavior, but does not provide new semantics for parameters not already covered in the schema descriptions.

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 description clearly states the tool adds or removes a SPICE directive or .asc free-text comment, with specific verbs and resources, distinguishing it from sibling tools that deal with components or other schematic elements.

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?

The description provides useful context on when to use the tool, such as file type restrictions (.cir/.net vs .asc) and behavior differences for 'remove' action (matches both directives and comments). However, it does not explicitly compare with alternatives or state when not to use it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cognitohazard/ltspice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server