Skip to main content
Glama

generate_barcode

Barcode Generator — Generate a barcode (Code128, EAN-13, DataMatrix, PDF417, etc.) as a PNG image. [category: generate]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoWhich barcode standard to make. Code 128 takes any text or number; EAN-13 needs 12-13 digits and EAN-8 needs 7-8; UPC-A needs 11-12; Code 39 takes capitals and digits; ITF-14 needs 13-14 digits; Data Matrix, PDF417 and QR are the square ones that hold any text. Anything we do not recognise is made as a Code 128.code128
heightNoHow tall the bars are, in pixels. The width follows automatically.
contentYesThe data to encode
showTextNoPrint the encoded digits underneath the bars, so a cashier can key them in if a scan fails.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / height / x-ui
      Added value: +{
      +  "unit": "px"
      +}
  2. Changed5 schema fields changed
    • changedInput schema / properties / height / description
      Previous value: -"Output height in px. Width is derived automatically (height×3; square for qr/datamatrix) — there is no 'width' parameter."New value: +"How tall the bars are, in pixels. The width follows automatically."
    • changedInput schema / properties / height / minimum
      Previous value: -1New value: +50
    • addedInput schema / properties / showText
      Added value: +{
      +  "default": true,
      +  "description": "Print the encoded digits underneath the bars, so a cashier can key them in if a scan fails.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / type / description
      Previous value: -"Symbology. Unknown types fall back to code128."New value: +"Which barcode standard to make. Code 128 takes any text or number; EAN-13 needs 12-13 digits and EAN-8 needs 7-8; UPC-A needs 11-12; Code 39 takes capitals and digits; ITF-14 needs 13-14 digits; Data Matrix, PDF417 and QR are the square ones that hold any text. Anything we do not recognise is made as a Code 128."
    • addedInput schema / properties / type / x-ui
      Added value: +{
      +  "labels": {
      +    "code128": "Code 128",
      +    "code39": "Code 39",
      +    "datamatrix": "Data Matrix",
      +    "ean13": "EAN-13",
      +    "ean8": "EAN-8",
      +    "itf14": "ITF-14",
      +    "pdf417": "PDF417",
      +    "qr": "QR Code",
      +    "upca": "UPC-A"
      +  }
      +}
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, which already signal a non-destructive creation operation. The description adds the output format (PNG image) but does not disclose behavior like fallback to Code128 for unrecognized input (though that is in the schema) or how the generated file is returned (e.g., file path vs. data URI). With annotations covering the safety profile, the description adds modest value beyond them.

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

Conciseness5/5

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

The description is a single sentence followed by a category tag. It is concise and front-loads the core purpose and output format. No wasted words; every element earns its place. The category tag is redundant but harmless.

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?

The tool is relatively simple with 4 well-documented parameters and no output schema. The description covers the output format (PNG). It does not explicitly state what the return value is (e.g., a file path), but for a generate tool of this type, that is often implicit and not a critical gap. The combination of description and schema is sufficient for an agent to call it correctly.

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 parameter (type, height, content, showText) is documented in the schema. The type parameter's description is particularly detailed, covering constraints for each barcode standard. The tool description adds no new parameter-level information, so it relies on the schema. Baseline 3 is appropriate given the high schema coverage.

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?

The description states a specific verb ('Generate') and resource ('a barcode') with explicit output format ('as a PNG image'). It lists example barcode types (Code128, EAN-13, DataMatrix, PDF417) which distinguishes it from the sibling generate_qr_code tool, which is specific to QR codes. The purpose is unambiguous and actionable.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like generate_qr_code. It does not mention that this is the general-purpose barcode generator and that generate_qr_code is for QR-only needs. An agent must infer the difference from the name and description, which is insufficient.

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.

Resources