Skip to main content
Glama

Generate a barcode

generate_barcode
Read-onlyIdempotent

Draw 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

NameRequiredDescriptionDefault
bgNoBackground color (default ffffff) as hex, such as 000000 (in URLs leave out the # or encode it as %23)
fgNoBar and text color (default 000000) as hex, such as 000000 (in URLs leave out the # or encode it as %23)
dataYesThe 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.
textNoPrint the digits or text under linear barcodes (default true)
scaleNoPixels per module in raster images (1-10, default 4; 2-10 for Intelligent Mail and DotCode)
formatYesThe 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)
heightNoBar 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.
rotateNoClockwise rotation in degrees: 0, 90, 180 or 270 (default 0)
quietZoneNoBlank 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_svgNoAlso return the SVG markup as text, e.g. to save an .svg file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / data / description
      Previous value: -"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)."New value: +"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."
    • changedInput schema / properties / format / description
      Previous value: -"The symbology: ean13, ean8, upca, upce, isbn, issn, ismn, code128, code39, code93, codabar, itf14, gs1-128, gs1-databar, gs1-databar-expanded, datamatrix, pdf417, aztec (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, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"New value: +"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)"
    • changedInput schema / properties / height / description
      Previous value: -"Bar height of linear barcodes in millimetres at the vector size (5-60; default depends on the format)"New value: +"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."
    • changedInput schema / properties / scale / description
      Previous value: -"Pixels per module in raster images (1-10, default 4)"New value: +"Pixels per module in raster images (1-10, default 4; 2-10 for Intelligent Mail and DotCode)"
  2. Changed2 schema fields changed
    • changedInput schema / properties / data / description
      Previous value: -"The number or text to encode. Retail numbers (EAN, UPC, ITF-14, GS1 GTINs and SSCCs) can leave the check digit off and it's added; a wrong one is an error."New value: +"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)."
    • changedInput schema / properties / format / description
      Previous value: -"The symbology: ean13, ean8, upca, upce, code128, code39, code93, codabar, itf14, gs1-128, datamatrix, pdf417, aztec (EAN-13 and UPC-A for retail products, ITF-14 for cartons, GS1-128 for logistics labels, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"New value: +"The symbology: ean13, ean8, upca, upce, isbn, issn, ismn, code128, code39, code93, codabar, itf14, gs1-128, gs1-databar, gs1-databar-expanded, datamatrix, pdf417, aztec (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, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"
  3. Changed1 schema field changed
    • changedInput schema / properties / format / description
      Previous value: -"The symbology: ean13, ean8, upca, upce, code128, code39, codabar, itf14, gs1-128, datamatrix, pdf417, aztec (EAN-13 and UPC-A for retail products, ITF-14 for cartons, GS1-128 for logistics labels, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"New value: +"The symbology: ean13, ean8, upca, upce, code128, code39, code93, codabar, itf14, gs1-128, datamatrix, pdf417, aztec (EAN-13 and UPC-A for retail products, ITF-14 for cartons, GS1-128 for logistics labels, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"
  4. Changed1 schema field changed
    • changedInput schema / properties / format / description
      Previous value: -"The symbology: ean13, ean8, upca, upce, code128, code39, itf14, gs1-128, datamatrix, pdf417, aztec (EAN-13 and UPC-A for retail products, ITF-14 for cartons, GS1-128 for logistics labels, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"New value: +"The symbology: ean13, ean8, upca, upce, code128, code39, codabar, itf14, gs1-128, datamatrix, pdf417, aztec (EAN-13 and UPC-A for retail products, ITF-14 for cartons, GS1-128 for logistics labels, Code 128 for your own labels, Data Matrix, PDF417 and Aztec for 2D)"
  5. Added

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover readOnly, idempotent, non-destructive and closed-world, and the description adds genuinely new behavior: it validates the value against format rules, reports what it added (check digits), and returns a PNG plus public image URLs in eight formats. It also states "No account needed," removing an auth question the annotations don't answer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose and format list, which is good, but the body is a single dense run-on paragraph with heavy parenthetical nesting. The "Options: bar and background colors, bar height, quiet zone, scale, the text under the bars and rotation" sentence is pure duplication of schema fields already at full coverage and does not earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly carries the return-value burden by naming the PNG plus SVG/PNG/JPG/WebP/AVIF/BMP/PDF/EPS URLs. Validation and check-digit behavior are covered; error/limit behavior and pagination-style concerns are less clear but largely moot for a stateless generator.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every one of the 10 parameters is already documented, including format-specific quirks like Intelligent Mail's fixed 3.96 mm height and the add-on syntax for ISBN/ISSN. The description's parameter mentions (colors, height, quiet zone, scale, text, rotation) largely restate the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Draw a static barcode") and enumerates the exact symbologies supported, from EAN-13 through DotCode. The absence of QR formats in the list implicitly separates it from the generate_qr_code sibling without needing to name it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear per-format selection guidance inside the format enum description (EAN-13/UPC-A for retail products, ISBN for books, ITF-14 for cartons, GS1-128 for logistics labels, Data Matrix/PDF417 for 2D). It stops short of explicit routing to alternatives such as generate_qr_code for QR codes or save_barcode to persist results, and states no when-not-to-use conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.