Skip to main content
Glama

get_air_quality_history

Read-only

Retrieve historical air quality data stored on the device's SD card. Filter by time range, select specific sensors, and control response size with downsampling.

Instructions

Get historical air quality data stored on the device's SD card.

IMPORTANT — 'sensors' must be a JSON array, not a plain string.
  Correct:   sensors=["pm1","pm2_5"]
  Wrong:     sensors="pm1"

IMPORTANT — response size: air-Q records every ~2 minutes, so long ranges
produce large responses (24 h ≈ 720 readings × ~25 sensors). Always use
'sensors' and 'max_points' when querying more than 1–2 hours to stay within
response size limits. Example for a 24 h chart: sensors=["pm1","pm2_5","pm10"],
max_points=150.

Time range — specify one of:
- 'last_hours' — data from the last N hours (default: 1 hour)
- 'from_datetime' / 'to_datetime' — ISO 8601 strings
  (e.g. "2026-03-10T14:00:00" or "2026-03-10T14:00:00+01:00")
  'from_datetime' takes precedence over 'last_hours'.
  'to_datetime' defaults to now.
- 'timezone_name' — optional IANA timezone such as "Europe/Berlin".
  Naive datetimes are interpreted in this timezone. Output timestamps are
  localized into `datetime` using the same timezone.

Optional filtering:
- 'sensors' — list of sensor names to include (e.g. ["pm1", "pm2_5", "pm10"]).
  Omit to get all sensors.
- 'max_points' — downsample to at most this many evenly spaced points.

Response: column-oriented JSON with `timestamp` (Unix seconds) and localized
`datetime` columns. Compound sensor values like `[value, quality]` are split
into `<sensor>` and `<sensor>_quality`. Includes `_sensor_guide` and
`_history_guide`.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNo
last_hoursNo
from_datetimeNo
to_datetimeNo
sensorsNo
max_pointsNo
timezone_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Goes beyond readOnlyHint and destructiveHint annotations: describes response size implications, sensors format (must be JSON array), timezone handling, response structure (timestamp, datetime, quality columns). No contradiction with annotations.

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?

Well-structured with sections and bullet points; every sentence adds value. Slightly verbose but appropriate for the complexity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 7 parameters (0 required) and output schema present, description covers all necessary information: parameter semantics, response format, and important caveats. No gaps for agent to select and invoke correctly.

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

Parameters5/5

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

With 0% schema coverage, description fully explains all 7 parameters: time range options, sensor filtering, max_points downsampling, device, timezone_name. Includes examples and important formatting notes for sensors parameter.

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?

Clearly states 'Get historical air quality data stored on the device's SD card.' Uses specific verb and resource, and distinguishes from siblings like get_air_quality (real-time) and export_air_quality_history.

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?

Provides detailed when-to-use guidance: warns about response size, explains time range options, and gives examples. Lacks explicit exclusion for alternatives but context is clear.

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/CorantGmbH/mcp-airq'

If you have feedback or need assistance with the MCP directory API, please join our Discord server