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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_stores"
}
}Input 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}`); } }, );