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}`);
        }
      },
    );

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