MCPVault

thd

MCP tool from Ltspice MCP by Cognitohazard

Total harmonic distortion (THD/THD+N) of a periodic transient via FFT; coherent sampling for an exact result; surfaces every condition

How to use it

thd is exposed by the Ltspice MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the thd tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.

Install Ltspice MCP

$claude mcp add -s project ltspice -- ltspice-mcp
FULL LTSPICE MCP LISTING

Other tools in Ltspice MCP (39)

ac_structure

Pole/zero structure of an AC response: net order, corner ranges + Q, non-minimum-phase / RHP-zero, transport delay (facts for human review)

agentic

41

apply_schematic_ops

Apply many .asc edits in one transaction; its addcomponent op returns placed pins, bounding box, and overlap warnings, while other mutation ops are acknowledgement-only

bode_metrics

AC/Bode analysis by mode: filter, slope, point, crossing; allsteps=true for per-step results

cancel_job

Cancel a running simulation or batch; kills the simulator process(es)

check_job

Check a job's status by ID, or list all jobs

component_info

Placed component pin positions, bounding box, attributes

configure_sweep

Configure a multi-parameter sweep (linear or log)

create_netlist

Create a new netlist from a content string

create_schematic

Create an empty .asc ready for incremental editing

diff_circuit

Structural diff between two circuit files

edge_metrics

Rise/fall time and slew rate for one transient edge

edit_directive

Add or remove SPICE directives (.tran, .ac, .lib, ...)

export_netlist

Export .asc to .net via LTspice (with diff against previous export)

export_waveform

Full-fidelity CSV egress of one or more signals to disk (all analysis types; tidy/long for .step); accepts device operating-point params (m1.gm/@m1[gm]) — across a .dc sweep this is the gm/ID-table read; returns the path to compute on yourself

get_waveform

Decimated min/max stat-envelope of a signal over a window — see the shape, then re-request a narrower window to zoom

list_components

List components (optional prefix filter) or look up one by reference

measurement_stats

Aggregate .MEAS scalars across a sweep or Monte Carlo run

noise_integral

Integrate a .noise spectral density to total RMS over a band (sqrt(∫ density² df)); reports the band and sample count

operating_point

DC operating point: all node voltages, branch currents, and per-device operating-point params (gm/gds/vth/…) on LTspice (auto .options logopinfo) and ngspice, addressable as m1.gm/@m1[gm]; device= scopes to one device

parameter

Read all .PARAM values or set one

periodic_metrics

Period, frequency, duty cycle, jitter of an oscillating signal

plot_waveform

Interactive HTML chart (transient / DC / Bode dual-panel with acstructure corner + non-minimum-phase markers / noise / .step overlay) written next to the circuit and opened in your browser; for seeing shape, not measuring

query_value

Signal value at a specific time/frequency (or a device operating-point param, m1.gm/@m1[gm]); stepaxis+stepvalue picks a .step run

read_circuit

Read a circuit file (netlist text for .cir, schematic layout for .asc)

reset_schematic

Revert an .asc to its pre-edit snapshot from this session

resonance

AC peaks with Q factor and -3 dB bandwidth per peak

return_loss

Reflection coefficient Γ, return loss (dB), and VSWR from an impedance trace vs a reference z0 (worst-match scan or a single frequency)

run_simulation

Run a simulation — sync for short runs, async (job ID) for long ones; sets batch flags, handles the ngspice headerless-raw dialect, routes raw/log artifacts, surfaces convergence/timeout errors (no hand-parsing a rawfile)

set_component_value

Set one component value, or batch-set many via a values dict

signal_stats

Min, max, mean, RMS, peak-to-peak (dB/phase for AC)

simulation_summary

Full summary: simulation type, signals, measurements, warnings

stability_metrics

Loop-gain stability: all unity-gain / -180° crossings with per-crossing margins

symbol_info

Symbol pin positions, directions, bounding box, description

timing_between

Propagation delay between two transient signals

trace_net

Every pin/label/wire on a net at a pin / net:NAME / (x,y); flags accidental shorts

transient_response

Transient response by mode: step overshoot/undershoot/settling, or disturbance droop/overshoot/recovery

validate_netlist

Static pre-flight checks on a netlist or schematic before simulation

wire_pins

Wire two pins by reference with waypoint routing; validates pin collisions, junctions, diagonals (formerly connect, kept as a deprecated alias)