disconnect_device
Disconnect from the currently connected PicoScope oscilloscope device. Use this tool to end your session with the measurement instrument when data acquisition is complete.
Instructions
Disconnect from the currently connected PicoScope device.
Returns: Dictionary containing disconnection status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- The disconnect_device tool handler, decorated with @mcp.tool(). It checks if connected, calls device_manager.disconnect(), and returns appropriate status dictionary.@mcp.tool() def disconnect_device() -> dict[str, Any]: """Disconnect from the currently connected PicoScope device. Returns: Dictionary containing disconnection status. """ try: if not device_manager.is_connected(): return { "status": "warning", "message": "No device was connected", "connected": False, } success = device_manager.disconnect() if success: return { "status": "success", "message": "Device disconnected successfully", "connected": False, } else: return { "status": "error", "error": "Failed to disconnect device", } except Exception as e: return { "status": "error", "error": str(e), }
- src/picoscope_mcp/server.py:15-15 (registration)Invocation of register_discovery_tools(mcp) which defines and registers the disconnect_device tool along with other discovery tools.register_discovery_tools(mcp)