submit_price
Submit price observations for products at specific stores to track global food prices across 27 countries. This tool enables real-time price data collection for comparison and aggregation.
Instructions
Submit a price observation for a product at a specific store.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode | Yes | Product barcode (8-14 digits) | |
| country_code | Yes | 2-letter country code | |
| store_id | Yes | Store ID (use list_stores to find valid IDs) | |
| observed_price | Yes | Price amount (positive number) | |
| currency | Yes | 3-letter currency code (e.g. "EUR", "TRY", "USD") | |
| package_quantity | Yes | Package size amount | |
| package_unit | Yes | Package unit | |
| observed_at | No | ISO 8601 date (defaults to now) | |
| product_variant_note | No | Optional note about the variant |
Implementation Reference
- src/index.ts:91-116 (handler)The submit_price tool is registered and implemented directly in src/index.ts. It uses the api helper to send a POST request to the /api/prices endpoint.
'submit_price', 'Submit a price observation for a product at a specific store.', { barcode: z.string().describe('Product barcode (8-14 digits)'), country_code: z.string().length(2).describe('2-letter country code'), store_id: z.string().describe('Store ID (use list_stores to find valid IDs)'), observed_price: z.number().positive().describe('Price amount (positive number)'), currency: z.string().length(3).describe('3-letter currency code (e.g. "EUR", "TRY", "USD")'), package_quantity: z.number().positive().describe('Package size amount'), package_unit: z.enum(['g', 'kg', 'ml', 'l', 'pcs']).describe('Package unit'), observed_at: z.string().optional().describe('ISO 8601 date (defaults to now)'), product_variant_note: z.string().max(500).optional().describe('Optional note about the variant'), }, async (input) => { try { const observation = await api('/api/prices', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(input), }); return text(observation); } catch (e) { return errorResult(`Submit price failed: ${(e as Error).message}`); } }, );