Skip to main content
Glama

get_areas_nearby

Retrieve load shedding areas near specified GPS coordinates. Solves the problem of identifying the area name when only location coordinates are known.

Instructions

Find load shedding areas near a GPS location. Useful when you know coordinates but not the area name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude (e.g. -33.9249 for Cape Town)
lonYesLongitude (e.g. 18.4241 for Cape Town)
testNoUse test data (does not count against your quota)

Implementation Reference

  • src/index.ts:156-196 (registration)
    Tool registration of 'get_areas_nearby' on the MCP server. Defines the handler that receives {lat, lon, test} input, calls the API client, and formats the response.
    server.tool(
      "get_areas_nearby",
      "Find load shedding areas near a GPS location. Useful when you know coordinates but not the area name.",
      {
        lat: z.number().describe("Latitude (e.g. -33.9249 for Cape Town)"),
        lon: z.number().describe("Longitude (e.g. 18.4241 for Cape Town)"),
        test: z
          .boolean()
          .optional()
          .default(false)
          .describe("Use test data (does not count against your quota)"),
      },
      async ({ lat, lon, test }) => {
        const data = await client.getAreasNearby(lat, lon, test);
    
        if (!data.areas.length) {
          return {
            content: [{ type: "text", text: "No areas found near those coordinates." }],
          };
        }
    
        const list = data.areas
          .map((a) => `- **${a.name}** (${a.region})\n  ID: \`${a.id}\`  |  Nearby count: ${a.count}`)
          .join("\n");
    
        return {
          content: [
            {
              type: "text",
              text: [
                `## 📍 Areas near (${lat}, ${lon})`,
                "",
                list,
                "",
                "Use the area ID with `get_area_schedule` to see upcoming events.",
              ].join("\n"),
            },
          ],
        };
      }
    );
  • Input schema (Zod) for 'get_areas_nearby': lat (number), lon (number), and optional test (boolean) parameters.
    {
      lat: z.number().describe("Latitude (e.g. -33.9249 for Cape Town)"),
      lon: z.number().describe("Longitude (e.g. 18.4241 for Cape Town)"),
      test: z
        .boolean()
        .optional()
        .default(false)
        .describe("Use test data (does not count against your quota)"),
    },
  • Client method getAreasNearby that performs the HTTP GET request to /areas_nearby with lat/lon params, returning an AreasNearby response.
    async getAreasNearby(lat: number, lon: number, test = false): Promise<AreasNearby> {
      const params: Record<string, string | number> = { lat, lon };
      if (test) params.test = "true";
      const { data } = await this.http.get<AreasNearby>("/areas_nearby", { params });
      return data;
    }
  • Type definition for AreasNearby interface: an array of Area objects with an additional count field.
    export interface AreasNearby {
      areas: (Area & { count: number })[];
    }
Behavior2/5

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

No annotations are provided, so the description should disclose behavioral traits. It only describes the purpose and does not mention safety, side effects, authentication, or return behavior, leaving the agent uninformed about safe usage.

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 a single front-loaded sentence with no filler words. Every part contributes to understanding the tool's purpose.

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?

Given the simple tool (3 params, no output schema), the description adequately explains the primary use case and differentiates from siblings. It does not explain return values, but that is acceptable without an output schema.

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?

The input schema covers all 3 parameters with descriptions (100% coverage). The description does not add new meaning beyond the schema, so a baseline of 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 uses a specific verb 'Find' and resource 'load shedding areas', with clear context 'near a GPS location'. It effectively distinguishes from sibling 'search_areas', which presumably searches by area name.

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 states it is useful when coordinates are known but not the area name, suggesting use over 'search_areas'. However, it does not explicitly mention when not to use or list 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