Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Spice Simulate

spice_simulate

Simulate a circuit with ngspice to get numeric results for operating point, DC sweep, AC frequency sweep, or transient analysis from a netlist.

Instructions

Simulate a circuit with ngspice and return numbers. Give the netlist as text ('netlist') or a file ('netlist_file'), choose 'analysis' op (DC operating point), dc (sweep one source), ac (small-signal frequency sweep) or tran (transient), and list 'outputs' such as 'v(out),i(v1)'. op returns every output as a value; sweeps return min/max/final of each output (ac: of the magnitude) and write the full table to result.csv. The first line of a netlist is its title. The netlist is parsed against an allow-list: .control, .include, .lib, .write, code models (A, N devices) and the like are refused; analyses come from these parameters, not from the netlist. ngspice must be installed (see toolkit_doctor). Current sign: i(v1) is positive into the + terminal, so a source driving a load shows a negative current.

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": {
      "analysis": "<analysis>"
    },
    "name": "spice_simulate"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepNodc: increment with unit ('0.1 V'); tran: output step and largest internal step ('10 us'); at most 100000 points
stopNodc: last value ('5 V'); ac: last frequency ('1 MHz'); tran: end time ('1 ms')
startNodc: first value with unit ('0 V'); ac: first frequency ('10 Hz'); tran: first time kept (default '0 s')
sweepNoac only: spacing 'dec' (default), 'oct' or 'lin'dec
pointsNoac only: points per decade/octave (e.g. 20), or the total number of points for sweep 'lin'
netlistNoThe netlist text (first line = title). Give this OR netlist_file.
outputsNoComma-separated, e.g. 'v(out),i(v1)': v(node) of a node, i(name) of a voltage source or inductor. Empty = every node voltage (at most 16 nodes).
analysisYesOne of: op, dc, ac, tran
netlist_fileNoPath to a netlist file (.cir .sp .spice .net .ckt .txt). Give this OR netlist.
sweep_sourceNodc only: the name of the voltage or current source to sweep, e.g. 'V1'
use_initial_conditionsNotran only: start from the .ic / ic= values instead of a DC operating point (SPICE 'uic')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.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 burden and does so well: it discloses the allow-list/refusal policy (.control, .include, .lib, .write, code models), that sweeps write a full table to result.csv, the return format per analysis type, the first-line-is-title convention, and the current sign convention for i(v1). These are exactly the behavioral traits an agent needs before invoking.

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?

Five dense sentences, all front-loaded with the core action first and constraints after; every clause carries information. It is slightly over-packed with distinct topics (inputs, analyses, outputs, safety policy, prerequisites, sign convention), but none is wasted.

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 an 11-parameter, mutation-free but filesystem-writing tool with no annotations and no output schema, the description covers inputs, valid analysis modes, output shape per mode, side effects (result.csv), and the external dependency. Nothing essential to calling it correctly is missing.

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 100%, so the baseline is 3, but the description adds genuine meaning: it expands the analysis enum values (op = DC operating point, dc = sweep one source, ac = small-signal magnitude sweep, tran = transient) and clarifies the outputs syntax with an example. It does not add unit/semantics detail beyond the schema for start/stop/step, so it is not a 5.

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 ('Simulate a circuit with ngspice and return numbers') and immediately distinguishes its role from a checker/measurement tool by detailing analyses, output selection, and result shape. An agent can tell what this tool produces without opening the 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 concrete usage conditions: supply the netlist either as text or file, pick one of op/dc/ac/tran, and note that analyses must come from parameters rather than the netlist. It also routes to toolkit_doctor for the ngspice prerequisite. It stops short of explicitly stating when to prefer spice_check_netlist or spice_measure, so it falls short of a 5.

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

Deploy Server

Other Tools