configure_math_channel
Set up mathematical operations between oscilloscope channels to perform addition, subtraction, or multiplication of signal data for enhanced waveform 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 |
|---|---|---|---|
| channel_a | No | A | |
| channel_b | No | B | |
| operation | No | add |
Implementation Reference
- The handler function implementing the configure_math_channel tool logic, including input schema via type hints with Literal types for operation and channels, docstring, and a placeholder return (TODO). Registered via @mcp.tool() decorator.@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:19-19 (registration)Top-level registration call to register_advanced_tools(mcp), which includes the @mcp.tool() decorators for configure_math_channel and other advanced tools.register_advanced_tools(mcp)
- src/picoscope_mcp/tools/advanced.py:6-110 (registration)The registration function that defines and registers multiple advanced tools using @mcp.tool() decorators, including configure_math_channel.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}