create_sample
Register new research samples in RSpace inventory with metadata, quantity tracking, and automatic subsample creation for organized lab management.
Instructions
Creates a new sample in the inventory system
Usage: Register new samples with metadata and quantity tracking Subsamples: Automatically creates specified number of subsample aliquots Quantity: Tracks total amount with specified units (ml, mg, μl, etc.)
Returns: Created sample information including generated subsample IDs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| tags | No | ||
| description | No | ||
| subsample_count | No | ||
| total_quantity_value | No | ||
| total_quantity_unit | No | ml |
Implementation Reference
- main.py:743-775 (handler)The MCP tool handler for 'create_sample'. Decorated with @mcp.tool for automatic registration and execution. Handles sample creation with parameters for name, tags, description, subsample count, and quantity. Calls the underlying inv_cli.create_sample.@mcp.tool(tags={"rspace", "inventory", "samples"}) def create_sample( name: str, tags: List[str] = None, description: str = None, subsample_count: int = 1, total_quantity_value: float = None, total_quantity_unit: str = "ml" ) -> dict: """ Creates a new sample in the inventory system Usage: Register new samples with metadata and quantity tracking Subsamples: Automatically creates specified number of subsample aliquots Quantity: Tracks total amount with specified units (ml, mg, μl, etc.) Returns: Created sample information including generated subsample IDs """ tag_objects = i.gen_tags(tags) if tags else [] quantity = None if total_quantity_value: from rspace_client.inv import quantity_unit as qu unit = qu.QuantityUnit.of(total_quantity_unit) quantity = i.Quantity(total_quantity_value, unit) return inv_cli.create_sample( name=name, tags=tag_objects, description=description, subsample_count=subsample_count, total_quantity=quantity )