Skip to main content
Glama

get_solar_potential

Calculate rooftop solar energy potential for Swiss locations using latitude and longitude coordinates to assess renewable energy feasibility.

Instructions

Get rooftop solar energy potential for a location in Switzerland

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude (WGS84)
lngYesLongitude (WGS84)

Implementation Reference

  • The implementation of the get_solar_potential tool logic. It queries the swisstopo identify service for the 'ch.bfe.solarenergie-eignung-daecher' layer and aggregates the results by building.
    case "get_solar_potential": {
      const lat = args.lat as number;
      const lng = args.lng as number;
      // Use tight tolerance to get only the closest building
      const extent = `${lng - 0.001},${lat - 0.001},${lng + 0.001},${lat + 0.001}`;
      const url = buildUrl(`${BASE}/rest/services/all/MapServer/identify`, {
        geometry: `${lng},${lat}`,
        geometryType: "esriGeometryPoint",
        layers: "all:ch.bfe.solarenergie-eignung-daecher",
        mapExtent: extent,
        imageDisplay: "500,500,96",
        tolerance: 10,
        sr: 4326,
        returnGeometry: false,
      });
      const data = await fetchJSON<IdentifyResponse>(url);
      const roofs = data.results.map(slimSolarResult);
    
      // Group by building and summarize
      const buildingMap = new Map<number, typeof roofs>();
      for (const r of roofs) {
        const id = r.buildingId;
        if (!buildingMap.has(id)) buildingMap.set(id, []);
        buildingMap.get(id)!.push(r);
      }
    
      const buildings = [...buildingMap.entries()].map(([buildingId, surfaces]) => ({
        buildingId,
        totalArea_m2: Math.round(surfaces.reduce((s, r) => s + (r.area_m2 ?? 0), 0)),
        totalElectricity_kWh: Math.round(surfaces.reduce((s, r) => s + (r.electricityYield_kWh ?? 0), 0)),
        totalFinancialReturn_CHF: Math.round(surfaces.reduce((s, r) => s + (r.financialReturn_CHF ?? 0), 0)),
        roofSurfaces: surfaces.length,
        bestClass: Math.min(...surfaces.map((r) => r.class).filter((c) => c != null)),
        surfaces: surfaces.slice(0, 5), // Cap at 5 surfaces per building
      }));
    
      return JSON.stringify({
        count: buildings.length,
        buildings: buildings.slice(0, 10), // Cap at 10 buildings
        source: "Swiss Federal Office of Energy (BFE)",
      });
    }
  • Tool definition and input schema for 'get_solar_potential' in the geodataTools array.
      name: "get_solar_potential",
      description: "Get rooftop solar energy potential for a location in Switzerland",
      inputSchema: {
        type: "object",
        required: ["lat", "lng"],
        properties: {
          lat: { type: "number", description: "Latitude (WGS84)" },
          lng: { type: "number", description: "Longitude (WGS84)" },
        },
      },
    },
  • Registration of geodata tools, including 'get_solar_potential'.
    export const geodataTools = [
Behavior2/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 of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but does not specify behavioral traits such as rate limits, authentication requirements, data freshness, error handling, or output format. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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, efficient sentence that front-loads the core purpose without unnecessary words. It directly states what the tool does and its scope ('in Switzerland'), with zero waste or redundancy. This is appropriately sized for a simple lookup tool.

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?

Given the tool's moderate complexity (a location-based query with no output schema and no annotations), the description is minimally complete. It covers the purpose and scope but lacks details on behavioral aspects, output format, or usage context. Without annotations or output schema, the description should do more to compensate, but it provides a basic foundation.

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 has 100% description coverage, with parameters 'lat' and 'lng' clearly documented as 'Latitude (WGS84)' and 'Longitude (WGS84).' The description adds no additional parameter semantics beyond what the schema provides, such as valid ranges or units. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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

Purpose4/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: 'Get rooftop solar energy potential for a location in Switzerland.' It specifies the verb ('Get'), resource ('rooftop solar energy potential'), and geographic scope ('Switzerland'), which is specific and actionable. However, it does not explicitly differentiate from sibling tools, as none appear to directly overlap in function (e.g., no other solar-related tools are listed).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., location accuracy needs), exclusions (e.g., non-Switzerland locations), or comparisons to sibling tools (e.g., whether other tools like 'get_weather' might provide related data). Usage is implied only by the tool's name and description, lacking explicit context.

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