Skip to main content
Glama

signal_stats

Read-onlyIdempotent

Compute scalar summaries like average, RMS, and peak values for a signal from an LTspice simulation. Supports transient, DC, AC, and noise analyses with time windowing for accurate results.

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 LTspice'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 and the simple/abs mean of the noise spectral density over the frequency axis, plus freq_start_used/freq_end_used. RMS/std/duration are omitted; 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
raw_fileYesPath to .raw result file from simulation
signalYesSignal/trace name (e.g., 'V(out)', 'I(R1)').
stepNoStep index for .step directives
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).
t_endNoWindow end in SPICE notation. Transient only; rejected for AC.
formatNoResponse format: 'json' for structured data, 'text' for human-readable

Output Schema

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

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

The description adds significant behavioral context beyond annotations: it explains transient integration method, why np.mean is wrong, details for DC/AC/Noise analyses, and which parameters are rejected for which types. No contradiction with annotations.

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?

The description is structured with a summary followed by per-analysis sections, front-loading the purpose. While somewhat lengthy, the detail is justified by the complexity of four analysis types. No wasted sentences.

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 the complexity (four analysis types), full schema coverage, and presence of an output schema, the description covers all necessary aspects: what each analysis returns, parameter validity, and integration details. It is complete and reduces ambiguity.

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 baseline is 3. The description adds extra semantic value by explaining how parameters like t_start/t_end behave differently depending on analysis type (e.g., rejected for AC), which goes beyond schema definitions.

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?

The description clearly states the tool provides a 'scalar summary of one signal in a .raw result' and distinguishes it from sibling tools by mentioning specific use cases (single number per metric vs waveform/trend) and listing alternative tools for other metrics.

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?

The description explicitly says when to use this tool ('when you need a single number per metric') and provides a list of related tools with their purposes, giving clear guidance on alternatives.

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/Cognitohazard/ltspice-mcp'

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