move_items_to_grid_container_by_row
Systematically moves items to grid containers by filling positions row by row, automatically calculating next available positions for plates, boxes, or other gridded containers.
Instructions
Moves items to grid container, filling positions row by row
Usage: Systematic filling of plates, boxes, or other gridded containers Auto-positioning: Automatically calculates next available positions Dimensions: Auto-detected from container if not provided
Returns: Success status and final positions of moved items
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_ids | Yes | ||
| start_column | No | ||
| start_row | No | ||
| target_container_id | Yes | ||
| total_columns | No | ||
| total_rows | No |
Implementation Reference
- main.py:990-1021 (handler)The handler function implementing the 'move_items_to_grid_container_by_row' tool. It is registered via the @mcp.tool decorator. The function moves inventory items (samples or containers) into a grid container, filling positions sequentially by row. It auto-detects grid dimensions if not provided, creates a ByRow placement strategy using the RSpace inventory client library, and executes the move operation.@mcp.tool(tags={"rspace", "inventory", "movement"}) def move_items_to_grid_container_by_row( target_container_id: Union[int, str], item_ids: List[str], start_column: int = 1, start_row: int = 1, total_columns: int = None, total_rows: int = None ) -> dict: """ Moves items to grid container, filling positions row by row Usage: Systematic filling of plates, boxes, or other gridded containers Auto-positioning: Automatically calculates next available positions Dimensions: Auto-detected from container if not provided Returns: Success status and final positions of moved items """ # Auto-detect container dimensions if not provided if total_columns is None or total_rows is None: container = inv_cli.get_container_by_id(target_container_id) container_obj = i.Container.of(container) if hasattr(container_obj, 'column_count'): total_columns = container_obj.column_count() total_rows = container_obj.row_count() else: raise ValueError("Container dimensions required for non-grid containers") placement = i.ByRow(start_column, start_row, total_columns, total_rows, *item_ids) result = inv_cli.add_items_to_grid_container(target_container_id, placement) return {"success": result.is_ok(), "results": result.data if hasattr(result, 'data') else str(result)}