Skip to main content
Glama

Get Aqi By City

get_aqi_by_city
Read-onlyIdempotent

Real-time AQI for a city. Returns AQI value, dominant pollutant, individual pollutant readings (PM2.5, PM10, O3, NO2, SO2, CO), temperature/humidity/pressure, and station info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityYesCity name (e.g., "beijing", "los-angeles", "new-delhi")

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
aqiYesAir Quality Index value
stationYes
categoryYesAQI category (Good/Moderate/Unhealthy/Hazardous)
timezoneYesTimezone of station
measured_atYesISO timestamp of measurement
attributionsYesData sources and attributions
measurementsYes
dominant_pollutantYesPrimary pollutant causing poor air quality

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "city": "beijing"
      +  },
      +  {
      +    "city": "new-delhi"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "aqi": {
      +      "description": "Air Quality Index value",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "attributions": {
      +      "description": "Data sources and attributions",
      +      "items": {
      +        "properties": {
      +          "name": {
      +            "description": "Attribution source name",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "url": {
      +            "description": "Attribution source URL",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "category": {
      +      "description": "AQI category (Good/Moderate/Unhealthy/Hazardous)",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "dominant_pollutant": {
      +      "description": "Primary pollutant causing poor air quality",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "measured_at": {
      +      "description": "ISO timestamp of measurement",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "measurements": {
      +      "properties": {
      +        "co": {
      +          "description": "Carbon monoxide in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "humidity_pct": {
      +          "description": "Humidity percentage",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "no2": {
      +          "description": "Nitrogen dioxide in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "o3": {
      +          "description": "Ozone concentration in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "pm10": {
      +          "description": "PM10 concentration in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "pm25": {
      +          "description": "PM2.5 concentration in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "pressure_hpa": {
      +          "description": "Atmospheric pressure in hPa",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "so2": {
      +          "description": "Sulfur dioxide in µg/m³",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "temperature_c": {
      +          "description": "Temperature in Celsius",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "wind_speed": {
      +          "description": "Wind speed",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "station": {
      +      "properties": {
      +        "id": {
      +          "description": "Station identifier",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "latitude": {
      +          "description": "Station latitude",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "longitude": {
      +          "description": "Station longitude",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "description": "Station/city name",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "url": {
      +          "description": "Station information URL",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "timezone": {
      +      "description": "Timezone of station",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "aqi",
      +    "category",
      +    "dominant_pollutant",
      +    "station",
      +    "measurements",
      +    "measured_at",
      +    "timezone",
      +    "attributions"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive nature. The description adds value by specifying that the data is real-time and detailing the exact return fields (pollutants, weather, station info), which goes beyond the annotations. It does not disclose limitations like city-matching behavior or error handling, but the annotations lower the bar for safety-related transparency.

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 sentence that front-loads the core purpose ('Real-time AQI for a city') and then efficiently lists required outputs. Every element earns its place, no redundant or filler content.

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 read-only nature, one parameter, rich annotations, and an output schema, the description is largely complete. It lists all key return fields. However, it omits any caveats such as city name normalization or fallback behavior if a city isn't found, which would make it fully comprehensive. Still, for this complexity level, it's nearly complete.

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 schema has full coverage (100%) for the single 'city' parameter, including an example and format hint. The description adds no additional parameter semantics beyond the schema, so baseline 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 clearly states the resource (real-time AQI for a city) and lists specific outputs (AQI value, dominant pollutant, individual pollutant readings, weather, station info). It distinguishes from siblings like get_aqi_by_location and get_aqi_by_station by explicitly focusing on city-level granularity.

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

Usage Guidelines3/5

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

Usage is implied: use this tool when you have a city name. However, the description provides no explicit when-to-use or when-not-to-use guidance, and doesn't reference alternative tools like get_aqi_by_location or get_aqi_by_station. Clear context but no exclusions or alternatives, leaving some ambiguity for an AI agent deciding between siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.