Skip to main content
Glama

search_areas

Search for load shedding areas by name or suburb to retrieve area IDs, enabling schedule lookups.

Instructions

Search for load shedding areas by name or suburb. Returns area IDs you can use with get_area_schedule. Always search first if you don't have an area ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesSuburb, city, or area name to search for (e.g. 'Stellenbosch', 'Sandton', 'Ballito')
testNoUse test data (does not count against your quota)

Implementation Reference

  • src/index.ts:59-98 (registration)
    The search_areas tool is registered with the MCP server. It accepts a 'text' (area name to search) and optional 'test' boolean. Calls client.searchAreas() and formats the results.
    // ── Tool 2: Search for areas ─────────────────────────────────────────────────
    server.tool(
      "search_areas",
      "Search for load shedding areas by name or suburb. Returns area IDs you can use with get_area_schedule. Always search first if you don't have an area ID.",
      {
        text: z.string().describe("Suburb, city, or area name to search for (e.g. 'Stellenbosch', 'Sandton', 'Ballito')"),
        test: z
          .boolean()
          .optional()
          .default(false)
          .describe("Use test data (does not count against your quota)"),
      },
      async ({ text, test }) => {
        const data = await client.searchAreas(text, test);
    
        if (!data.areas.length) {
          return {
            content: [{ type: "text", text: `No areas found for "${text}". Try a broader search term.` }],
          };
        }
    
        const list = data.areas
          .map((a) => `- **${a.name}** (${a.region})\n  ID: \`${a.id}\``)
          .join("\n");
    
        return {
          content: [
            {
              type: "text",
              text: [
                `## 🔍 Areas matching "${text}"`,
                "",
                list,
                "",
                "Use the area ID with `get_area_schedule` to see upcoming load shedding events.",
              ].join("\n"),
            },
          ],
        };
      }
  • The handler function for search_areas tool. Calls the client, handles empty results, formats a markdown list of areas with name, region, and ID, and returns a text content block.
    async ({ text, test }) => {
      const data = await client.searchAreas(text, test);
    
      if (!data.areas.length) {
        return {
          content: [{ type: "text", text: `No areas found for "${text}". Try a broader search term.` }],
        };
      }
    
      const list = data.areas
        .map((a) => `- **${a.name}** (${a.region})\n  ID: \`${a.id}\``)
        .join("\n");
    
      return {
        content: [
          {
            type: "text",
            text: [
              `## 🔍 Areas matching "${text}"`,
              "",
              list,
              "",
              "Use the area ID with `get_area_schedule` to see upcoming load shedding events.",
            ].join("\n"),
          },
        ],
      };
    }
  • The EskomSePushClient.searchAreas method. Sends a GET request to /areas_search with the text query and optional test parameter, returning AreasSearchResult which contains an array of Area objects (id, name, region).
    async searchAreas(text: string, test = false): Promise<AreasSearchResult> {
      const params: Record<string, string> = { text };
      if (test) params.test = "true";
      const { data } = await this.http.get<AreasSearchResult>("/areas_search", { params });
      return data;
    }
  • Type definitions for search_areas responses: Area (id, name, region) and AreasSearchResult wrapping an array of Areas.
    export interface Area {
      id: string;
      name: string;
      region: string;
    }
    
    export interface AreasSearchResult {
      areas: Area[];
    }
Behavior4/5

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

Without annotations, the description carries the full burden. It discloses that the tool returns area IDs (non-destructive read), and mentions the test parameter behavior. This is good, but could elaborate on error handling or rate limits.

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, front-loaded with purpose, and no unnecessary words. Every sentence provides value: the first defines what it does, the second gives usage guidance.

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

Completeness5/5

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

Given no output schema and full parameter coverage, the description is complete. It explains the input format, output utility, and usage context. An agent can correctly invoke this tool without ambiguity.

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% and both parameter descriptions are clear. The description adds no extra meaning beyond what the schema provides for parameters, but it does explain the output purpose.

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's purpose: searching for load shedding areas by name or suburb. It specifies the output (area IDs) and how it connects to another tool (get_area_schedule). This distinguishes it from siblings like get_areas_nearby or get_area_schedule.

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 explicitly advises 'Always search first if you don't have an area ID,' which tells the agent when to use this tool. It implies that if an area ID is known, use get_area_schedule instead. This provides clear context but could be more explicit about alternatives.

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