Generate Barcode or QR Code (SVG + PNG)
generate_barcodeEncodes a single QR Code (ISO 18004 v1-v10), Code-128, GS1-128, EAN-13, or UPC-A symbol, validating/computing GS1 check digits and returning both crisp vector SVG and lossless binary base64 PNG. Pricing: $0.001 USD per generated barcode or QR symbol (SVG + PNG) (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"format": "<format>",
"value": "<value>"
},
"name": "generate_barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Optional custom human-readable caption override beneath the barcode. | |
| scale | No | Pixels per module (defaults to 4 for QR and 2 for 1D linear barcodes). | |
| value | Yes | Payload to encode (UTF-8 string/URL for QR; printable ASCII for code128; '(01)...' AI string for gs1_128; 12/13 digits for ean13; 11/12 digits for upca). | |
| format | Yes | Symbology format: 'qr' (ISO 18004 v1-v10 UTF-8), 'code128' (Set B/C auto-packed), 'gs1_128' (GS1 Application Identifiers with FNC1), 'ean13' (GTIN-13), or 'upca' (GTIN-12). | |
| barHeight | No | Bar height in pixels for 1D linear barcodes (defaults to 72). | |
| quietZone | No | Quiet zone margin in modules (defaults to ISO standard: 4 for QR, 9-11 for 1D). | |
| background | No | Background hex color (#RGB or #RRGGBB, default '#FFFFFF'). | |
| foreground | No | Foreground bar/module hex color (#RGB or #RRGGBB, default '#000000'). | |
| includeText | No | Render human-readable text beneath symbol (defaults to true for 1D, false for QR). | |
| errorCorrection | No | QR Code Reed-Solomon error correction level: L (~7%), M (~15%), Q (~25%), H (~30%). | M |