get_status
Check the current national load shedding stage for Eskom and Cape Town to know the active stage right now.
Instructions
Get the current national load shedding stage for both Eskom and Cape Town. Use this to find out what stage we are on right now.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test | No | Use test data instead of live data (does not count against your quota) |
Implementation Reference
- src/client.ts:60-64 (handler)The actual implementation of getStatus — calls the EskomSePush API /status endpoint and returns the load shedding status (Eskom + Cape Town stages).
async getStatus(test = false): Promise<LoadSheddingStatus> { const params = test ? { test: "current" } : {}; const { data } = await this.http.get<LoadSheddingStatus>("/status", { params }); return data; } - src/client.ts:3-8 (schema)Type definition (LoadSheddingStatus) returned by getStatus, containing eskom and capetown status objects with name, stage, and stage_updated fields.
export interface LoadSheddingStatus { status: { capetown: { name: string; stage: string; stage_updated: string }; eskom: { name: string; stage: string; stage_updated: string }; }; } - src/index.ts:24-57 (registration)Tool registration via server.tool('get_status', ...) with Zod schema for optional 'test' parameter and handler that calls client.getStatus() and formats the result.
server.tool( "get_status", "Get the current national load shedding stage for both Eskom and Cape Town. Use this to find out what stage we are on right now.", { test: z .boolean() .optional() .default(false) .describe("Use test data instead of live data (does not count against your quota)"), }, async ({ test }) => { const data = await client.getStatus(test); const { eskom, capetown } = data.status; return { content: [ { type: "text", text: [ "## 🔌 Current Load Shedding Status", "", `**Eskom (National)**`, ` Stage: ${eskom.stage || "None (No load shedding)"}`, ` Last updated: ${eskom.stage_updated}`, "", `**City of Cape Town**`, ` Stage: ${capetown.stage || "None (No load shedding)"}`, ` Last updated: ${capetown.stage_updated}`, ].join("\n"), }, ], }; } );