thd
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-mcpOther tools in Ltspice MCP (39)
Pole/zero structure of an AC response: net order, corner ranges + Q, non-minimum-phase / RHP-zero, transport delay (facts for human review)
41
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
AC/Bode analysis by mode: filter, slope, point, crossing; allsteps=true for per-step results
Cancel a running simulation or batch; kills the simulator process(es)
Check a job's status by ID, or list all jobs
Placed component pin positions, bounding box, attributes
Configure a multi-parameter sweep (linear or log)
Create a new netlist from a content string
Create an empty .asc ready for incremental editing
Structural diff between two circuit files
Rise/fall time and slew rate for one transient edge
Add or remove SPICE directives (.tran, .ac, .lib, ...)
Export .asc to .net via LTspice (with diff against previous export)
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
Decimated min/max stat-envelope of a signal over a window — see the shape, then re-request a narrower window to zoom
List components (optional prefix filter) or look up one by reference
Aggregate .MEAS scalars across a sweep or Monte Carlo run
Integrate a .noise spectral density to total RMS over a band (sqrt(∫ density² df)); reports the band and sample count
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
Read all .PARAM values or set one
Period, frequency, duty cycle, jitter of an oscillating signal
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
Signal value at a specific time/frequency (or a device operating-point param, m1.gm/@m1[gm]); stepaxis+stepvalue picks a .step run
Read a circuit file (netlist text for .cir, schematic layout for .asc)
Revert an .asc to its pre-edit snapshot from this session
AC peaks with Q factor and -3 dB bandwidth per peak
Reflection coefficient Γ, return loss (dB), and VSWR from an impedance trace vs a reference z0 (worst-match scan or a single frequency)
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 one component value, or batch-set many via a values dict
Min, max, mean, RMS, peak-to-peak (dB/phase for AC)
Full summary: simulation type, signals, measurements, warnings
Loop-gain stability: all unity-gain / -180° crossings with per-crossing margins
Symbol pin positions, directions, bounding box, description
Propagation delay between two transient signals
Every pin/label/wire on a net at a pin / net:NAME / (x,y); flags accidental shorts
Transient response by mode: step overshoot/undershoot/settling, or disturbance droop/overshoot/recovery
Static pre-flight checks on a netlist or schematic before simulation
Wire two pins by reference with waypoint routing; validates pin collisions, junctions, diagonals (formerly connect, kept as a deprecated alias)