robot_manufacturing
Control and monitor manufacturing equipment like 3D printers, CNC machines, and laser cutters. Manage operations, track status, and execute maintenance tasks.
Instructions
Control and monitor manufacturing equipment (3D printers, CNC, etc.).
This tool provides unified control over manufacturing devices including:
3D printers (via OctoPrint, Moonraker, Repetier Server)
CNC machines
Laser cutters
Args: device_id: Unique identifier for the manufacturing device device_type: Type of manufacturing equipment category: Operation category (control, monitor, maintenance) action: Specific action to perform file_path: Path to file for printing/cutting temperature: Temperature settings (hotend, bed, chamber) speed: Speed/feed rate settings position: Position coordinates (X, Y, Z) gcode: Raw G-code commands to send monitor_type: What to monitor (status, temperature, progress, webcam) maintenance_action: Maintenance operation to perform
Returns: Operation result with status and data
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | ||
| device_type | Yes | ||
| category | Yes | ||
| action | Yes | ||
| file_path | No | ||
| temperature | No | ||
| speed | No | ||
| position | No | ||
| gcode | No | ||
| monitor_type | No | ||
| maintenance_action | No |
Implementation Reference
- Core implementation of the robot_manufacturing tool handler. This async function, decorated with @self.mcp.tool(), handles control, monitoring, and maintenance for manufacturing devices like 3D printers, CNC machines, and laser cutters by dispatching to specific handlers.@self.mcp.tool() async def robot_manufacturing( device_id: str, device_type: Literal["3d_printer", "cnc_machine", "laser_cutter"], category: Literal["control", "monitor", "maintenance"], action: str, # Control parameters file_path: Optional[str] = None, temperature: Optional[Dict[str, float]] = None, speed: Optional[float] = None, position: Optional[Dict[str, float]] = None, gcode: Optional[str] = None, # Monitor parameters monitor_type: Optional[str] = None, # Maintenance parameters maintenance_action: Optional[str] = None, ) -> Dict[str, Any]: """Control and monitor manufacturing equipment (3D printers, CNC, etc.). This tool provides unified control over manufacturing devices including: - 3D printers (via OctoPrint, Moonraker, Repetier Server) - CNC machines - Laser cutters Args: device_id: Unique identifier for the manufacturing device device_type: Type of manufacturing equipment category: Operation category (control, monitor, maintenance) action: Specific action to perform file_path: Path to file for printing/cutting temperature: Temperature settings (hotend, bed, chamber) speed: Speed/feed rate settings position: Position coordinates (X, Y, Z) gcode: Raw G-code commands to send monitor_type: What to monitor (status, temperature, progress, webcam) maintenance_action: Maintenance operation to perform Returns: Operation result with status and data """ try: logger.info("Manufacturing operation", device_id=device_id, device_type=device_type, category=category, action=action) if device_type == "3d_printer": return await self._handle_3d_printer(device_id, category, action, file_path=file_path, temperature=temperature, speed=speed, position=position, gcode=gcode, monitor_type=monitor_type, maintenance_action=maintenance_action) elif device_type == "cnc_machine": return await self._handle_cnc_machine(device_id, category, action, file_path=file_path, speed=speed, position=position, gcode=gcode) elif device_type == "laser_cutter": return await self._handle_laser_cutter(device_id, category, action, file_path=file_path, speed=speed, position=position) else: return format_error_response(f"Unsupported device type: {device_type}", error_type="validation_error") except Exception as e: return handle_tool_error("robot_manufacturing", e, device_id=device_id, device_type=device_type, category=category, action=action)
- src/robotics_mcp/server.py:480-481 (registration)Registration of the robot_manufacturing tool by calling the register() method on the RobotManufacturingTool instance during server initialization.self.robot_manufacturing.register() # Manufacturing: 3D printers, CNC, laser cutters logger.debug("Registered robot_manufacturing tool")
- src/robotics_mcp/tools/robot_manufacturing.py:31-32 (registration)The register() method in RobotManufacturingTool that defines and registers the tool function with the MCP server using the @self.mcp.tool() decorator.def register(self): """Register manufacturing tool with MCP server."""
- Input schema defined by function parameters with type hints for device control, including required fields like device_id, device_type, category, action, and optional parameters for specific operations.async def robot_manufacturing( device_id: str, device_type: Literal["3d_printer", "cnc_machine", "laser_cutter"], category: Literal["control", "monitor", "maintenance"], action: str, # Control parameters file_path: Optional[str] = None, temperature: Optional[Dict[str, float]] = None, speed: Optional[float] = None, position: Optional[Dict[str, float]] = None, gcode: Optional[str] = None, # Monitor parameters monitor_type: Optional[str] = None, # Maintenance parameters maintenance_action: Optional[str] = None, ) -> Dict[str, Any]:
- Helper method _handle_3d_printer that dispatches 3D printer operations to control, monitor, or maintenance sub-handlers.async def _handle_3d_printer(self, device_id: str, category: str, action: str, **kwargs) -> Dict[str, Any]: """Handle 3D printer operations.""" try: if category == "control": return await self._handle_3d_printer_control(device_id, action, **kwargs) elif category == "monitor": return await self._handle_3d_printer_monitor(device_id, action, **kwargs) elif category == "maintenance": return await self._handle_3d_printer_maintenance(device_id, action, **kwargs) else: return format_error_response(f"Unknown 3D printer category: {category}", error_type="validation_error") except Exception as e: return handle_tool_error("_handle_3d_printer", e, device_id=device_id, category=category, action=action)