list_devices
Discover and identify all connected PicoScope oscilloscopes to manage devices for signal acquisition and analysis.
Instructions
List all connected PicoScope devices.
Returns: Dictionary containing list of discovered devices with their info.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'list_devices' tool. It uses device_manager.discover_devices() to find connected PicoScope devices and returns a dictionary with status, device list, and count, handling exceptions gracefully.@mcp.tool() def list_devices() -> dict[str, Any]: """List all connected PicoScope devices. Returns: Dictionary containing list of discovered devices with their info. """ try: devices = device_manager.discover_devices() return { "status": "success", "devices": devices, "count": len(devices), } except Exception as e: return { "status": "error", "error": str(e), "devices": [], "count": 0, }
- src/picoscope_mcp/server.py:15-15 (registration)Top-level registration call that invokes register_discovery_tools(mcp), which defines and registers the list_devices tool using the @mcp.tool() decorator.register_discovery_tools(mcp)