Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

measure_amplitude

Measure signal amplitude on PicoScope oscilloscope channels. Use after capture to obtain voltage measurements like peak-to-peak, RMS, or mean values.

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 @mcp.tool()-decorated measure_amplitude function that defines and implements the tool's execution logic, including input validation via type hints and stubbed measurement handling.
    @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,
            }
  • Registration of all tool groups by calling register_analysis_tools(mcp) which in turn registers the measure_amplitude tool via its decorator.
    register_discovery_tools(mcp)
    register_configuration_tools(mcp)
    register_acquisition_tools(mcp)
    register_analysis_tools(mcp)
    register_advanced_tools(mcp)
  • Import of register_analysis_tools function required for tool registration.
    from .tools.analysis import register_analysis_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/markuskreitzer/picoscope_mcp'

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