Skip to main content
Glama
ossenna-hq

ltspice-mcp

by ossenna-hq

signal_stats

Read-onlyIdempotent

Compute scalar metrics (mean, RMS, peak, min/max) from LTspice/ngspice .raw signals. Supports transient, DC, AC, and noise with optional time or sweep windowing to avoid startup bias.

Instructions

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 sweep_start_used/sweep_end_used/sweep_span. RMS and std are deliberately omitted — they're meaningless on a non-time axis. Use t_start/t_end to restrict the sweep range.

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 freq_start_used/freq_end_used. Mean, RMS, std, and duration are omitted — a plain mean of spectral density is dominated by sample clustering and the sweep span, not the circuit; min/max is the useful worst-case reading. t_start/t_end are rejected — pass them via query_value at specific frequencies instead.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepNoStep index for .step directives
t_endNoWindow end in SPICE notation. Transient only; rejected for AC.
formatNoResponse format: 'json' for structured data, 'text' for human-readable
job_idNoAnalyze a specific run of a completed sweep/MC (or single) job instead of a raw_file path; pair with ``run_index``. Lets you summarize a sweep run the same way you'd summarize a standalone raw.
signalYesSignal/trace name (e.g., 'V(out)', 'I(R1)'), or a device operating-point shorthand for an ngspice .save'd parameter: 'm1.gm' / 'm1.vth' (resolves to '@m1[gm]', incl. subcircuit paths like 'x1.m1.gm').
t_startNoWindow start in SPICE notation (e.g. '1m', '100u'). Transient only. Strongly recommended when computing RMS or average — the startup transient otherwise biases the result. Rejected for AC analysis (time-windowing a frequency sweep is an error).
raw_fileNoPath to .raw result file. Pass this OR ``job_id`` (a job run), not both.
run_indexNo0-based run to analyze when ``job_id`` is given (default 0).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNo
minNo
rmsNo
stdNo
meanNo
max_dbNo
min_dbNo
signalNo
mean_dbNo
abs_meanNo
durationNo
warningsNo
max_phaseNo
min_phaseNo
sweep_spanNo
t_end_usedNo
point_countNo
peak_to_peakNo
t_start_usedNo
analysis_typeNo
freq_end_usedNo
sweep_end_usedNo
freq_start_usedNo
sweep_start_usedNo
Behavior5/5

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

Annotations already mark readOnlyHint=true, idempotentHint=true, destructiveHint=false, so safety profile is clear. Description adds deep behavioral context: explains integration method (trapezoidal), warns about startup transients biasing RMS/mean, discloses omitted metrics (RMS/std for DC, mean for Noise) and justifications, and notes correction of common mistakes (np.mean(y)). No contradictions.

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?

Well-structured with paragraph breaks per analysis type. Front-loaded with clear purpose. Some repetition (t_start/t_end rejected appears twice, 'use query_value' appears twice) and the list of related tools is long but valuable. Length is justified by complexity (4 analysis types) but could be tightened slightly.

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?

Given high complexity (4 analysis modes, nuanced statistical methods), the description covers all salient points: analysis-specific calculations, omissions, windowing, alternatives, and related tools. Output schema exists, so return values need not be described. For a summary tool with diverse modes, this is complete.

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 already provides extensive descriptions (100% coverage), and the description adds value by explaining semantics beyond schema: clarifies transient windowing, rejected parameters for AC/noise, and meaning of omitted metrics. As baseline 3 with high coverage, it reaches 4 for adding context like 'Strongly recommended when computing RMS' and 'passing no window averages the whole waveform including any startup transient'. Not 5 because schema already covers most parameter meanings.

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?

Description states it's a scalar summary of one signal in a .raw result and differentiates it from siblings by naming it for single-number-per-metric needs, not waveforms/trends. It explicitly lists related tools (edge_metrics, pulse_response, periodic_metrics, measurement_stats) for other use cases, providing strong sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use and when not: 'Use this when you need a single number per metric — not a waveform or a trend.' It also details analysis-type-specific behavior (Transient, DC, AC, Noise) and explains why restrictions apply (e.g., t_start/t_end rejected for AC). Mentions alternatives like query_value for specific frequencies and lists related tools for other metrics.

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/ossenna-hq/MCP_LTSpice'

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