get_latest

Pack: openaq · Endpoint: https://gateway.pipeworx.io/openaq/mcp

Get the latest reading for every pollutant at a specific OpenAQ station (by location id from find_stations). Returns each parameter (PM2.5, O3, NO2, etc.) with its value, units, and measurement time.

Parameters

NameTypeRequiredDescription
location_idnumberyesOpenAQ location/station id (from find_stations or air_quality_near).
_apiKeystringnoOpenAQ API key (optional; the gateway supplies one).

Example call

Arguments

{
  "country": "US",
  "limit": 10
}

curl

curl -X POST https://gateway.pipeworx.io/openaq/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_latest","arguments":{"country":"US","limit":10}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_latest', {
  "country": "US",
  "limit": 10
});

More examples

{
  "country": "IN",
  "limit": 25
}

Response shape

Always returns: count, stations

FieldTypeDescription
countnumberNumber of stations returned
stationsarrayList of air quality stations with latest measurements
Full JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "number",
      "description": "Number of stations returned"
    },
    "stations": {
      "type": "array",
      "description": "List of air quality stations with latest measurements",
      "items": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "Station location name"
          },
          "city": {
            "type": "string",
            "description": "City where station is located"
          },
          "country": {
            "type": "string",
            "description": "Country where station is located"
          },
          "coordinates": {
            "type": "object",
            "properties": {
              "latitude": {
                "type": "number",
                "description": "Latitude coordinate"
              },
              "longitude": {
                "type": "number",
                "description": "Longitude coordinate"
              }
            },
            "required": [
              "latitude",
              "longitude"
            ]
          },
          "measurements": {
            "type": "array",
            "description": "Current pollutant measurements",
            "items": {
              "type": "object",
              "properties": {
                "parameter": {
                  "type": "string",
                  "description": "Pollutant parameter name"
                },
                "value": {
                  "type": "number",
                  "description": "Measured value"
                },
                "unit": {
                  "type": "string",
                  "description": "Unit of measurement"
                },
                "lastUpdated": {
                  "type": "string",
                  "description": "ISO timestamp of last update"
                }
              },
              "required": [
                "parameter",
                "value",
                "unit",
                "lastUpdated"
              ]
            }
          }
        },
        "required": [
          "location",
          "city",
          "country",
          "coordinates",
          "measurements"
        ]
      }
    }
  },
  "required": [
    "count",
    "stations"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "openaq": {
      "url": "https://gateway.pipeworx.io/openaq/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build July 21, 2026