Skip to main content
Glama

Barcode Tools (decode, render, GTIN validate)

Decode barcodes from an image

decode_barcode

Detect and decode all barcodes in an image. Input: base64-encoded image bytes (PNG/JPEG/WebP/anything sharp reads). Output: JSON array of {format, text}. Supports QR, Aztec, DataMatrix, Code128/39/93, EAN-13/8, UPC-A/E, ITF, PDF417, Codabar. Use formats filter to restrict results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatsNoOptional canonical format ids to keep, e.g. ["qr","ean13"]
image_base64YesBase64-encoded image file bytes (no data: URI prefix)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.1/5.0
Behavior3/5

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

Since no annotations are provided, the description carries the full burden of disclosing behavior. It covers input format (base64 image bytes, no data URI prefix), output shape (JSON array of {format, text}), and supported symbologies. It omits edge-case behavior such as error handling for invalid base64, empty result when no barcode is found, or image size limits—so it is adequate but not thorough.

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 sentences, all substantive: purpose, input, output, and supported formats/usage tip. The phrasing is tight, though 'anything sharp reads' is informal and slightly imprecise. The structure front-loads purpose and then gives necessary I/O details.

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 2-parameter tool with full schema coverage and no output schema, the description provides what an agent needs to invoke it: input encoding, output structure, supported formats, and optional filtering. It could add failure modes, but nothing essential for a typical call is missing.

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

Parameters4/5

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

With 100% schema coverage, the baseline is 3, but the description adds value by listing accepted format identifiers and explicitly saying the formats filter restricts results. This goes beyond the schema's single example and helps the agent craft valid filter values.

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 opens with 'Detect and decode all barcodes in an image,' naming a specific verb and resource. It also lists supported symbologies (QR, Aztec, DataMatrix, etc.), which effectively distinguishes this tool from siblings like render_barcode (which creates images) and validate_gtin (which validates codes).

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?

The intended use is clear: when you need to decode barcodes from an image. It also gives a concrete usage tip ('Use formats filter to restrict results'). However, it never explicitly contrasts with siblings or states when not to use it, so it falls one step short of a fully explicit routing.

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