move_items_to_specific_grid_locations
Place research items at exact grid coordinates within RSpace containers for precise experimental layouts and protocol organization.
Instructions
Places items at specific coordinates within a grid container
Usage: Precise positioning for experimental layouts or protocols Coordinates: Each item gets an exact (row, column) position Validation: Ensures equal number of items and positions
Returns: Success status and confirmation of final positions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grid_locations | Yes | ||
| item_ids | Yes | ||
| target_container_id | Yes |
Implementation Reference
- main.py:1054-1075 (handler)The handler function for the 'move_items_to_specific_grid_locations' tool. It is decorated with @mcp.tool for automatic registration in the MCP framework. The function validates that the number of item_ids matches the number of grid_locations, converts the locations to internal GridLocation objects, creates a ByLocation placement strategy, and adds the items to the specified grid container using the inv_cli. Returns success status and results.@mcp.tool(tags={"rspace", "inventory", "movement"}) def move_items_to_specific_grid_locations( target_container_id: Union[int, str], item_ids: List[str], grid_locations: List[GridLocation] ) -> dict: """ Places items at specific coordinates within a grid container Usage: Precise positioning for experimental layouts or protocols Coordinates: Each item gets an exact (row, column) position Validation: Ensures equal number of items and positions Returns: Success status and confirmation of final positions """ if len(item_ids) != len(grid_locations): raise ValueError("Number of items must match number of grid locations") locations = [i.GridLocation(loc.x, loc.y) for loc in grid_locations] placement = i.ByLocation(locations, *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)}