ltspice-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| configure_sweepA | Configure a multi-parameter sweep for a netlist and return a config_id for later execution. Dimensions combine as a full cross-product, so this also covers deterministic worst-case corner analysis (give each component a two-value [low, high] set — N parts yields 2^N corners that bound the true extremes, which random Monte Carlo cannot guarantee) and sensitivity analysis (sweep one part at a time across its tolerance to rank impact). Use configure_montecarlo instead for statistical yield/spread. NOT for a bias sweep: a native |
| run_sweepA | Execute a previously configured parameter sweep asynchronously and return a job_id immediately. |
| configure_montecarloA | Configure a Monte Carlo analysis with component tolerances and return a config_id for later execution. |
| run_montecarloA | Execute a previously configured Monte Carlo analysis asynchronously and return a job_id immediately. |
| batch_resultsA | Query a batch simulation job (sweep or Monte Carlo). Without signal: returns job status and progress. With signal: returns aggregate statistics or per-run data for that signal. |
| signal_statsA | Scalar summary of one signal in a .raw result. Use this when you need a single number per metric (average, RMS, peak, etc.) — not a waveform or a trend. Transient: time-weighted mean, RMS, std, abs-mean, and min/max/pk-pk using trapezoidal integration (RMS = sqrt(∫ y² dt / T)). This is correct on SPICE's adaptive timestep — simple np.mean(y) would overweight densely sampled regions. Optionally restrict to [t_start, t_end]; passing no window averages the whole waveform including any startup transient, which is usually wrong for RMS/mean. DC: returns min/max/pk-pk and the simple/abs mean over the swept axis, plus AC: returns magnitude (dB) min/max/mean and phase (deg) min/max. t_start/t_end are rejected for AC — use query_value for a point at a specific frequency. Noise: returns min/max/pk-pk of the noise spectral density over the frequency axis, plus Related tools: for rise/fall times use edge_metrics; for overshoot/settling use pulse_response; for period/duty use periodic_metrics; to aggregate .MEAS values across a sweep use measurement_stats. |
| get_waveformA | Decimated numeric egress FOR THE MODEL: returns a min/max-preserving stat-envelope of one real-valued signal as DATA in your context (numbers, not a picture) over a time/sweep/frequency window — for when a scalar isn't enough and you need the SHAPE (switching nodes, amplifier internal nodes, startup transients). Splits the window into equal-time buckets; each bucket reports the raw sample min/max (a narrow spike or ringing peak is never averaged away), time-weighted trapezoidal mean/rms (correct on SPICE's adaptive timestep), pk_pk, and crest_factor (peak/rms — high = impulsive/spiky). Scalar-guided zoom: read the envelope, then re-request a narrower [t_start, t_end] to resolve a region at higher resolution (same call, tighter window). The Works on transient (.tran), DC sweep (.dc), and noise (.noise) results. Sibling egress, don't confuse: export_waveform writes EVERY sample to a CSV FILE for your own code; plot_waveform renders an interactive PICTURE for a human to look at. For complex AC data use bode_metrics; for a single scalar use signal_stats; for one point value use query_value. |
| export_waveformA | Full-fidelity waveform egress: write every sample of one or more signals to a CSV file on disk and return its path — for when you want to compute on the raw data yourself (FFT, custom metrics, cross-correlation) rather than read a scalar or a decimated envelope. Lossless within the chosen window (no decimation — that is get_waveform's job). Works on transient (.tran), DC sweep (.dc), AC (.ac), and noise (.noise). Complex AC traces are written as magnitude(dB)+phase(deg) by default ( Returns the CSV path plus row/column counts; read the file with your own tools. Sibling egress, don't confuse: get_waveform returns a DECIMATED envelope as numbers in your context (no file); plot_waveform renders an interactive PICTURE for a human. For a single scalar use signal_stats/query_value. |
| query_valueA | Look up the value of a signal at a specific time point (transient) or frequency (AC). Returns the nearest data point without interpolation. To pick a step of a .step/.DC sweep by its axis VALUE (rather than a raw step index), pass To query a run of a completed sweep/MC job, pass This is one signal at one point ( If the run hit a run-level solve failure (singular matrix / non-convergence), that simulator line is relayed into |
| operating_pointA | Read DC operating point data: all node voltages, branch currents, and each semiconductor's small-signal params (gm/gds/vth/vdsat/caps) — from LTspice's log (run_simulation auto-adds '.options logopinfo' on .op runs) or ngspice's @dev[param] traces, surfaced uniformly by name. Each value carries its SI unit where the simulator declared the type (see A run-level solve failure (singular matrix / non-convergence) taints every value here; that simulator line is relayed into |
| simulation_summaryA | Get a comprehensive simulation summary including type, signal list, data size, .MEAS results, Fourier analysis, AC bandwidth metrics, and warnings. |
| edge_metricsA | Use when you need to quantify HOW FAST one transition happened: rise time, fall time, slew rate. Inputs a transient .raw plus a time window around the edge of interest. Returns: transition_time (10→90% by default, configurable via low_pct/high_pct), slew_rate (V/s or A/s), detected low/high levels, and the three crossing times. Levels are auto-estimated from the first/last 10% of the window — NOT global min/max — so overshoot/undershoot doesn't poison the level estimate. Crossings are sub-sample-accurate via linear interpolation. Rejects AC analysis. PICK THE WINDOW. If the transient has startup glitches or multiple edges, set t_start/t_end tightly around the edge you care about — otherwise you get the first edge in the full waveform, which is often the power-up artifact. Use edge_index only when multiple edges in the window are intentional. For settling/overshoot after the edge, use pulse_response. For delay between two signals' edges, use timing_between. |
| pulse_responseA | Use when you need step-response quality metrics: overshoot %, undershoot %, settling time, peak value and peak time. Inputs a transient .raw covering ONE step transition — ideally with the stimulus edge near t_start and enough tail to see settling. Returns: direction (rising/falling), initial/steady-state values, peak (absolute and pct), settling_time (to within settling_tolerance_pct band). settling_time is null in three cases, kept distinct in the text and quality flags: 'never (within window)', 'undefined (full-pulse window)', and 'unknown' when the trailing window is too noisy to trust the final value (still ringing) — pass final_value there. Definitions: overshoot is excursion BEYOND final in the step direction; undershoot is excursion beyond initial opposite the step direction. overshoot_pct = 0 means MEASURED overdamped, not missing data. settling_tolerance_pct defaults to 2% of |final - initial|; 1% and 5% are also common. If the auto-detected initial/final (mean of first/last 10% of window) is contaminated by ringing, pass explicit initial_value/final_value. Rejects AC analysis. For just rise/fall time without overshoot, use edge_metrics. |
| timing_betweenA | Use when you need propagation delay / skew between TWO signals — e.g. input-to-output delay, clock-to-Q, input-skew. Inputs one transient .raw containing both signals on a shared time axis. Returns: signed delay = t_b - t_a where t_a and t_b are the FIRST threshold crossings of signal_a and signal_b in the window. Negative delay means signal_b leads signal_a. Thresholds default to 50% of EACH signal's own min-max range in the window — intentional for asymmetric CMOS where V_in and V_out have different rails. Override per-signal via threshold_a / threshold_b if you need absolute thresholds (e.g. VIH/VIL at fixed voltages). Set direction_a / direction_b independently (e.g. rising input → falling output for an inverter). Picks only the FIRST crossing of each signal in the window — if both signals have multiple edges, tighten t_start/t_end around the specific edge pair you want. Rejects AC analysis. |
| periodic_metricsA | Use for an oscillating transient signal (clock, oscillator output, switching waveform) when you need period, frequency, duty cycle, pulse widths, and period-to-period jitter. Returns: period (mean across measured periods), frequency (1/period), jitter_rms (std-dev of period lengths — timing jitter, NOT signal amplitude variance), duty_cycle_pct, mean high/low pulse widths, edge counts. duty_cycle_pct / pulse_widths are null if no full periods could be paired. A period is the span between consecutive rising crossings, so num_periods_measured = num_rising_edges - 1 (you need N+1 edges to measure N periods). Uses threshold crossings; threshold defaults to the midpoint of window min/max. For a signal with DC drift, set an explicit threshold — the auto midpoint moves with the drift and the edge detection gets unstable. min_periods guards against accidentally running on 1-edge windows. Skip the startup transient via t_start/t_end; the first cycle is often wider than steady state. Rejects AC analysis. For a single edge (not periodic), use edge_metrics. |
| thdA | Total harmonic distortion (THD and THD+N) of a periodic transient signal via FFT — works on any .tran result without a |
| noise_integralA | Integrate a .noise spectral density to a total RMS noise over a band. SPICE stores amplitude density (V/√Hz or A/√Hz) for both LTspice and ngspice, so total = sqrt(∫ density² df) — the same value LTspice shows when you Ctrl-click a V(onoise) label. Reports the band actually integrated and the sample count. Noise figure / SNR are left to you (they need the source resistance and a reference level). |
| measurement_statsA | Use to AGGREGATE .MEAS scalar results across a .step sweep or Monte Carlo run. Answers questions like 'across 100 MC trials, what's the worst-case rise time?' or 'how does gain vary as R sweeps 1k..10k?'. Inputs the .log file produced by the run. Returns per-measurement: min, max, mean, median, std, p10, p90, min_step_index (argmin) and max_step_index (argmax), failure count, and an optional histogram (set histogram_bins=0 to skip). Accepts any job id: a sweep/MC batch aggregates across its runs; a single-simulation job aggregates its own log (one value per step for a .step run). WHEN-style .MEAS (constant level, varying crossing) is detected the same way on both paths and swaps to aggregating the 'at' (crossing) field; the aggregated_field output says which was used. On a plain single run, stats collapse to n=1 (one value per measurement): the headline stats are the value the simulator printed — for a WHEN that's the trigger level — and any AT/crossing time is returned separately in the entry's 'at' field, so a single-run WHEN/AT read isn't lost. (simulation_summary also just reads the raw scalars.) Works with .MEAS from any analysis type (.tran/.ac/.dc/.op) — the measurement directives themselves embed the analysis context. Pass measurement=NAME to aggregate just one; otherwise returns all .MEAS in the log. |
| stability_metricsA | Find EVERY unity-gain and -180° phase crossover in a loop-gain AC sweep, report phase margin at each unity-gain crossing and gain margin at each -180° crossing. Replaces the single-crossing approximation in simulation_summary, which returns wrong margins on conditionally-stable systems. Run this on a LOOP-GAIN signal (typically a dedicated middlebrook probe or .AC of the open loop). Running on a closed-loop output gives meaningless margins — if the DC phase starts near ±180° (a closed-loop / inverting output rather than a loop probe, which starts near 0°), a warning says so in Returns: dc_gain_db, high_freq_gain_db, stability classification (stable / unstable / conditional / unconditional / always_below_unity), all crossings, per-crossing margins, and the worst-case values. Nuances:
For -3 dB filter cutoffs use bode_metrics(mode='filter'); for custom crossings use bode_metrics(mode='crossing'). |
| bode_metricsA | AC / Bode-plot analysis in one tool, selected by Pass To analyze a run of a completed sweep/MC job, pass For loop-gain stability margins use stability_metrics; for resonant peaks & Q use resonance. |
| resonanceA | Detect magnitude peaks in an AC sweep and estimate Q factor + -3 dB bandwidth for each. Useful for RLC resonators, crystal oscillators, peaking amps, or any response with distinct resonant modes. Q = f_peak / Δf(-3 dB from peak). Q is returned as null for peaks without two flanking -3 dB crossings inside the swept range — widen the sweep if you need Q for a boundary peak.
For overall filter characterization use bode_metrics(mode='filter'); for stability margins use stability_metrics. |
| ac_structureA | Read the pole/zero STRUCTURE of an .AC response — net order, corner frequencies (as ranges) with Q, out-of-phase zeros, and transport delay — to support design reasoning (where the poles/zeros roughly are, damping, out-of-phase zeros). It first tries a rational fit and uses its poles/zeros when the fit is clean; otherwise it falls back to asymptotic Bode reading (slope breakpoints + joint gain-phase + group delay + a gain-phase consistency residual). Returns FACTS, not a verdict — bring your own control/design knowledge. The most design-critical fact is the non_minimum_phase flag: an out-of-phase zero or a transport delay adds phase lag the magnitude plot cannot show, and caps achievable loop bandwidth; do not close a loop on magnitude alone when it is flagged. IMPORTANT — these are read from a finite sweep, so HAVE A HUMAN REVIEW them against the Bode plot (use plot_waveform on the same signal) and the circuit before acting. Closely-spaced corners merge into one range ( |
| plot_waveformA | Render an INTERACTIVE chart of one or more signals FOR A HUMAN to look at (zoom/pan/hover) — the co-design complement to the numeric tools. It returns NO data values to the model; it produces a picture. Picks the chart from the run type: transient (V/I vs time), DC sweep, AC Bode (stacked magnitude-dB + phase-deg vs log frequency), noise (vs log frequency); a .step / Monte-Carlo run overlays every step as a labelled trace (or pass Sibling egress, don't confuse: for numbers in your context use get_waveform (decimated); for every sample on disk use export_waveform (CSV); for a scalar use signal_stats/bode_metrics. This tool is for looking, not measuring. |
| create_netlistA | Create a new SPICE netlist file from content string. Automatically appends .END if missing. |
| read_circuitA | Read and parse a circuit file (.cir/.net or .asc). For netlists: returns content and component values. For schematics: returns layout and directives. |
| list_componentsA | List components in a circuit file, optionally filtered by type prefix, or return a single component value by reference. |
| set_component_valueA | Set component value(s) in a circuit file (single or batch mode), or rewrite one component's node connectivity ('nodes', single mode, .cir/.net only). A no-op value write is reported as unchanged. |
| parameterA | Read, write, or delete .PARAM directive values in a circuit file. Pass |
| edit_directiveA | Add or remove a SPICE directive or .asc free-text comment. Set |
| add_componentA | Add a new component to an .asc schematic at a specified grid position. |
| export_netlistA | Export an .asc schematic to a SPICE netlist (.net) using LTspice. |
| reset_schematicA | Revert an .asc schematic to the state it had BEFORE the first edit this session — a recovery escape hatch for when a sequence of edits went wrong. The server snapshots each .asc file's bytes just before its first in-session mutation (add_component, set_component_value, move_component, connect, apply_schematic_ops, etc.); this restores that snapshot exactly and drops it (so a later edit establishes a fresh restore point). Because add_component is a trigger, the first add_component on a freshly created schematic snapshots the empty file — so reset can revert all the way back to the empty post-create state, dropping every component added this session. Returns reverted=false (not an error) when the file has no recorded in-session edits. Note: the snapshot lives only for the current server session — it does not persist across restarts, and it is not a substitute for version control. |
| symbol_infoA | Get symbol pin positions, bounding box, and description. Optionally compute absolute positions for a given placement and rotation. |
| component_infoA | Get a placed component's pin positions, bounding box, value, and attributes from an .asc schematic. |
| connectA | Connect two component pins with wire(s). Resolves pin positions automatically. Waypoints define the wire route through intermediate points. For a straight horizontal or vertical connection, waypoints can be omitted. |
| create_schematicA | Create an empty .asc schematic ready for incremental editing via add_component / connect / add_net_label. Tip: prefer |
| trace_netA | Report everything electrically connected to a net: starting from a pin ('Ref.Pin'), a net label ('net:NAME'), or an (x,y) coordinate, return the net's labels and every component pin, FLAG, and wire vertex on it. Follows both wires (segment-aware — catches labels placed mid-wire) and same-name FLAGs (LTspice's name-based nets). Use it to answer 'what's on net X', to confirm a connect landed, or to spot an accidental short (a net carrying two different non-ground labels). |
| validate_netlistA | Lint a netlist or schematic before simulation — the static circuit check gate. Catches: empty/whitespace-only netlist files, element arity (too few nodes, missing E/G/F/H/B value), dangling nodes in .cir/.net netlists (a node touching only one element terminal — warning, since deliberate fragments are legal), bias-topology degeneracies in .cir/.net netlists (a net with no DC path to ground — floating MOSFET gate, capacitive island, current-source-only node, or isolated domain — warning, since the operating point may still be defined by other means), duplicate/multiple analysis directives ('More than one analysis specified'), .MEAS whose analysis kind isn't present, known-bad .MEAS patterns (vdb()/phase()/group_delay()), and directives the LTspice runner is known to reject (set target_simulator='ngspice' to instead flag ngspice-only incompatibilities, e.g. a zero '.tran' step time). On .asc, also surfaces named-net shorts, floating pins, and dangling labels. Returns a structured issue list; an empty list means the file passes the static gate. Note: value tokens (e.g. a typo'd '1kk') and undefined model references are NOT checked — LTspice coerces or resolves those at run time. |
| diff_circuitA | Structural diff between two circuit files: reports added/removed components, components whose value or attributes (Value2/SpiceLine/SpiceModel) changed, and added/removed .PARAM/.MEAS/.MODEL directives. Use after |
| apply_schematic_opsA | Apply many .asc edits in one transaction. Loads the schematic once, runs each op against the in-memory editor in order, and saves once at the end. Cuts the typical 25+ tool calls to build a real circuit (add_component × N + connect × N + add_net_label × N + edit_directive × N) down to a single round-trip. This is also the home for the ack-only schematic mutations that have no standalone tool — they return no geometry to act on, so they live here rather than each costing a separate tool slot. Supported ops (each tagged via the By default, the first op that raises aborts the whole transaction and nothing is written to disk. Set |
| find_modelA | Find model/subcircuit candidates across loaded (and optionally built-in) libraries. Default is fuzzy matching — finds typos, case variants, and near-neighbour part numbers (e.g., '2N3905' → '2N3904'); pass exact=true to only return the exact case-insensitive match. Returns ranked candidates with similarity score and an |
| load_libraryA | Load a SPICE library file (.lib, .mod) or directory of library files into the session. |
| unload_libraryA | Unload a previously loaded library from the session. |
| list_librariesD | List loaded libraries. With detail=true, also shows the .SUBCKT and .MODEL names defined in each library (so foundry .bjt/.mod files with hundreds of .MODEL cards are discoverable without guessing), and names encrypted vendor files whose bodies can't be parsed. |
| run_simulationA | Run a SPICE simulation on a netlist file. Sets the right batch flags, handles the ngspice headerless-raw dialect, routes the raw/log artifacts, and parses the results — so you never hand-parse a rawfile. Automatically runs synchronously for short simulations (<=30s timeout) or asynchronously for longer ones. Use wait=true to force synchronous execution. Returns raw/log file paths and simulation summary on completion, or a job ID for async tracking. |
| check_jobA | Check status of a simulation job by ID, or list all jobs. Without job_id: lists active jobs (filter with status param). With job_id: returns detailed status or completion results. |
| cancel_jobA | Cancel a running simulation job (single run, or a sweep/Monte-Carlo batch). Kills the simulator process(es) and marks the job as cancelled. |
| server_statusA | Get comprehensive server status including detected simulators, configuration settings, security sandbox paths, and runtime state. Use this to check what capabilities are available before attempting operations. |
| recentA | Call on session start to find circuits the user was last working with, including jobs that were still running when the server stopped. Needs no inputs. Returns a list of recent circuits, each with its absolute path, whether the file still exists, last-touched timestamp, total persisted job count, status_counts (completed/failed/interrupted/etc.), and the IDs of any interrupted jobs. 'interrupted' means a simulation was in flight when the server stopped — recovery path is check_job(job_id) to see whether results are recoverable or the run needs to be re-kicked. Does NOT start or cancel anything; purely read-only. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| characterize_filter | Run an AC analysis of an existing filter circuit and report its cutoff, passband gain, Q, and roll-off, with a Bode plot. |
| run_and_plot | Run a transient simulation of a circuit and plot a signal. |
| step_response | Drive a step input, measure rise time / overshoot / settling, and plot it. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| netlists | List of netlist files in the working directory |
| results | List of all simulation jobs and their status |
| models | User-loaded SPICE model libraries and their models |
| config | Server configuration and detected simulators |
| plot_widget | Interactive chart renderer (MCP Apps / SEP-1865). plot_waveform references this via _meta.ui.resourceUri; an apps-capable host fetches it and renders the chart inline. |
| recent | Recently-edited circuit files with persisted-job summary counts. Surfaces work from prior sessions, including interrupted jobs. |
| guide | SPICE authoring & schematic guide (LTspice + ngspice): syntax, value notation (M=milli), waveform sources, .meas, behavioral sources, convergence, per-engine specifics with an LTspice-vs-ngspice differences table, and the schematic-layout playbook (wiring, tiers, mirror/diff-pair orientations). |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ossenna-hq/MCP_LTSpice'
If you have feedback or need assistance with the MCP directory API, please join our Discord server