Skip to main content
Glama
musaceylan

PriceAtlas MCP Server

by musaceylan

lookup_product

Retrieve product details including name, brand, quantity, and image by scanning or entering a barcode (EAN/UPC).

Instructions

Look up a product by barcode (EAN/UPC). Returns product name, brand, quantity, and image from Open Food Facts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
barcodeYesProduct barcode (8-14 digits)

Implementation Reference

  • The handler function for 'lookup_product', which fetches product data by calling the /api/product/${barcode} endpoint.
    async ({ barcode }) => {
      try {
        const product = await api(`/api/product/${barcode}`);
        return text(product);
      } catch (e) {
        return errorResult(`Product lookup failed: ${(e as Error).message}`);
      }
    },
  • src/index.ts:40-52 (registration)
    Registration of the 'lookup_product' tool using server.tool.
    server.tool(
      'lookup_product',
      'Look up a product by barcode (EAN/UPC). Returns product name, brand, quantity, and image from Open Food Facts.',
      { barcode: z.string().describe('Product barcode (8-14 digits)') },
      async ({ barcode }) => {
        try {
          const product = await api(`/api/product/${barcode}`);
          return text(product);
        } catch (e) {
          return errorResult(`Product lookup failed: ${(e as Error).message}`);
        }
      },
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden and successfully discloses the data source (Open Food Facts) and specific return values (name, brand, quantity, image). However, it omits error behavior (e.g., barcode not found) and rate limiting details.

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?

Two sentences with zero waste. Front-loaded with the action, followed by input specification and return value documentation. Every word earns its place.

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 simple single-parameter tool with 100% schema coverage and no output schema, the description is complete. It adequately describes the input, action, data provenance, and return fields without verbosity.

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 coverage is 100% with the barcode parameter already documented as 'Product barcode (8-14 digits)'. The description adds 'EAN/UPC' clarification, providing minor additional semantic value, which meets the baseline expectation for high-coverage schemas.

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 specific action (Look up), resource (product), and distinguishing input method (by barcode/EAN/UPC). The barcode specificity clearly differentiates this from sibling 'search_products', which likely performs text-based search.

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?

Specifies the input requirement (barcode) which implies when to use the tool, but provides no explicit guidance on when to choose this over 'search_products' or other alternatives, nor does it state prerequisites or exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/musaceylan/priceatlas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server