Skip to main content
Glama
hardware-tooling-mcp
by Pheem49

sigrok_capture_and_decode

Captures digital signal pulses from a logic analyzer and optionally decodes UART, I2C, SPI, or PWM protocols for signal analysis.

Instructions

Capture digital signal pulses from a Logic Analyzer and optionally decode protocols (UART, I2C, SPI, PWM).

Args: driver: Sigrok driver name (default 'fx2lafw' for 8-ch 24MHz logic analyzers, or 'demo' for testing). samplerate: Sample rate string (e.g. '1m' for 1MHz, '4m' for 4MHz, '24m' for 24MHz). samples: Number of samples to capture (e.g. 10000). Ignored if time_ms is set. time_ms: Capture duration in milliseconds (e.g. 500 for 500ms). Overrides samples if provided. channels: Optional channel selection (e.g. 'D0,D1' or 'D0=sda,D1=scl'). protocol_decoder: Optional sigrok protocol decoder specification (e.g. 'uart:baudrate=115200:rx=D0', 'i2c:scl=D0:sda=D1', 'spi:clk=D0:mosi=D1:miso=D2:cs=D3'). output_file: Optional file path to save raw capture (.sr format).

Input Schema

NameRequiredDescriptionDefault
driverNofx2lafw
samplesNo
time_msNo
channelsNo
samplerateNo1m
output_fileNo
protocol_decoderNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose one genuinely useful behavioral rule — 'samples ... Ignored if `time_ms` is set' and 'Overrides `samples` if provided' — which the schema cannot express. But it never mentions hardware prerequisites, whether the call blocks for the capture duration, exclusive device access, or that output_file writes to disk.

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 core purpose sentence is front-loaded and the Args block is ordered sensibly with the mutually exclusive samples/time_ms pair adjacent. It reads as a docstring lifted wholesale, repeating parameter names the schema already lists, but given 0% schema coverage that repetition is largely load-bearing rather than waste.

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

Completeness3/5

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

An output schema exists, so return values need not be described. For a 7-parameter hardware tool with zero annotations, however, the definition leaves out prerequisites (driver availability, prior device scan), expected capture latency, and error modes such as a busy or missing analyzer — all information an agent needs before invoking it.

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 0%, so the argument block is doing real work: it gives samplerate as a Sigrok-style string with concrete examples ('1m', '4m', '24m'), the driver default and its hardware meaning ('fx2lafw' for 8-ch 24MHz analyzers), channel syntax ('D0=sda,D1=scl'), and full protocol_decoder spec strings for uart/i2c/spi. This meaningfully exceeds the bare schema types. A point is withheld because decoder parameter vocabulary is only shown by example, not enumerated.

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: 'Capture digital signal pulses from a Logic Analyzer and optionally decode protocols (UART, I2C, SPI, PWM)'. That clearly separates it from the scan-only sibling sigrok_scan_devices and from the FTDI serial/I2C tools. It stops short of explicitly naming an alternative, but the capture-plus-decode scope is unmistakable.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says to run sigrok_scan_devices first, nothing states that sigrok-cli and a compatible driver must be installed, and nothing warns that the analyzer is exclusively held during capture. The only conditional logic given is argument precedence (time_ms overrides samples), which is parameter behavior, not tool-selection guidance.

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