generate_barcode
Generate scannable barcodes and QR codes for inventory items to create physical labels for sample tracking and identification in research workflows.
Instructions
Generates scannable barcodes for inventory items
Usage: Create physical labels for sample tracking and identification Types: 'BARCODE' for standard linear barcodes, 'QR' for QR codes Returns: Binary barcode image data for printing or display
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode_type | No | BARCODE | |
| global_id | Yes |
Implementation Reference
- main.py:1152-1162 (handler)The main handler function for the 'generate_barcode' tool. It takes a global_id and optional barcode_type, determines the barcode type (BARCODE or QR), and calls inv_cli.barcode to generate and return the barcode image as bytes.def generate_barcode(global_id: str, barcode_type: str = "BARCODE") -> bytes: """ Generates scannable barcodes for inventory items Usage: Create physical labels for sample tracking and identification Types: 'BARCODE' for standard linear barcodes, 'QR' for QR codes Returns: Binary barcode image data for printing or display """ bc_type = i.Barcode.BARCODE if barcode_type.upper() == "BARCODE" else i.Barcode.QR return inv_cli.barcode(global_id, barcode_type=bc_type)
- main.py:1151-1151 (registration)The @mcp.tool decorator registers the generate_barcode function as an MCP tool with tags for categorization.@mcp.tool(tags={"rspace", "inventory", "utility"})