gfw_query
Pack: global-forest-watch · Endpoint: https://gateway.pipeworx.io/global-forest-watch/mcp
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/gfw_query for the schema, then POST the same URL with its arguments for the data.
Run a read-only SQL SELECT against one Global Forest Watch dataset version — e.g. tree cover loss hectares by country and year, or deforestation alerts inside a bounding box. The table is always called data; use gfw_dataset to see the available columns first. Requires your own free GFW API key, passed as _apiKey.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dataset | string | yes | Dataset name, e.g. “umd_tree_cover_loss”. |
version | string | no | Version, e.g. “latest” or “v1.13”. Default “latest”. |
sql | string | yes | A SELECT statement over the table data, e.g. “SELECT iso, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year = 2023 GROUP BY iso”. SELECT only; a LIMIT is appended if you omit one. |
limit | number | no | Row cap appended when your SQL has no LIMIT (1-1000, default 100). |
_apiKey | string | yes | Your own Global Forest Watch API key (BYO). ${KEY_HELP} |
Example call
Arguments
{
"dataset": "umd_tree_cover_loss",
"sql": "SELECT iso, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year = 2023 GROUP BY iso",
"_apiKey": "your-global-forest-watch-api-key"
}
curl
curl -X POST https://gateway.pipeworx.io/global-forest-watch/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gfw_query","arguments":{"dataset":"umd_tree_cover_loss","sql":"SELECT iso, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year = 2023 GROUP BY iso","_apiKey":"your-global-forest-watch-api-key"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('gfw_query', {
"dataset": "umd_tree_cover_loss",
"sql": "SELECT iso, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year = 2023 GROUP BY iso",
"_apiKey": "your-global-forest-watch-api-key"
});
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"global-forest-watch": {
"url": "https://gateway.pipeworx.io/global-forest-watch/mcp"
}
}
}
See Getting Started for client-specific install steps.