Skip to main content
Glama

Find a product by barcode

find_by_barcode
Read-onlyIdempotent

Look up a catalog or user food product by EAN/UPC barcode and return it for adding or measuring. If no match, search by product name instead.

Instructions

Find the catalog product with a barcode (the EAN or UPC digits printed under the bars), or the user's own product with it (create_food's barcode). Returns it in the same shape as a search_food hit, for add_food and get_food_measures. A barcode that no product has is not_found: then search_food by the product's name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
barcodeYesThe 8 to 14 digits, without spaces, e.g. '5901234123457'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNo
errorNodescribe_error() of what went wrong; docs/AGENTS.md, Results and errors.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so safety is covered. The description adds real behavioral context beyond them: the exact return shape ('same shape as a search_food hit') and the not_found outcome with a recovery path. Missing details such as rate limits or whether user products shadow catalog matches.

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?

Three tight sentences, front-loaded with the primary action and ending with the failure fallback. Every clause carries information, though the parenthetical naming of create_food and downstream tools makes it slightly dense.

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?

An output schema exists, so return values need no explanation, and the description still frames the return shape for compatibility with add_food/get_food_measures. With one fully documented parameter and a stated failure mode, nothing needed for correct invocation 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%, so the baseline is 3. The description still adds meaning by identifying which barcode is meant (EAN/UPC digits printed under the bars) and clarifying that user-created products can carry a barcode too, which the schema does not convey.

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?

States a specific verb and resource ('find the catalog product with a barcode') and disambiguates the two lookup spaces: catalog products versus the user's own products created via create_food. An agent can distinguish this from search_food without opening the schema.

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?

Gives explicit routing: use this when you have a barcode, and when nothing matches, fall back to search_food by product name. It also names downstream consumers (add_food, get_food_measures), so the when-to-use and when-not-to-use paths are both covered.

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