Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Dsp Correlate

dsp_correlate

Analyze one or two time-domain records for statistics, autocorrelation, dominant period, and cross-correlation with lag and delay estimates; optionally compute Hilbert envelopes from JSON or CSV data.

Instructions

Time-domain analysis of one record and optionally a second. One record: mean, RMS, peak, peak-to-peak, crest factor, variance, autocorrelation up to max_lag (CSV) and the dominant period from it. With a second record (samples_b / samples_b_file): cross-correlation, the lag of the maximum in samples and seconds with parabolic sub-sample refinement, the normalised correlation coefficient and the delay estimate (positive = second record lags the first). envelope=true adds the FFT Hilbert envelope (exact for records holding whole periods). Samples: JSON lists or CSV files; sample_rate with unit for seconds.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "dsp_correlate"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_lagNoLargest lag in samples, 1..100000; 0 = automatic (half the record, at most 100000; cross-correlation: the full overlap range)
samplesNoFirst record as JSON text, e.g. '[0, 1, 0, -1]' (at most 4194304). Or samples_file
envelopeNoAlso compute the Hilbert-transform envelope of the first record (CSV) (default false)
samples_bNoOptional second record as JSON text, for cross-correlation
remove_meanNoRemove each record's mean before correlating (default true)
sample_rateNoSample rate with unit, e.g. '1 kHz'; gives lags and periods in seconds (optional with a time column)
samples_fileNoFirst record as CSV/TXT file: values, or time(s),value
samples_b_fileNoOptional second record as CSV/TXT file

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.7/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and does reasonably well: it discloses the sign convention ('positive = second record lags the first'), the sub-sample refinement method, and a real caveat ('exact for records holding whole periods'). It omits limits on input size, failure modes, and whether computation is bounded in time, which keeps it below a 5.

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?

A dense but well-ordered paragraph: the scope statement is front-loaded, then the single-record path, then the two-record path, then the shared input/sampling conventions. Almost every clause carries information, though the metric enumeration is long enough to make the description slightly heavy for a single paragraph.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

All eight parameters are documented in the schema and an output schema exists, so return values need not be explained — yet the description still spends effort on output semantics. Combined with the disclosed lag sign convention and envelope caveat, an agent has what it needs to call this correctly; only edge-case limits and error behavior are absent.

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?

Schema coverage is 100%, so the baseline is 3. The description adds modest meaning beyond the schema — max_lag's role in autocorrelation, envelope's effect on the first record, and sample_rate's unit-driven conversion to seconds — but most of this is already restated in the parameter descriptions, so the added value is marginal.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Time-domain analysis of one record and optionally a second') and then enumerates the concrete metrics produced (mean, RMS, peak, crest factor, autocorrelation, cross-correlation). The 'time-domain' framing implicitly distinguishes it from frequency-domain siblings, but no sibling is named explicitly, so it stops short of a 5.

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

Usage Guidelines3/5

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

It clearly branches on input shape — 'One record:' versus 'With a second record (samples_b / samples_b_file):' — which tells the agent which parameters select which analysis. However, there is no guidance on when to choose this tool over a spectral or filtering alternative, and no exclusions or prerequisites are stated, so usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools