Skip to main content
Glama

openaq-mcp-server: get measurements

openaq_get_measurements
Read-onlyIdempotent

Historical measurement series for one pollutant at one station over a date range — for trend analysis and "was last week worse than the monthly average?". Pass a locationId and a parametersId and work in stations — you get the series for that pollutant at that station. Choose aggregation: raw (every reported value), hourly, or daily — daily and hourly add a per-bucket statistical summary (min, median, max, mean, sd). Large ranges produce thousands of rows and spill to a DataCanvas: the response returns a preview plus a canvasId and table name you query with openaq_dataframe_query. Values carry their unit; the server never converts between µg/m³, ppm, and ppb.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows per page from the API (1–1000). Default 1000. The tool pages internally up to the spill threshold.
canvas_idNoDataCanvas id from a prior call to reuse the same canvas (e.g. to compare two stations' series side by side). Omit to start fresh; the response returns a new canvas_id when the series spills.
datetimeToNoEnd of the range, inclusive. Date "YYYY-MM-DD" covers that whole day (closes at 23:59:59Z) or full UTC "YYYY-MM-DDTHH:MM:SSZ". Must land after datetimeFrom — the two forms mix freely, so "2026-06-25" to "2026-06-25" is a valid one-day range. Omit for "up to now".
locationIdYesStation id from openaq_find_locations.
aggregationNoTime bucketing. "raw" = every reported value (often hourly at source). "hourly"/"daily" = server-side rollups with a statistical summary per bucket. Use "daily" for multi-month trends to keep the series small; "raw" for fine-grained recent analysis.raw
datetimeFromNoStart of the range, inclusive. Date "YYYY-MM-DD" (opens at 00:00:00Z that day) or full UTC "YYYY-MM-DDTHH:MM:SSZ". Omit to get the most recent values.
parametersIdYesParameter id to pull the series for (e.g. 2 = PM2.5 µg/m³). Get ids from openaq_list_parameters. Must be a parameter the station measures — find_locations lists each station's parameters.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoWhat limited this response, when something did — the row cap, a failed page, or DataCanvas being unavailable — plus how to reach the rest.
seriesNoThe (possibly previewed) series, newest or oldest first per the API. When truncated, this is a preview — query canvasId for the rows staged there.
canvasIdNoDataCanvas id holding the pulled series. Query with openaq_dataframe_query. The pull stops at 5000 rows, so this is the whole series only when totalCount is at or below that — read the notice, which says so when the cap or a failed page cut the pull short.
locationNoStation the series came from
rowCountNoRows in this response (preview length when spilled)
sensorIdNoResolved sensor id the series was pulled from
parameterNoWhat was measured, resolved from the station's sensor
tableNameNoCanvas table name for the staged series (e.g. "measurements_1701"). Reference it in SQL.
truncatedNoTrue when the series exceeded the inline limit, so series is a preview and the pulled rows were staged on canvasId. Absent/false when everything fit inline. It says nothing about whether the pull itself was complete — compare rowCount and totalCount, and read the notice.
totalCountNoTotal rows in the full series.
aggregationNoBucketing applied

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already carry readOnlyHint/openWorldHint/idempotentHint, lowering the burden. The description adds genuinely valuable non-obvious behavior beyond that: the DataCanvas spill mechanism (preview + canvasId + table name), internal paging up to a spill threshold, and the explicit unit non-conversion ('the server never converts between µg/m³, ppm, and ppb'). These give the agent actionable expectations not visible in annotations. It doesn't specify the exact spill threshold, a minor gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single dense paragraph, front-loaded with purpose before mechanics. Every sentence earns its place: use case, spill behavior, unit handling, and aggregation tradeoffs. Slightly run-on with semicolon/colon chains, but efficient overall and avoids redundancy with the schema.

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?

For a 7-parameter tool with an output schema, the description is strong: it covers the spill path (critical for large ranges), unit semantics, aggregation choice tradeoffs, and references openaq_find_locations/openaq_dataframe_query for id sourcing and follow-up. Since an output schema exists, return values need no explanation. Minor omissions are the exact spill threshold and explicit differentiation from get_readings.

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?

Schema description coverage is 100%, so the schema already documents every parameter thoroughly (datetime formats, defaults, limits, source of ids). The description adds some value — the per-bucket statistical summary composition (min, median, max, mean, sd) for hourly/daily aggregation, and the conceptual pairing of locationId+parametersId — but these are marginal additions over an already-rich schema.

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 states a specific verb and resource — 'Historical measurement series for one pollutant at one station over a date range' — and immediately gives the intended use cases ('trend analysis', 'was last week worse than the monthly average?'). The single-pollutant, single-station scope distinguishes it from broader siblings like get_readings, and the DataCanvas spill explicitly ties it to openaq_dataframe_query.

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

Usage Guidelines4/5

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

The description gives clear selection context: 'work in stations', trend-focused use, and concrete aggregation guidance ('Use "daily" for multi-month trends... "raw" for fine-grained recent analysis'). It also names openaq_dataframe_query as the follow-up when results spill. However, it never explicitly says when NOT to use this tool versus the sibling openaq_get_readings, so the routing guidance stops short of full exclusions.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool serves a distinct purpose: catalog discovery (list_countries, list_parameters), station lookup (find_locations), current data (get_readings), historical data (get_measurements), and DataCanvas query support (dataframe_describe, dataframe_query). No two tools overlap in function.

Naming Consistency4/5

The prefix 'openaq_' is consistent, and most tools follow a verb_noun pattern (find_locations, get_measurements, list_countries). However, 'dataframe_describe' and 'dataframe_query' invert this to noun_verb, a minor deviation that could confuse agents.

Tool Count5/5

Seven tools covers the full workflow (discover, locate, read current/historical, and handle large data) without redundancy. This is a well-scoped surface for an air quality data server.

Completeness5/5

The set provides end-to-end capability: metadata discovery, location search, current conditions, historical time series, and a mechanism for large SQL queries. No critical gaps like missing update/delete operations exist because the server is read-only by design.