Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

configure_math_channel

Set up mathematical operations between oscilloscope channels to combine or compare signals for advanced analysis.

Instructions

Configure a math channel (channel operations).

Args: operation: Mathematical operation to perform. channel_a: First channel. channel_b: Second channel.

Returns: Dictionary containing math channel configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNoadd
channel_aNoA
channel_bNoB

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'configure_math_channel' MCP tool. Decorated with @mcp.tool(), which registers it and uses type hints for input schema.
    @mcp.tool()
    def configure_math_channel(
        operation: Literal["add", "subtract", "multiply"] = "add",
        channel_a: Literal["A", "B", "C", "D"] = "A",
        channel_b: Literal["A", "B", "C", "D"] = "B",
    ) -> dict[str, Any]:
        """Configure a math channel (channel operations).
    
        Args:
            operation: Mathematical operation to perform.
            channel_a: First channel.
            channel_b: Second channel.
    
        Returns:
            Dictionary containing math channel configuration.
        """
        # TODO: Implement math channel configuration
        return {
            "status": "not_implemented",
            "operation": operation,
            "channel_a": channel_a,
            "channel_b": channel_b,
        }
  • Imports register_advanced_tools and calls it on the MCP instance, thereby registering the advanced tools including 'configure_math_channel'.
    from .tools.advanced import register_advanced_tools
    
    # Create FastMCP server instance
    mcp = FastMCP("PicoScope MCP Server")
    
    # Register all tool categories
    register_discovery_tools(mcp)
    register_configuration_tools(mcp)
    register_acquisition_tools(mcp)
    register_analysis_tools(mcp)
    register_advanced_tools(mcp)
  • The registration function that defines all @mcp.tool() decorated functions for advanced tools, including 'configure_math_channel'. Called from server.py.
    def register_advanced_tools(mcp: Any) -> None:
        """Register advanced tools with the MCP server."""
    
        @mcp.tool()
        def set_signal_generator(
            waveform_type: Literal["sine", "square", "triangle", "dc", "ramp"] = "sine",
            frequency_hz: float = 1000.0,
            amplitude_mv: float = 1000.0,
            offset_mv: float = 0.0,
        ) -> dict[str, Any]:
            """Configure the built-in signal generator (AWG).
    
            Args:
                waveform_type: Type of waveform to generate.
                frequency_hz: Frequency in Hz.
                amplitude_mv: Peak-to-peak amplitude in millivolts.
                offset_mv: DC offset in millivolts.
    
            Returns:
                Dictionary containing signal generator status and configuration.
            """
            # TODO: Implement signal generator control
            return {
                "status": "not_implemented",
                "waveform": waveform_type,
                "frequency_hz": frequency_hz,
                "amplitude_mv": amplitude_mv,
                "offset_mv": offset_mv,
            }
    
        @mcp.tool()
        def stop_signal_generator() -> dict[str, Any]:
            """Stop the signal generator output.
    
            Returns:
                Dictionary containing status of signal generator.
            """
            # TODO: Implement signal generator stop
            return {"status": "not_implemented"}
    
        @mcp.tool()
        def configure_math_channel(
            operation: Literal["add", "subtract", "multiply"] = "add",
            channel_a: Literal["A", "B", "C", "D"] = "A",
            channel_b: Literal["A", "B", "C", "D"] = "B",
        ) -> dict[str, Any]:
            """Configure a math channel (channel operations).
    
            Args:
                operation: Mathematical operation to perform.
                channel_a: First channel.
                channel_b: Second channel.
    
            Returns:
                Dictionary containing math channel configuration.
            """
            # TODO: Implement math channel configuration
            return {
                "status": "not_implemented",
                "operation": operation,
                "channel_a": channel_a,
                "channel_b": channel_b,
            }
    
        @mcp.tool()
        def export_waveform(
            format: Literal["csv", "json", "numpy"] = "csv",
            channels: list[str] = ["A"],
            filename: str = "waveform",
        ) -> dict[str, Any]:
            """Export captured waveform data to file.
    
            Args:
                format: Export format (csv, json, or numpy).
                channels: List of channels to export.
                filename: Output filename (without extension).
    
            Returns:
                Dictionary containing export status and file path.
            """
            # TODO: Implement waveform export
            return {
                "status": "not_implemented",
                "format": format,
                "channels": channels,
                "filename": filename,
            }
    
        @mcp.tool()
        def configure_downsampling(
            mode: Literal["none", "aggregate", "decimate", "average"] = "none",
            ratio: int = 1,
        ) -> dict[str, Any]:
            """Configure downsampling for data acquisition.
    
            Args:
                mode: Downsampling mode.
                ratio: Downsampling ratio (1 = no downsampling).
    
            Returns:
                Dictionary containing downsampling configuration.
            """
            # TODO: Implement downsampling configuration
            return {"status": "not_implemented", "mode": mode, "ratio": ratio}
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool configures something but doesn't disclose whether this is a read/write operation, if it requires device connection, what permissions are needed, or side effects like affecting streaming. 'Configure' implies mutation, but behavioral details like idempotency, error handling, or system impact are missing.

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 well-structured with a purpose statement followed by Args and Returns sections. It's front-loaded and uses bullet-like formatting efficiently. However, the 'Returns' section is somewhat redundant given the output schema, and the purpose statement could be more concise by integrating parameter hints.

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?

Given 3 parameters with enums but 0% schema coverage, an output schema exists, and no annotations, the description provides basic purpose and parameter labels. It covers the core action but lacks context on when/why to use it, behavioral risks, or detailed parameter semantics. For a configuration tool with mutation implied, this is minimally adequate but has clear gaps.

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 description coverage is 0%, but the description lists parameters with brief labels ('Mathematical operation to perform', 'First channel', 'Second channel') that add basic meaning. However, it doesn't explain what 'channel' refers to (e.g., device channels), the enum values' significance, or how operations apply. With 3 parameters and no schema descriptions, this partially compensates but leaves gaps.

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 clearly states the tool's purpose as 'Configure a math channel (channel operations)' with specific verb ('configure') and resource ('math channel'), and mentions mathematical operations. It distinguishes from siblings like 'configure_channel' by specifying 'math channel' operations, though it doesn't explicitly contrast with 'configure_channel'.

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?

The description provides no guidance on when to use this tool versus alternatives like 'configure_channel' or other configuration tools. It mentions 'channel operations' but gives no context about prerequisites, timing, or exclusions. The agent must infer usage from the name and parameters alone.

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

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