list_stores
Retrieve available supermarket chains for price tracking and comparison. Filter by country code to focus on specific markets.
Instructions
List available stores. Optionally filter by country.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | No | 2-letter country code to filter stores |
Implementation Reference
- src/index.ts:132-148 (handler)The 'list_stores' tool is registered and implemented directly in src/index.ts using the 'server.tool' method. The handler makes a GET request to '/api/stores' (with an optional country parameter) and returns the JSON result as text.
server.tool( 'list_stores', 'List available stores. Optionally filter by country.', { country: z.string().length(2).optional().describe('2-letter country code to filter stores'), }, async ({ country }) => { try { let path = '/api/stores'; if (country) path += `?country=${country}`; const stores = await api(path); return text(stores); } catch (e) { return errorResult(`List stores failed: ${(e as Error).message}`); } }, );