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 and GS1-128 (check digits added or verified), Code 128, Code 39, Code 93 (its check characters added), Codabar, or the 2D Data Matrix, PDF417 and Aztec. 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) can leave the check digit off and it's added; a wrong one is an error.
textNoPrint the digits or text under linear barcodes (default true)
scaleNoPixels per module in raster images (1-10, default 4)
formatYesThe 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)
heightNoBar height of linear barcodes in millimetres at the vector size (5-60; default depends on the format)
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. 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)"
  2. 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)"
  3. First observed

TDQS

A4/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description discloses real behavior: it validates the value against the format's rules, adds or verifies check digits, and reports what it added. It also names the returned artifacts (PNG plus public SVG/PNG/JPG/WebP/AVIF/BMP/PDF/EPS URLs) and states no account is required.

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

Conciseness4/5

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

Front-loads purpose and format list, then behavior, then output, which is the right order. The long symbology enumeration is dense but each item is functional; a few phrases (format-specific parentheticals) are repeated in the schema and could be trimmed.

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

Completeness5/5

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

With ten parameters and no output schema, the description still covers the essentials an agent needs: supported formats, validation and check-digit behavior, available rendering options, and the concrete return payload including alternate image formats. Nothing critical for correct invocation is missing.

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 the schema already documents all ten parameters in depth, including defaults and ranges. The description only summarizes the option categories (colors, height, quiet zone, scale, caption text, rotation) without adding semantics beyond what the schema provides, so baseline 3 applies.

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

Purpose4/5

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

The description opens with a specific verb and resource ('Draw a static barcode') and enumerates the supported symbologies, so an agent knows exactly what it produces. It does not explicitly differentiate itself from siblings such as save_barcode (this only renders, it does not persist) or generate_qr_code, leaving that routing to inference from the tool names.

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

Usage Guidelines3/5

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

Usage context is implied rather than stated: 'No account needed' and 'for embedding or printing' hint at the rendering-only, stateless nature. There is no explicit when-to-use-versus-alternative statement, e.g. when to call save_barcode afterward or how this relates to generate_qr_code, so the agent must infer selection from sibling names.

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.