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
| Name | Required | Description | Default |
|---|---|---|---|
| operation | No | add | |
| channel_a | No | A | |
| channel_b | No | B |
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, }
- src/picoscope_mcp/server.py:9-19 (registration)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)
- src/picoscope_mcp/tools/advanced.py:6-110 (registration)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}