Skip to main content
Glama

Gfw Query

gfw_query
Read-onlyIdempotent

Run a read-only SQL SELECT against one Global Forest Watch dataset version — e.g. tree cover loss hectares by year inside an area, or deforestation alerts inside a bounding box. The table is always called data; use gfw_dataset to see the available columns first. Almost every GFW dataset (tree cover loss/gain, GLAD/RADD alerts, fire alerts, carbon, primary forest) is a RASTER TILE SET, not a plain table — a geometry (GeoJSON Polygon/MultiPolygon) is REQUIRED to scope the pixels queried, or the API answers 422 "Raster tile set queries require a geometry". Omit it only for the few vector-table datasets (e.g. wdpa_protected_areas). Requires your own free GFW API key, passed as _apiKey.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA SELECT statement over the table `data`, e.g. "SELECT umd_tree_cover_loss__year, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year > 0 GROUP BY umd_tree_cover_loss__year". SELECT only; a LIMIT is appended if you omit one.
limitNoRow cap appended when your SQL has no LIMIT (1-1000, default 100).
_apiKeyYesYour own Global Forest Watch API key (BYO). Get one free at globalforestwatch.org: create an account, then POST /auth/token followed by POST /auth/apikey on data-api.globalforestwatch.org to mint an x-api-key.
datasetYesDataset name, e.g. "umd_tree_cover_loss".
versionNoVersion, e.g. "latest" or "v1.13". Default "latest".
geometryNoGeoJSON Polygon or MultiPolygon ({"type":"Polygon","coordinates":[...]}) scoping the query spatially. REQUIRED for raster tile set datasets — which is most of them; see gfw_dataset's version_assets. Example, a ~0.2° box over Rondônia, Brazil: {"type":"Polygon","coordinates":[[[-63.0,-9.0],[-62.8,-9.0],[-62.8,-8.8],[-63.0,-8.8],[-63.0,-9.0]]]}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false, so the safety profile is known. The description adds substantial behavior beyond that: the API returns 422 if geometry is omitted for raster tile sets, the geometry is required to scope pixel queries, and a BYO API key is mandatory. These are critical runtime behaviors not captured by annotations, justifying a score above the baseline.

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 three sentences of dense, essential information. The purpose is front-loaded, the geometry requirement is placed prominently, and every clause earns its place: no filler, no repetition of schema content. The length is appropriate given the tool's complexity.

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 tool with no output schema, the description adequately conveys expected results through examples (hectares by year, alerts in a bounding box) and warns of the 422 failure mode. It covers the key pitfalls (table name, geometry, API key) and prerequisites (gfw_dataset). It could explicitly state the return format or pagination, but this is a minor gap given the query context and the schema's limit parameter.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds value by clarifying the table is always called `data` (redundant with schema but reinforces), and—more importantly—explains the geometry parameter's requirement for most datasets, including the exact consequence (422) and the exception for vector tables. This goes beyond the schema's generic description of geometry as a GeoJSON polygon.

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 opens with a clear, specific verb–resource pair: 'Run a read-only SQL SELECT against one Global Forest Watch dataset version,' then gives concrete examples (tree cover loss hectares, deforestation alerts) and names the table `data`. It also implicitly differentiates from gfw_dataset by instructing the agent to use that tool for columns, so siblings are distinguishable.

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 actionable context: 'use gfw_dataset to see the available columns first' and explains when geometry is required (raster tile sets) versus when to omit it (vector tables like wdpa_protected_areas). It does not explicitly enumerate alternative tools, but the pruning of `gfw_dataset` as a prerequisite and the raster/vector guidance are sufficient for correct selection. Exclusions are clear but not exhaustive (e.g., no mention of `gfw_datasets` for listing datasets).

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.