Skip to main content
Glama

periodic_metrics

Read-onlyIdempotent

Extract period, frequency, duty cycle, pulse widths, and jitter from oscillating transient signals in LTspice simulations. Configure threshold and time window to skip startup transients.

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.

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
raw_fileYesPath to .raw transient result file
signalYesSignal name (e.g. 'V(clk)')
stepNoStep index for .step sweeps
t_startNoWindow start — recommended to skip the startup transient.
t_endNoWindow end in SPICE notation
thresholdNoAbsolute threshold level. Auto = midpoint of window min/max. For drifting signals, set explicitly.
min_periodsNoMinimum complete periods required; error if window has fewer.
formatNo'json' or 'text'

Output Schema

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

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

Annotations already indicate readOnlyHint, destructiveHint, idempotentHint. The description adds crucial behavioral context: threshold crossing algorithm, auto midpoint behavior, rejection of AC analysis, and conditions for null duty_cycle_pct. 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 clear sections. Each sentence adds value, though slightly verbose. No redundancy with schema or annotations.

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 8 parameters, output schema exists, and complexity of periodic measurements, the description covers purpose, usage, edge cases, and behavioral details comprehensively. No gaps identified.

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 practical meaning beyond schema: e.g., threshold auto = midpoint, min_periods guards against 1-edge windows, t_start/t_end intended to skip startup transient. Adds moderate value.

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 is for oscillating transient signals to extract period, frequency, duty cycle, pulse widths, and jitter. It explicitly differentiates from the sibling tool edge_metrics ('For a single edge... 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 when-to-use (periodic signals) and when-not (single edge), along with practical tips like skipping startup transient via t_start/t_end, setting explicit threshold for DC drift, and using min_periods to avoid insufficient data.

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