Skip to main content
Glama

get_waste_calendar

Retrieve monthly waste collection schedules for Zurich city by entering a ZIP code. View all collection events grouped by date for any specified month.

Instructions

Get a full monthly waste collection calendar for a Zurich city ZIP code. Returns all collection events grouped by date for the given month. 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.
monthNoMonth number (1–12). Defaults to the current month.
yearNoYear (e.g. 2026). Defaults to the current year.

Implementation Reference

  • The tool handler for "get_waste_calendar" implemented inside the `handleRecycling` function.
    case "get_waste_calendar": {
      const zip = String(args.zip ?? "").trim();
      if (!zip) {
        throw new Error("zip is required (e.g. '8001')");
      }
    
      const now = new Date();
      const month = typeof args.month === "number"
        ? Math.max(1, Math.min(args.month, 12))
        : now.getMonth() + 1;
      const year = typeof args.year === "number"
        ? args.year
        : now.getFullYear();
    
      const { start, end } = monthRange(month, year);
    
      const entries = await fetchCalendar({ zip, start, end });
      const compact = entries.map(compactEntry);
    
      // Group by date
      const byDate: Record<string, string[]> = {};
      for (const e of compact) {
        if (!byDate[e.date]) byDate[e.date] = [];
        byDate[e.date].push(e.waste_type);
      }
    
      const calendar = Object.entries(byDate)
        .sort(([a], [b]) => a.localeCompare(b))
        .map(([date, types]) => ({ date, types }));
    
      const monthName = new Date(year, month - 1, 1).toLocaleString("en-US", { month: "long" });
    
      return JSON.stringify({
        zip,
        month,
        year,
        month_name: monthName,
        calendar,
        total_events: compact.length,
        collection_days: calendar.length,
        note: "Covers Zurich city ZIP codes 8001–8099 only.",
        source: "openerz.metaodi.ch",
      });
    }
  • The logic handling the 'get_waste_calendar' tool inside the handleRecycling function.
    case "get_waste_calendar": {
      const zip = String(args.zip ?? "").trim();
      if (!zip) {
        throw new Error("zip is required (e.g. '8001')");
      }
    
      const now = new Date();
      const month = typeof args.month === "number"
        ? Math.max(1, Math.min(args.month, 12))
        : now.getMonth() + 1;
      const year = typeof args.year === "number"
        ? args.year
        : now.getFullYear();
    
      const { start, end } = monthRange(month, year);
    
      const entries = await fetchCalendar({ zip, start, end });
      const compact = entries.map(compactEntry);
    
      // Group by date
      const byDate: Record<string, string[]> = {};
      for (const e of compact) {
        if (!byDate[e.date]) byDate[e.date] = [];
        byDate[e.date].push(e.waste_type);
      }
    
      const calendar = Object.entries(byDate)
        .sort(([a], [b]) => a.localeCompare(b))
        .map(([date, types]) => ({ date, types }));
    
      const monthName = new Date(year, month - 1, 1).toLocaleString("en-US", { month: "long" });
    
      return JSON.stringify({
        zip,
        month,
        year,
        month_name: monthName,
        calendar,
        total_events: compact.length,
        collection_days: calendar.length,
        note: "Covers Zurich city ZIP codes 8001–8099 only.",
        source: "openerz.metaodi.ch",
      });
  • The schema definition for the "get_waste_calendar" tool.
      name: "get_waste_calendar",
      description:
        "Get a full monthly waste collection calendar for a Zurich city ZIP code. " +
        "Returns all collection events grouped by date for the given month. " +
        "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.",
          },
          month: {
            type: "number",
            description: "Month number (1–12). Defaults to the current month.",
          },
          year: {
            type: "number",
            description: "Year (e.g. 2026). Defaults to the current year.",
          },
        },
      },
    },
  • The definition and input schema for the 'get_waste_calendar' tool.
    {
      name: "get_waste_calendar",
      description:
        "Get a full monthly waste collection calendar for a Zurich city ZIP code. " +
        "Returns all collection events grouped by date for the given month. " +
        "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.",
          },
          month: {
            type: "number",
            description: "Month number (1–12). Defaults to the current month.",
          },
          year: {
            type: "number",
            description: "Year (e.g. 2026). Defaults to the current year.",
          },
        },
      },
    },
  • The array where "get_waste_calendar" is registered within the `recyclingTools` list.
    export const recyclingTools = [
      {
        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.",
            },
          },
        },
      },
      {
        name: "list_waste_types",
        description:
          "List all supported waste collection types for Zurich city. " +
          "Returns each type with its description and local name. " +
          "Currently covers Zurich city only (ZIP codes 8001–8099). " +
          "Powered by OpenERZ (openerz.metaodi.ch).",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "get_waste_calendar",
        description:
          "Get a full monthly waste collection calendar for a Zurich city ZIP code. " +
          "Returns all collection events grouped by date for the given month. " +
          "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.",
            },
            month: {
              type: "number",
              description: "Month number (1–12). Defaults to the current month.",
            },
            year: {
              type: "number",
              description: "Year (e.g. 2026). Defaults to the current year.",
            },
          },
        },
      },
    ];
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by specifying the geographic limitation (Zurich city only) and data source (OpenERZ), which are important behavioral constraints. However, it doesn't mention potential error conditions, rate limits, authentication requirements, or what happens with invalid ZIP codes, leaving some behavioral aspects unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly front-loaded with the core purpose in the first sentence, followed by important behavioral constraints. Every sentence earns its place: the first states what it does, the second specifies the return format, the third gives geographic limitations, and the fourth credits the data source. Zero waste, excellent structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only data retrieval tool with no output schema, the description provides good contextual completeness. It covers purpose, geographic scope, return format, and data source. The main gap is the lack of output schema, which means the agent doesn't know the structure of returned data, but the description compensates somewhat by specifying 'Returns all collection events grouped by date.'

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'Zurich city ZIP code' which reinforces the schema's description, but doesn't provide additional semantic context about parameter interactions or edge cases.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get a full monthly waste collection calendar'), the resource ('for a Zurich city ZIP code'), and the scope ('Returns all collection events grouped by date for the given month'). It explicitly distinguishes this tool from sibling tools like 'get_waste_collection' by specifying it returns a calendar format rather than individual collection data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('Currently covers Zurich city only (ZIP codes 8001–8099)'), which helps the agent understand geographic limitations. However, it doesn't explicitly state when NOT to use it or mention alternatives like 'get_waste_collection' for non-calendar waste data.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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