Skip to main content
Glama

Validate Gtin

validate_gtin
Read-onlyIdempotent

Validate a barcode number, EAN-13, UPC-A (12), EAN-8, or GTIN-14 (keyless, offline). Checks the mod-10 check digit, reports the format, normalizes to GTIN-14, and returns the GS1 prefix + issuing country/region. Spaces/dashes ignored. Validates the number, not the product.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "0036000291452"
    },
    "name": "validate_gtin"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesA barcode/GTIN, e.g. "0036000291452" or "4006381333931".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "code": "0036000291452"
      +  },
      +  {
      +    "code": "4006381333931"
      +  }
      +]
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), yet the description still adds real behavior: the mod-10 check-digit test, format reporting, GTIN-14 normalization, and GS1 prefix/country derivation. The only soft spot is the claim of being "offline" while openWorldHint=true is set, which is a mild tension an agent might want resolved.

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?

Front-loaded with the verb and valid formats, then the check performed, then the outputs, then the scope caveat. Every clause carries information; nothing is redundant with the schema.

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 no output schema, the description takes on the job of describing returns and does so (format, normalized GTIN-14, GS1 prefix, country/region). For a single-parameter validator with annotations already covering safety, nothing an agent needs to call it correctly 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?

Schema coverage is 100% with a single parameter, so the baseline is 3. The description goes beyond that by stating that spaces and dashes are ignored, which defines the accepted input syntax rather than just the field type.

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?

Names a specific verb (validate) and resource (barcode/GTIN), enumerates the exact accepted symbologies (EAN-13, UPC-A 12, EAN-8, GTIN-14), and explicitly bounds scope with "Validates the number, not the product." This distinguishes it from product-lookup tools without needing the sibling schemas.

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?

"Keyless, offline" and "Spaces/dashes ignored" give practical calling context, and "validates the number, not the product" rules out a misuse case. However, there is no routing guidance toward the clearly overlapping sibling gtin_check_digit, so an agent cannot tell from this text when to pick one over the other.

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.