Skip to main content
Glama
ossenna-hq

ltspice-mcp

by ossenna-hq

periodic_metrics

Read-onlyIdempotent

Measure period, frequency, duty cycle, pulse widths, and jitter from oscillating transient signals in LTspice simulations. Set a threshold and time window to ignore startup transients for accurate periodic metrics.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepNoStep index for .step sweeps
t_endNoWindow end in SPICE notation
formatNo'json' or 'text'
job_idNoAnalyze a specific run of a completed sweep/MC (or single) job instead of a raw_file path; pair with ``run_index``.
signalYesSignal name (e.g. 'V(clk)')
t_startNoWindow start — recommended to skip the startup transient.
raw_fileNoPath to .raw transient 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).
thresholdNoAbsolute threshold level. Auto = midpoint of window min/max. For drifting signals, set explicitly.
min_periodsNoMinimum complete periods required; error if window has fewer.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYes
signalYes
warningsYes
frequencyYes
jitter_rmsYes
duty_cycle_pctNo
threshold_usedYes
pulse_width_lowNo
num_rising_edgesYes
pulse_width_highNo
num_falling_edgesYes
num_periods_measuredYes
Behavior4/5

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

Beyond readOnlyHint and destructiveHint, the description discloses key behaviors: edge-detection mechanism (threshold crossings), definition of a period (span between consecutive rising crossings), the formula num_periods_measured = num_rising_edges - 1, null duty_cycle/pulse_widths when no full periods, and instability with DC drift. 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with clear paragraphs covering use case, returns, measurement mechanics, threshold behavior, and usage tips. Every sentence adds useful information—no fluff. It is front-loaded with the primary use case. Though a bit longer, it's density of useful info justifies the length.

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 tool's complexity (10 parameters, subtle jitter semantics), the description covers return values, null cases, threshold behavior, edge count relationship, and output schema exists for further details. It is complete for an agent to decide when to use it and how to set parameters correctly. No gaps for an oscilloscope-style periodic measurement tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage (all parameters have descriptions), so the baseline is 3. The tool description adds context on threshold, min_periods, and t_start/t_end usage, but the parameter descriptions already cover semantics. Edge cases like null returns are explained in the tool description, but not much additional parameter-level detail is added.

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 analyzes oscillating transient signals (clock, oscillator output, switching waveform) and lists the metrics returned: period, frequency, duty cycle, pulse widths, and jitter. It distinguishes from sibling edge_metrics by noting 'for a single edge (not periodic), use edge_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?

Provides explicit guidance: when to use (oscillating transient signals), how to set threshold for DC drift, use min_periods to guard against 1-edge windows, skip startup transient via t_start/t_end, and explicitly directs to edge_metrics for single-edge cases. This clearly differentiates from 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/ossenna-hq/MCP_LTSpice'

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