get_waste_collection
Retrieve upcoming waste collection schedules for Zurich city ZIP codes. Filter by waste type and set date limits to plan disposal efficiently.
Instructions
Get upcoming waste collection dates for a Zurich city ZIP code. Returns the next scheduled pickups sorted by date. Currently covers Zurich city only (ZIP codes 8001–8099). Powered by OpenERZ (openerz.metaodi.ch).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | Yes | Zurich city ZIP code (e.g. '8001', '8004', '8032'). Covers 8001–8099. | |
| type | No | Waste type to filter by (e.g. 'cardboard', 'waste', 'paper', 'organic', 'textile', 'special', 'mobile'). If omitted, returns all types. | |
| limit | No | Maximum number of upcoming collection dates to return. Default: 5. |
Implementation Reference
- src/modules/recycling.ts:192-217 (handler)The handler function logic for 'get_waste_collection', which validates the zip, fetches calendar data using the `fetchCalendar` helper, and formats the response.
case "get_waste_collection": { const zip = String(args.zip ?? "").trim(); if (!zip) { throw new Error("zip is required (e.g. '8001')"); } const type = args.type as string | undefined; const limit = typeof args.limit === "number" ? Math.max(1, Math.min(args.limit, 100)) : 5; const entries = await fetchCalendar({ zip, types: type, start: todayISO(), limit, }); const collections = entries.slice(0, limit).map(compactEntry); return JSON.stringify({ zip, type: type ?? "all", upcoming: collections, count: collections.length, note: "Covers Zurich city ZIP codes 8001–8099 only.", source: "openerz.metaodi.ch", }); } - src/modules/recycling.ts:117-144 (schema)The tool definition (schema) for 'get_waste_collection', describing its input parameters (zip, type, limit).
{ name: "get_waste_collection", description: "Get upcoming waste collection dates for a Zurich city ZIP code. Returns the next scheduled pickups sorted by date. " + "Currently covers Zurich city only (ZIP codes 8001–8099). " + "Powered by OpenERZ (openerz.metaodi.ch).", inputSchema: { type: "object", required: ["zip"], properties: { zip: { type: "string", description: "Zurich city ZIP code (e.g. '8001', '8004', '8032'). Covers 8001–8099.", }, type: { type: "string", description: "Waste type to filter by (e.g. 'cardboard', 'waste', 'paper', 'organic', 'textile', 'special', 'mobile'). " + "If omitted, returns all types.", enum: SUPPORTED_WASTE_TYPES, }, limit: { type: "number", description: "Maximum number of upcoming collection dates to return. Default: 5.", }, }, }, },