get-contour-maps-by-bounding-box-combined-ozone-pm25
Generate combined Ozone and PM2.5 contour maps in KML format for a specified geographic bounding box and timeframe using real-time or historical air quality data.
Instructions
Get current or historical combined Ozone and PM2.5 contour maps in KML by geographic bounding box.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox | Yes | Geographic bounding box of the area of interest in latitude and longitude. Format: minX,minY,maxX,maxY. Example: -118,34,-71,42 | |
| date | Yes | The date and hour of the data (in UTC). Time represents the beginning of the measurement period. Format: yyyy-mm-ddTHH. Example: January 1, 2012 at 1PM would be formatted as: 2012-01-01T13 and represents data measured between 1:00 PM-1:59 PM UTC | |
| srs | Yes | The coordinate system of the bounding box. Format: The well-known text or EPSG code. Default: EPSG:4326. Example: EPSG:4326 |
Implementation Reference
- Full tool registration including name, description, schema, and handler function.export const registerContourMapsByBoundingBoxCombined = (server: McpServer): void => { server.tool( "get-contour-maps-by-bounding-box-combined-ozone-pm25", "Get current or historical combined Ozone and PM2.5 contour maps in KML by geographic bounding box.", { date: z .string() .describe( "The date and hour of the data (in UTC). Time represents the beginning of the measurement period. Format: yyyy-mm-ddTHH. Example: January 1, 2012 at 1PM would be formatted as: 2012-01-01T13 and represents data measured between 1:00 PM-1:59 PM UTC" ), bbox: z .string() .describe( "Geographic bounding box of the area of interest in latitude and longitude. Format: minX,minY,maxX,maxY. Example: -118,34,-71,42" ), srs: z .string() .describe( "The coordinate system of the bounding box. Format: The well-known text or EPSG code. Default: EPSG:4326. Example: EPSG:4326" ), }, async (params) => { const result = await airnowApi.fetchContourMapsByBoundingBoxCombinedOzonePM25(params); if (result === null) { return { content: [ { type: "text", text: "Failed to fetch contour maps data from AirNow API.", }, ], isError: true, }; } return { content: [ { type: "text", text: result, }, ], }; } ); };
- src/airnow-api.ts:124-132 (handler)Core handler logic that performs the HTTP request to AirNow API for combined Ozone and PM2.5 contour maps KML data.export async function fetchContourMapsByBoundingBoxCombinedOzonePM25(params: Record<string, string>): Promise<string | null> { const endpoint = 'aq/kml/combined/'; const queryParams = new URLSearchParams(); queryParams.append('date', params.date); queryParams.append('bbox', params.bbox); queryParams.append('srs', params.srs || 'EPSG:4326'); return airnowGet(endpoint, queryParams); }
- Zod schema defining the input parameters for the tool: date, bbox, and srs.{ date: z .string() .describe( "The date and hour of the data (in UTC). Time represents the beginning of the measurement period. Format: yyyy-mm-ddTHH. Example: January 1, 2012 at 1PM would be formatted as: 2012-01-01T13 and represents data measured between 1:00 PM-1:59 PM UTC" ), bbox: z .string() .describe( "Geographic bounding box of the area of interest in latitude and longitude. Format: minX,minY,maxX,maxY. Example: -118,34,-71,42" ), srs: z .string() .describe( "The coordinate system of the bounding box. Format: The well-known text or EPSG code. Default: EPSG:4326. Example: EPSG:4326" ), },
- src/tools/index.ts:13-24 (registration)Central registration function that calls the specific tool registration for this tool among others.export const registerTools = (server: McpServer): void => { registerContourMapsByBoundingBoxCombined(server); registerContourMapsByBoundingBoxOzone(server); registerContourMapsByBoundingBoxPM25(server); registerCurrentObservationsByZipCode(server); registerCurrentObservationsByLatLong(server); registerForecastByLatLong(server); registerForecastByZipCode(server); registerHistoricalObservationsByLatLong(server); registerHistoricalObservationsByZipCode(server); registerObservationsByBoundingBox(server); };
- src/index.ts:29-29 (registration)Main server initialization that triggers all tool registrations.registerTools(server);