Skip to main content
Glama

get_area_schedule

Retrieve the upcoming load shedding schedule and events for a specific area using its area ID. Use search_areas first if you don't have an ID.

Instructions

Get the upcoming load shedding schedule and events for a specific area. Requires an area ID — use search_areas first if you don't have one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
area_idYesThe area ID from search_areas (e.g. 'eskmo-7-stellenboschstellenboschwestern-cape')
testNoUse test data (does not count against your quota)

Implementation Reference

  • src/index.ts:101-153 (registration)
    The tool 'get_area_schedule' is registered with the MCP server using server.tool(). The handler accepts area_id and test parameters, calls client.getAreaInfo(), and formats the response with upcoming events and schedule for the next 3 days.
    // ── Tool 3: Get area schedule ────────────────────────────────────────────────
    server.tool(
      "get_area_schedule",
      "Get the upcoming load shedding schedule and events for a specific area. Requires an area ID — use search_areas first if you don't have one.",
      {
        area_id: z
          .string()
          .describe("The area ID from search_areas (e.g. 'eskmo-7-stellenboschstellenboschwestern-cape')"),
        test: z
          .boolean()
          .optional()
          .default(false)
          .describe("Use test data (does not count against your quota)"),
      },
      async ({ area_id, test }) => {
        const data = await client.getAreaInfo(area_id, test);
    
        const events = data.events.length
          ? data.events
              .map((e) => `- 🚫 **${e.note}**\n  From: ${e.start}\n  Until: ${e.end}`)
              .join("\n")
          : "✅ No upcoming load shedding events scheduled.";
    
        const schedule = data.schedule.days
          .slice(0, 3)
          .map((day) => {
            const slots = day.stages
              .map((stage, i) => (stage.length ? `  Stage ${i + 1}: ${stage.join(", ")}` : null))
              .filter(Boolean)
              .join("\n");
            return `**${day.name} (${day.date})**\n${slots || "  No slots"}`;
          })
          .join("\n\n");
    
        return {
          content: [
            {
              type: "text",
              text: [
                `## ⚡ Load Shedding Schedule — ${data.info.name}`,
                `Region: ${data.info.region}`,
                "",
                "### Upcoming Events",
                events,
                "",
                "### Schedule (next 3 days)",
                schedule,
              ].join("\n"),
            },
          ],
        };
      }
    );
  • The async handler function for get_area_schedule. It calls client.getAreaInfo(area_id, test), maps events into a formatted list, slices schedule.days to 3 days with stage slots, and returns text content with the area name, region, upcoming events, and schedule.
    async ({ area_id, test }) => {
      const data = await client.getAreaInfo(area_id, test);
    
      const events = data.events.length
        ? data.events
            .map((e) => `- 🚫 **${e.note}**\n  From: ${e.start}\n  Until: ${e.end}`)
            .join("\n")
        : "✅ No upcoming load shedding events scheduled.";
    
      const schedule = data.schedule.days
        .slice(0, 3)
        .map((day) => {
          const slots = day.stages
            .map((stage, i) => (stage.length ? `  Stage ${i + 1}: ${stage.join(", ")}` : null))
            .filter(Boolean)
            .join("\n");
          return `**${day.name} (${day.date})**\n${slots || "  No slots"}`;
        })
        .join("\n\n");
    
      return {
        content: [
          {
            type: "text",
            text: [
              `## ⚡ Load Shedding Schedule — ${data.info.name}`,
              `Region: ${data.info.region}`,
              "",
              "### Upcoming Events",
              events,
              "",
              "### Schedule (next 3 days)",
              schedule,
            ].join("\n"),
          },
        ],
      };
    }
  • Input validation schema for get_area_schedule: area_id (string, required) and test (boolean, optional, default false).
      area_id: z
        .string()
        .describe("The area ID from search_areas (e.g. 'eskmo-7-stellenboschstellenboschwestern-cape')"),
      test: z
        .boolean()
        .optional()
        .default(false)
        .describe("Use test data (does not count against your quota)"),
    },
  • The EskomSePushClient.getAreaInfo() method that makes the actual HTTP GET request to /area endpoint with the area ID.
    async getAreaInfo(id: string, test = false): Promise<AreaInfo> {
      const params: Record<string, string> = { id };
      if (test) params.test = "current";
      const { data } = await this.http.get<AreaInfo>("/area", { params });
      return data;
    }
  • Type definitions for the AreaInfo interface (events, info.name, info.region, schedule.days) used by get_area_schedule.
    export interface AreaInfo {
      events: AreaEvent[];
      info: { name: string; region: string };
      schedule: { days: AreaDay[]; source: string };
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It implies a read-only operation but does not disclose behaviors such as authentication requirements, rate limits, or error handling. The description is adequate but lacks depth for a tool with no annotations.

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?

Two sentences, no wasted words. The first sentence states the purpose, the second provides usage guidance. Highly concise and front-loaded.

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

Completeness3/5

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

No output schema exists, so the description should explain return values. It mentions 'schedule and events' but lacks specifics on the structure or content of the response. Parameter documentation is sufficient, but the return format is vague.

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?

Schema coverage is 100% with both parameters having descriptions. The description adds context by reiterating the prerequisite and tool to obtain area_id, but adds little beyond the schema's own descriptions. Baseline 3 is appropriate.

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 tool retrieves 'upcoming load shedding schedule and events for a specific area', uses a specific verb ('Get'), and distinguishes from siblings by directing users to search_areas for obtaining an area ID.

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

Usage Guidelines5/5

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

The description explicitly states the prerequisite (area ID) and directs users to search_areas if they lack one, providing clear when-to-use and alternative guidance.

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/zukhanyendiki9-code/eskomsepush-mcp'

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