Skip to main content
Glama

measurement_stats

Read-onlyIdempotent

Aggregate .MEAS results across sweep or Monte Carlo runs to compute min, max, mean, median, std, percentiles, and worst-case step indices from simulation logs.

Instructions

Use to AGGREGATE .MEAS scalar results across a .step sweep or Monte Carlo run. Answers questions like 'across 100 MC trials, what's the worst-case rise time?' or 'how does gain vary as R sweeps 1k..10k?'. Inputs the .log file produced by the run.

Returns per-measurement: min, max, mean, median, std, p10, p90, best_step_index (argmin) and worst_step_index (argmax), failure count, and an optional histogram (set histogram_bins=0 to skip).

Accepts any job id: a sweep/MC batch aggregates across its runs; a single-simulation job aggregates its own log (one value per step for a .step run). Axis choice differs by shape: a batch detects WHEN-style .MEAS (constant level, varying crossing) and swaps to aggregating the 'at' field; a stepped single-run log always aggregates the 'value' field. The aggregated_field output says which was used. On a plain single run there's only one value per measurement, so stats collapse to n=1 — use simulation_summary instead to just read the scalars.

Works with .MEAS from any analysis type (.tran/.ac/.dc/.op) — the measurement directives themselves embed the analysis context. Pass measurement=NAME to aggregate just one; otherwise returns all .MEAS in the log.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
log_fileNoPath to .log file from a single ``.step`` run that already concatenates every step's .MEAS results. For Monte Carlo / multi-run sweep jobs that emit one log per run, pass ``job_id`` instead and the aggregator walks every run's log.
job_idNoJob ID. For a batch job (``run_montecarlo`` / ``run_sweep``) the tool loads each completed run's log, concatenates the .MEAS results (one row per run), and aggregates. For a completed single-simulation job it aggregates that run's log (per-step values for a .step run). Mutually exclusive with ``log_file``.
measurementNoIf given, stats for only this .MEAS; otherwise all measurements.
histogram_binsNoHistogram bin count. Set to 0 to skip histogram computation.
formatNo'json' or 'text'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statsYes
Behavior5/5

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

The description adds behavioral details beyond annotations: what outputs are returned (min, max, mean, etc.), how axis choice works, and edge cases (single run with n=1). 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 front-loaded with the main purpose and is well-structured. However, it is somewhat verbose; minor tightening could improve conciseness.

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 rich input schema, annotations, and output schema, the description fully covers all behavioral nuances, edge cases, and alternatives. No gaps remain.

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 description coverage is 100%, so baseline is 3. The description adds significant extra meaning: explains the difference between log_file and job_id, clarifies the measurement parameter, and describes histogram_bins' effect.

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 verb 'aggregate' and resource '.MEAS scalar results', and distinguishes from sibling tools like simulation_summary by noting when to use each. Example questions ('worst-case rise time?') provide concrete context.

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?

Explicitly states when to use (aggregating across sweep or Monte Carlo) and when not to (use simulation_summary for plain single runs). Also explains axis choice and job type handling.

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