get_channel_config
Retrieve current configuration settings for PicoScope oscilloscope channels including voltage range, coupling, and bandwidth to verify or document measurement setups.
Instructions
Get current configuration of a channel.
Args: channel: Channel identifier (A, B, C, or D).
Returns: Dictionary containing current channel settings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes |
Implementation Reference
- The main handler function for the 'get_channel_config' tool. It retrieves the current configuration of the specified channel from the device manager and returns it as a dictionary.@mcp.tool() def get_channel_config(channel: Literal["A", "B", "C", "D"]) -> dict[str, Any]: """Get current configuration of a channel. Args: channel: Channel identifier (A, B, C, or D). Returns: Dictionary containing current channel settings. """ try: if not device_manager.is_connected(): return { "status": "error", "error": "No device connected", } # Get channel config from device manager if channel in device_manager.channel_configs: config = device_manager.channel_configs[channel] return { "status": "success", "channel": channel, "enabled": config.enabled, "coupling": config.coupling.value, "voltage_range": config.voltage_range, "analog_offset": config.analog_offset, } else: return { "status": "error", "error": f"Channel {channel} not configured", "channel": channel, } except Exception as e: return { "status": "error", "error": str(e), "channel": channel, }
- src/picoscope_mcp/server.py:16-16 (registration)Registers the configuration tools, including 'get_channel_config', by calling the registration function.register_configuration_tools(mcp)
- src/picoscope_mcp/server.py:6-6 (registration)Imports the function used to register the configuration tools including 'get_channel_config'.from .tools.configuration import register_configuration_tools