Skip to main content
Glama

get_air_quality

Retrieve Swiss air quality data for specific monitoring stations, including location details, environmental type, legal limits, and live data portal links.

Instructions

Get information about a Swiss NABEL air quality monitoring station, including location, environment type, Swiss legal limits (LRV), and a direct link to the BAFU live data portal. Use station codes from list_air_quality_stations (e.g. BER=Bern, ZUE=Zürich, LUG=Lugano).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stationYesNABEL station code (e.g. BER, ZUE, LUG, BAS, DAV). Use list_air_quality_stations for all codes.

Implementation Reference

  • Implementation of the 'get_air_quality' tool handler logic.
    case "get_air_quality": {
      const code = normalizeStationCode(args.station as string);
      const local = NABEL_STATIONS[code];
    
      if (!local) {
        const knownCodes = Object.keys(NABEL_STATIONS).join(", ");
        throw new Error(
          `Unknown NABEL station code "${code}". Known stations: ${knownCodes}. ` +
            `Use list_air_quality_stations to see all options.`
        );
      }
    
      // Optionally enrich from live geo.admin.ch API (non-blocking fallback)
      let apiName: string | undefined;
      try {
        const feature = await fetchStationFromApi(code);
        apiName = feature?.attributes?.name;
      } catch {
        // continue with local data
      }
    
      const stationName = apiName ?? local.name;
    
      return JSON.stringify({
        station: code,
        name: stationName,
        canton: local.canton,
        coordinates: { lat: local.lat, lon: local.lon },
        altitude_m: local.altitude_m,
        environment: local.environment,
        network: "NABEL",
        operator: "BAFU / EMPA",
        source: "geo.admin.ch — ch.bafu.nabelstationen",
        data_note:
          "Live NABEL measurements (PM10, PM2.5, O3, NO2, SO2) are published on the BAFU data portal. " +
          "No public REST API for real-time values — use the portal link below.",
        live_data_portal: "https://www.bafu.admin.ch/bafu/en/home/topics/air/state/data/nabel.html",
        swiss_legal_limits_lrv: SWISS_LIMITS,
        limits_reference: "LRV (Luftreinhalteordnung / Swiss Clean Air Act, Annex 7)",
      });
    }
  • Tool definition and schema for 'get_air_quality'.
    {
      name: "get_air_quality",
      description:
        "Get information about a Swiss NABEL air quality monitoring station, including location, environment type, Swiss legal limits (LRV), and a direct link to the BAFU live data portal. Use station codes from list_air_quality_stations (e.g. BER=Bern, ZUE=Zürich, LUG=Lugano).",
      inputSchema: {
        type: "object",
        required: ["station"],
        properties: {
          station: {
            type: "string",
            description:
              "NABEL station code (e.g. BER, ZUE, LUG, BAS, DAV). Use list_air_quality_stations for all codes.",
          },
        },
      },
    },
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 describes what information is returned (location, environment type, legal limits, live data link), which is useful. However, it lacks details on behavioral traits such as rate limits, error handling, or data freshness, which are important for a data retrieval tool. The description doesn't contradict any annotations (since none exist).

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 front-loaded with the core purpose, followed by usage instructions and examples. Every sentence earns its place by providing essential information without redundancy, making it efficient and well-structured.

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 tool's moderate complexity (single parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and parameter semantics effectively. However, it could improve by mentioning output format or any limitations (e.g., data availability), though the lack of output schema means some gaps are expected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'station' parameter. The description adds value by explaining the semantics: station codes come from 'list_air_quality_stations' and provides examples (BER=Bern, ZUE=Zürich, LUG=Lugano), which clarifies usage beyond the schema's basic description. With only one parameter, this is sufficient for a high score.

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 specific action ('Get information about') and resource ('Swiss NABEL air quality monitoring station'), including detailed content (location, environment type, legal limits, live data link). It distinguishes from the sibling tool 'list_air_quality_stations' by specifying that tool provides station codes, while this one retrieves detailed information for a specific station.

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?

Explicit guidance is provided: use station codes from 'list_air_quality_stations' (e.g., BER, ZUE, LUG), and examples are given. This clearly indicates when to use this tool (for detailed station info) versus the sibling tool (for listing station codes), with no ambiguity.

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