Generate a barcode
generate_barcodeDraw a static barcode: EAN-13, EAN-8, UPC-A, UPC-E, ITF-14, GS1-128, GS1 DataBar and GS1 DataBar Expanded (check digits added or verified), ISBN, ISSN and ISMN (EAN-13s with the number printed above, an ISBN-10 converted, and an optional 2- or 5-digit add-on after a space), Code 128, Code 39, Code 93 (its check characters added), Codabar, USPS Intelligent Mail (the 20-digit tracking code and a 0-, 5-, 9- or 11-digit routing ZIP Code), or the 2D Data Matrix, PDF417, Aztec and DotCode. Checks the value against the format's rules (characters, length, check digit) and says what it added. Options: bar and background colors, bar height, quiet zone, scale, the text under the bars and rotation. Returns a PNG and public image URLs (SVG, PNG, JPG, WebP, AVIF, BMP, PDF and EPS) for embedding or printing. No account needed.
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": {
"data": "<data>",
"format": "<format>"
},
"name": "generate_barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | No | Background color (default ffffff) as hex, such as 000000 (in URLs leave out the # or encode it as %23) | |
| fg | No | Bar and text color (default 000000) as hex, such as 000000 (in URLs leave out the # or encode it as %23) | |
| data | Yes | The number or text to encode. Retail numbers (EAN, UPC, ITF-14, GS1 GTINs and SSCCs, ISBN, ISSN, ISMN) can leave the check digit off and it's added; a wrong one is an error. ISBN, ISSN and ISMN take a 2- or 5-digit add-on after a space (978-1-873671-00-9 52250); an ISSN takes its 2-digit sequence variant before the add-on (0317-8471 00 05). Intelligent Mail takes the 20-digit tracking code and a 0-, 5-, 9- or 11-digit routing ZIP Code, with or without spaces and hyphens. | |
| text | No | Print the digits or text under linear barcodes (default true) | |
| scale | No | Pixels per module in raster images (1-10, default 4; 2-10 for Intelligent Mail and DotCode) | |
| format | Yes | The symbology: ean13, ean8, upca, upce, isbn, issn, ismn, code128, code39, code93, codabar, itf14, gs1-128, gs1-databar, gs1-databar-expanded, intelligent-mail, datamatrix, pdf417, aztec, dotcode (EAN-13 and UPC-A for retail products, ISBN for books, ISSN for magazines, ISMN for printed music, ITF-14 for cartons, GS1-128 for logistics labels, GS1 DataBar for a GTIN on small retail items, GS1 DataBar Expanded for a GTIN with a weight, price or date at the checkout, intelligent-mail for USPS letters and flats, Code 128 for your own labels, Data Matrix, PDF417, Aztec and DotCode for 2D) | |
| height | No | Bar height of linear barcodes in millimetres at the vector size (5-60; default depends on the format). Intelligent Mail is always 3.96 mm, the height USPS sets. | |
| rotate | No | Clockwise rotation in degrees: 0, 90, 180 or 270 (default 0) | |
| quietZone | No | Blank margin in modules: left and right of linear barcodes (up to 20), all round 2D codes (up to 10). Defaults to the format's minimum. | |
| include_svg | No | Also return the SVG markup as text, e.g. to save an .svg file |