Skip to main content
Glama

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
NameRequiredDescriptionDefault
zipYesZurich city ZIP code (e.g. '8001', '8004', '8032'). Covers 8001–8099.
typeNoWaste type to filter by (e.g. 'cardboard', 'waste', 'paper', 'organic', 'textile', 'special', 'mobile'). If omitted, returns all types.
limitNoMaximum number of upcoming collection dates to return. Default: 5.

Implementation Reference

  • 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",
      });
    }
  • 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.",
          },
        },
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vikramgorla/mcp-swiss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server