Skip to main content
Glama

Barcode

barcode
Read-only

Encode data into scannable SVG or PNG 1D codes in 25+ formats for product labels, packaging, and print-ready output.

Instructions

Barcode. Generate a barcode image via GET. Output: SVG (default) or PNG. Supports 25+ formats: EAN-13, Code 128, ITF-14, GS1-128, postal codes and more. Credit cost: 3 credits per call.

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>"
    },
    "name": "barcode"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesThe data to encode in the barcode. Examples by type:
descNoSVG <desc> element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml
typeNoBarcode format. Default: code128. Allowed values: code128, code39, code39ext, code93, code93ext, ean13, ean8, ean5, ean2, upca, upce, itf, itf14, codabar, msi, pharmacode, code11, gs1-128, gs1-databar, gs1-databar-limited, gs1-databar-expanded, identcode, leitcode, postnet, planet, plessey. Default: "code128".
unitNoMeasurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm Allowed values: px, mm, in, cm. Default: "px".
colorNoBar color as a CSS color string. Default: #000. Examples: ?color=%231e293b (dark slate), ?color=%230f172a (near black), ?color=%237c3aed (purple), ?color=%23dc2626 (red). Use %23 to URL-encode the # character.
shareNoSet share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
titleNoSVG <title> element for tooltip and accessibility. Example: ?title=Product+Barcode
fieldsNoComma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
formatNoOutput format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png Allowed values: svg, png. Default: "svg".
heightNoBar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100
marginNoUniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6
bar_gapNoExtra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1
rotationNoRotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90
bar_widthNoWidth multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3
font_sizeNoFont size of the text label in pixels. Default: 14. Example: ?font_size=12
show_textNoShow human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels.
aria_labelNoAccessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931
backgroundNoBackground fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc
margin_topNoTop margin in pixels (overrides margin). Example: ?margin_top=4
text_alignNoHorizontal alignment of the text label. Default: center. Example: ?text_align=left Allowed values: center, left, right. Default: "center".
bearer_barsNoAdd horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true
font_familyNoFont family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial
margin_leftNoLeft margin in pixels (overrides margin). Example: ?margin_left=8
margin_rightNoRight margin in pixels (overrides margin). Example: ?margin_right=8
margin_bottomNoBottom margin in pixels (overrides margin). Example: ?margin_bottom=4
text_positionNoPosition of the human-readable text label. Default: bottom. Example: ?text_position=top Allowed values: bottom, top. Default: "bottom".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds real context beyond them: the request is a GET, the output is an image (SVG lossless/scalable, PNG raster for email/PDF/messaging), and each call costs 3 credits. It does not discuss failure modes for invalid data/format combinations, which is the remaining gap.

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?

Four short sentences, front-loaded with the core action and output options, with credit cost last. The leading "Barcode." merely restates the name/title and earns nothing, but the rest is dense and waste-free.

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?

For a 26-parameter rendering tool with full schema coverage and no output schema, the description covers what the tool produces (SVG/PNG image), format choice and cost. Return-shape detail is unnecessary here because the meaningful parameters are fully documented, though the image-vs-JSON behavior of share=true could have been summarized.

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 all 26 parameters, their defaults, allowed values and examples are already documented in structured data. The description reinforces only the most salient ones (format, supported symbologies) and adds no syntax or interaction rules, such as which type values require bearer_bars or data-length constraints. 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 gives a specific verb and resource ("Generate a barcode image") plus concrete capability detail: 25+ symbologies including EAN-13, Code 128, ITF-14 and GS1-128, and SVG/PNG output. That is enough to distinguish it from qrcode and label_render, though it never names those siblings explicitly.

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 is only implied by the resource type: an agent wanting a linear barcode rather than a QR code or a full label will infer this is the tool. There is no explicit when-to-use, no when-not, and no routing to qrcode or label_render if the request is ambiguous. The stated credit cost is useful for cost-aware selection.

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