Skip to main content
Glama
markuskreitzer

PicoScope MCP Server

get_channel_config

Retrieve current configuration settings for a specific channel (A, B, C, or D) on a PicoScope oscilloscope to view or verify signal acquisition parameters.

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
NameRequiredDescriptionDefault
channelYes

Implementation Reference

  • The handler function for the 'get_channel_config' tool. It retrieves the current channel configuration from the device_manager if connected and the channel is configured, returning success or error status.
    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,
            }
  • Registers the configuration tools (including get_channel_config) by calling register_configuration_tools(mcp). This is the top-level registration in the MCP server.
    register_discovery_tools(mcp)
    register_configuration_tools(mcp)
    register_acquisition_tools(mcp)
    register_analysis_tools(mcp)
    register_advanced_tools(mcp)
  • The function that defines and registers the configuration tools using @mcp.tool() decorators, including get_channel_config.
    def register_configuration_tools(mcp: Any) -> None:

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