get_world_prices
Retrieve global price ranges for products across 27 countries using barcode data to compare international food costs.
Instructions
Get aggregated world prices for a product from Open Food Facts global database. Shows price ranges across countries.
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": "get_world_prices"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode | Yes | Product barcode (8-14 digits) |
Implementation Reference
- src/index.ts:118-130 (handler)The implementation of the get_world_prices MCP tool, which queries the Open Food Facts API for world prices based on a barcode.
server.tool( 'get_world_prices', 'Get aggregated world prices for a product from Open Food Facts global database. Shows price ranges across countries.', { barcode: z.string().describe('Product barcode (8-14 digits)') }, async ({ barcode }) => { try { const result = await api(`/api/world-prices?barcode=${barcode}`); return text(result); } catch (e) { return errorResult(`World prices failed: ${(e as Error).message}`); } }, );