Skip to main content
Glama

Look up barcode

lookup_barcode
Read-onlyIdempotent

Look up a packaged food by EAN/UPC barcode (Open Food Facts). Returns nutrients per 100 g and serving size. Use it whenever a photo shows a barcode: read the digits (usually 13, or 8/12) from the image and look them up BEFORE estimating anything, then log with log_food_from_database (pass the returned food object and the eaten grams). If nothing is found, fall back to label values in the photo or an estimate with log_food. The user's own saved version of a product (save_food, or edited in the app) comes first. If the result has a warning, or the nutrition label in the photo shows different numbers, the label wins: log with log_food using the label's values.

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

Input Schema

NameRequiredDescriptionDefault
barcodeYesDigits of the EAN-13 / UPC-A barcode

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered elsewhere. The description adds behavior the annotations cannot: results may carry a warning, the database may return nothing, and the user's own saved version takes precedence over the lookup. It does not describe rate limits or auth, but this is a public external lookup so those are minor.

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?

The description is front-loaded with purpose and return values, then moves into the decision rules. It is dense but every sentence carries a rule. The final sentence restates the label-wins precedence already implied by the fallback sentence, so it costs a little redundancy.

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?

For a one-parameter read-only lookup with no output schema, the description covers the source, the return shape, the failure path, the precedence order, and the handoff to sibling tools. An agent has everything needed to call it correctly and act on the result.

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% and the single parameter is already documented as 'Digits of the EAN-13 / UPC-A barcode'. The description still adds practical meaning beyond the schema: typical lengths (13, or 8/12) and the instruction to read the digits out of the image, which tells the agent where the value comes from.

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 names a specific verb and resource ('look up a packaged food by EAN/UPC barcode'), identifies the data source (Open Food Facts), and states what comes back (nutrients per 100 g and serving size). This is clearly distinguishable from the sibling log_food and log_food_from_database tools, which it explicitly positions as downstream consumers.

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

Usage Guidelines5/5

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

It gives an explicit trigger ('whenever a photo shows a barcode'), a sequencing rule (look up BEFORE estimating), a named alternative for the happy path (log_food_from_database), a named fallback for a miss (label values or log_food), and a precedence rule (the user's saved version wins; the label wins over a warning or conflicting numbers). This is close to a complete decision procedure.

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