set_routing
Configure MCC signal routing connections to direct signals between specified sources and destinations in Moku devices.
Instructions
Configure MCC signal routing
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connections | Yes | List of routing connections |
Implementation Reference
- src/moku_mcp/server.py:477-530 (handler)The handler implementation for the set_routing MCP tool which validates and applies signal routing connections to a Moku device.
async def set_routing(self, connections: list): """ Configure MCC signal routing. Args: connections: List of {"source": "...", "destination": "..."} dicts Returns: { "status": "configured", "connections_count": 2 } Implementation: See IMPLEMENTATION_GUIDE.md Section 3.6 """ from moku_models import MokuConnection from pydantic import ValidationError if not self.moku_instance: return { "status": "error", "message": "Not connected to any device", "suggestion": "Call attach_moku first", } # Validate connections try: parsed_connections = [MokuConnection(**conn) for conn in connections] except ValidationError as e: logger.error(f"Invalid connection format: {e}") return { "status": "error", "message": "Invalid connection format", "errors": e.errors(), } # Apply to hardware try: self.moku_instance.set_connections(connections) logger.info(f"Configured {len(connections)} routing connections") # Update cached config if we have one if self.last_config: self.last_config.routing = parsed_connections return {"status": "configured", "connections_count": len(connections)} except Exception as e: logger.error(f"Failed to configure routing: {e}") return { "status": "error", "message": "Failed to configure routing", "details": str(e), }