list_slots
View configured instrument slots to manage device connections and signal routing for Moku hardware control.
Instructions
List configured instrument slots
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_slots"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/moku_mcp/server.py:588-632 (handler)The actual implementation of the list_slots functionality in the MokuMCPServer class, which iterates over instrument slots and queries their configuration.
async def list_slots(self): """ List configured instrument slots. Returns: { "slots": { "1": {"instrument": "CloudCompile", "configured": true}, "2": {"instrument": "Oscilloscope", "configured": true}, "3": {"configured": false}, "4": {"configured": false} } } Implementation: See IMPLEMENTATION_GUIDE.md Section 3.8 """ if not self.moku_instance: return { "status": "error", "message": "Not connected to any device", "suggestion": "Call attach_moku first", } slots = {} # Query each slot (1-4 for Moku:Go) for slot_num in range(1, 5): try: instrument = self.moku_instance.get_instrument(slot_num) if instrument: slots[str(slot_num)] = { "instrument": instrument.__class__.__name__, "configured": True, } logger.debug(f"Slot {slot_num}: {instrument.__class__.__name__}") else: slots[str(slot_num)] = {"configured": False} logger.debug(f"Slot {slot_num}: Empty") except Exception as e: # Slot not configured or error accessing it slots[str(slot_num)] = {"configured": False} logger.debug(f"Slot {slot_num}: Not configured or error: {e}") logger.info(f"Slot status: {sum(1 for s in slots.values() if s.get('configured'))} configured") return {"slots": slots} - src/moku_mcp/tools.py:115-122 (registration)The MCP tool definition for list_slots.
Tool( name="list_slots", description="List configured instrument slots", inputSchema={ "type": "object", "properties": {}, }, ),