Skip to main content
Glama

measure_amplitude

Measure signal amplitude on PicoScope channels to analyze voltage characteristics using peak-to-peak, RMS, mean, max, or min calculations after capturing data.

Instructions

Measure signal amplitude on a channel.

Note: This requires a recent capture. Call capture_block first.

Args: channel: Channel to measure. measurement_type: Type of amplitude measurement.

Returns: Dictionary containing amplitude in volts and measurement type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes
measurement_typeNopeak_to_peak

Implementation Reference

  • The core handler function for the 'measure_amplitude' tool. Decorated with @mcp.tool() for automatic registration and schema inference from type hints and docstring. Implements placeholder logic: checks device connection and channel configuration, returns guidance or error responses. Intended to compute amplitude types like peak-to-peak using imported utils.
    @mcp.tool() def measure_amplitude( channel: Literal["A", "B", "C", "D"], measurement_type: Literal["peak_to_peak", "rms", "mean", "max", "min"] = "peak_to_peak", ) -> dict[str, Any]: """Measure signal amplitude on a channel. Note: This requires a recent capture. Call capture_block first. Args: channel: Channel to measure. measurement_type: Type of amplitude measurement. Returns: Dictionary containing amplitude in volts and measurement type. """ try: if not device_manager.is_connected(): return { "status": "error", "error": "No device connected", } # Check if channel is configured if channel not in device_manager.channel_configs: return { "status": "error", "error": f"Channel {channel} not configured. Configure and capture first.", } # For now, we need to guide the user to capture data first return { "status": "info", "message": "To measure amplitude: 1) Configure channel, 2) Set trigger, 3) Capture block, then extract measurements from captured data", "channel": channel, "measurement_type": measurement_type, } except Exception as e: return { "status": "error", "error": str(e), "channel": channel, }
  • Invocation of register_analysis_tools(mcp) in the main server setup, which defines and registers the measure_amplitude tool along with other analysis tools.
    register_analysis_tools(mcp)
  • Helper function calculate_peak_to_peak imported in analysis.py for use in measure_amplitude (one of the measurement_type options), computes max - min from numpy array.
    def calculate_peak_to_peak(voltage_values: np.ndarray) -> float: """Calculate peak-to-peak voltage. Args:

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/markuskreitzer/picoscope_mcp'

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