# TerraLab documentation > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. TerraLab makes two kinds of products: QGIS plugins that bring AI into your GIS projects, and an MCP server and REST API that give AI agents and code geodata for any place. One account covers both. ## QGIS plugins AI inside QGIS, on your own layers. The models run on TerraLab servers: no GPU, no Python setup. - [Install and sign in](https://terra-lab.ai/docs/plugins/install) The plugin manager, the QGIS version each plugin needs, the browser sign-in. - [AI Agent](https://terra-lab.ai/docs/plugins/ai-agent) A GIS task done in your project from one sentence. - [AI Segmentation](https://terra-lab.ai/docs/plugins/ai-segmentation) Objects in imagery turned into polygons, from a click or a word. - [AI Edit](https://terra-lab.ai/docs/plugins/ai-edit) An aerial image changed from a plain-language instruction. ## MCP server and API 40 geodata tools for Claude, ChatGPT, Cursor and any agent, or for your code over HTTPS. Every result names its sources and licences. - [Quickstart](https://terra-lab.ai/docs/quickstart) A first call in under five minutes. - [Connect an agent](https://terra-lab.ai/docs/mcp) The command or link for Claude, ChatGPT, Claude Code, Codex, Cursor and VS Code. - [Authentication](https://terra-lab.ai/docs/authentication) API keys for code, OAuth sign-in for agents. - [API reference](https://terra-lab.ai/docs/api) Every tool with its parameters and samples in curl, Python and JavaScript. ## Help - [Pricing and free calls](https://terra-lab.ai/docs/pricing) 100 calls included every month, then pay per call. - [Errors and rate limits](https://terra-lab.ai/docs/errors) Every error code and what to do. - [Data sources and licences](https://terra-lab.ai/docs/data-sources) Where the data comes from. - [Support](https://terra-lab.ai/docs/support) Who answers and what to send. ## For AI agents Every page is also served as markdown: add `.md` to its URL, or send `Accept: text/markdown`. The index of all pages is [/docs/llms.txt](https://terra-lab.ai/docs/llms.txt), and every page in one file is [/docs/llms-full.txt](https://terra-lab.ai/docs/llms-full.txt). Source: https://terra-lab.ai/docs · Updated 2026-10-27 --- # QGIS plugins > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Three TerraLab plugins add AI to QGIS. AI Agent carries out a GIS task from one sentence, AI Segmentation turns imagery into vector polygons, and AI Edit changes what an image shows. The models run on TerraLab servers, so any work laptop that runs QGIS is enough: no GPU, no Python setup. ## Which plugin to use | You want to | Plugin | Free every month | | --- | --- | --- | | Get a task done in your project: find data, run processing, build the map | [AI Agent](https://terra-lab.ai/docs/plugins/ai-agent) | 5 tasks | | Outline buildings, trees, cars or any object in imagery as polygons | [AI Segmentation](https://terra-lab.ai/docs/plugins/ai-segmentation) | 1.5 km² (Automatic) and 20 cloud objects (Semi-Auto) | | Show a change on an aerial image: a project, trees, a clean site plan | [AI Edit](https://terra-lab.ai/docs/plugins/ai-edit) | 3 images | All three install from the official QGIS plugin repository and share one TerraLab account. See [Install and sign in](https://terra-lab.ai/docs/plugins/install). ## Plugins or MCP server The plugins work inside QGIS, on your own layers and project. The [MCP server](https://terra-lab.ai/docs/mcp) brings TerraLab data and GIS files to an AI agent such as Claude or ChatGPT, outside QGIS; its files then open in QGIS. Both use the same account. ## Plans Each plugin has a free allowance that renews every month and a Pro plan; one pack covers all three. Prices are on the [pricing page](https://terra-lab.ai/pricing), and AI Agent Pro starts with a 7-day free trial. Source: https://terra-lab.ai/docs/plugins · Updated 2026-11-15 --- # Install and sign in > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Install a TerraLab plugin from the QGIS plugin manager, then sign in once in your browser. It takes about a minute and needs no card. ## Requirements | Plugin | QGIS | System | | --- | --- | --- | | AI Agent | 3.28 or later | Windows, macOS or Linux, with an internet connection | | AI Segmentation | 3.22 or later | Windows, macOS or Linux, with an internet connection | | AI Edit | 3.22 or later | Windows, macOS or Linux, with an internet connection | No GPU and no Python package to install: the models run on TerraLab servers. Semi-Auto on My computer is the one exception: the first time, it installs its Python packages and downloads its model once. ## Install 1. In QGIS, open **Plugins**, **Manage and Install Plugins**. 2. Search for **AI Agent by TerraLab**, **AI Segmentation** or **AI Edit**. 3. Click **Install**. The search can also list plugins with similar names, such as QGIS Agent or QGIS AI Agent. They are not TerraLab plugins. Ours say **by TerraLab**. The same plugins can be downloaded as a zip from plugins.qgis.org: [AI Agent](https://plugins.qgis.org/plugins/AI_Agent/), [AI Segmentation](https://plugins.qgis.org/plugins/AI_Segmentation/), [AI Edit](https://plugins.qgis.org/plugins/AI_Edit/). In QGIS, **Install from ZIP** installs that file. ## Sign in 1. Open the plugin panel. AI Agent opens with `Ctrl+Shift+K`. 2. Click **Sign in**. Your browser opens terra-lab.ai. 3. Sign in or create a free account, confirm, and go back to QGIS. The account links itself and the free allowance shows in the panel. One account covers the three plugins, the [MCP server](https://terra-lab.ai/docs/mcp) and the API. Usage and plans are on your [dashboard](https://terra-lab.ai/dashboard). ## Update QGIS lists available updates under **Plugins**, **Manage and Install Plugins**, **Upgradeable**. Install them there; your sign-in is kept. ## When something goes wrong - A `DLL load failed` error on Windows: see [DLL load failed while importing _C](https://terra-lab.ai/blog/dll-load-failed-while-importing-c-qgis). - QGIS installed with Flatpak on Linux: see [No module named pip](https://terra-lab.ai/blog/qgis-flatpak-no-module-named-pip). - Anything else: write to [support](https://terra-lab.ai/docs/support). Source: https://terra-lab.ai/docs/plugins/install · Updated 2026-11-15 --- # AI Agent > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. AI Agent carries out a written GIS task in the QGIS project you have open. It finds the data, runs the processing and builds the map, and one click undoes anything it changed. ## Use it 1. Open the panel with `Ctrl+Shift+K` and sign in. See [Install and sign in](https://terra-lab.ai/docs/plugins/install). 2. Ask in one message, for example "Show the buildings of Sommières that stand in a flood zone." It already sees your layers, fields, coordinate system and map extent. 3. Follow the plan as it runs: the data it found, the algorithms, the styles. It renders the result and fixes what reads wrong before it answers. 4. Keep the result, or undo it from its checkpoint. ## What it works with - Your own layers: GeoPackage, Shapefile, GeoTIFF, CSV and any layer QGIS opens. - Open datasets it downloads for your area, each with its licence and attribution. - QGIS processing tools and the plugins installed in your QGIS. ## Free tasks and Pro A task is one request the agent carries out. You get 5 free tasks every month. Pro adds more tasks a month, with a 7-day free trial; prices are on the [pricing page](https://terra-lab.ai/pricing). ## Learn more - [AI Agent for QGIS: the complete guide](https://terra-lab.ai/blog/ai-agent-complete-guide): first request, examples, settings and five real tasks. - [The AI Agent benchmark](https://terra-lab.ai/blog/ai-agent-qgis-plugin-geospatial-benchmark): how it scored on Google's geospatial benchmarks. - [Product page](https://terra-lab.ai/ai-agent). Source: https://terra-lab.ai/docs/plugins/ai-agent · Updated 2026-10-27 --- # AI Segmentation > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. AI Segmentation turns imagery into vector polygons in QGIS. Click one object to get its outline, or name what you want, such as "buildings", "solar panels" or "trees", and get every match across an area. ## Two modes | Mode | How | Where it runs | Counter | | --- | --- | --- | --- | | Semi-Auto | Click an object, get its outline | My computer: on your computer. Cloud AI: on TerraLab servers | My computer: none, free. Cloud AI: cloud objects | | Automatic | Name an object, get every match in a drawn zone | On TerraLab servers, no GPU needed | km² of the zone you draw | ## Use it 1. Pick the imagery layer and draw the zone on the map. The panel shows its size in km² before anything runs. 2. Type a word like building, tree or car, or pick one from the Library. Draw an example on the map when the object is unusual. 3. Keep what you need with the confidence and size filters, correct the rest, then export one vector layer with its attribute table. ## Free allowance and Pro Every month: 1.5 km² of Automatic detection and 20 cloud objects (Semi-Auto with Cloud AI), no card. Semi-Auto on My computer has no counter. Pro covers larger areas; prices are on the [pricing page](https://terra-lab.ai/pricing). ## Learn more - [AI Segmentation: the complete guide](https://terra-lab.ai/blog/ai-segmentation-complete-guide). - [Detect building footprints in QGIS](https://terra-lab.ai/blog/detect-building-footprints-qgis). - [Product page](https://terra-lab.ai/ai-segmentation). Source: https://terra-lab.ai/docs/plugins/ai-segmentation · Updated 2026-11-15 --- # AI Edit > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. AI Edit generates a new image of an area of your own imagery from a plain-language instruction: show a redevelopment before it is built, plant a street with trees, or turn an orthophoto into a clean site plan. The result lands in QGIS as a georeferenced raster on the same extent and coordinate system as the source, marked as AI-generated. ## Use it 1. Draw the zone to change on any raster layer: an orthophoto, a satellite basemap or your own drone image. 2. Describe what should be different, or start from a prompt in the Library. Mark up the map to point at one spot. 3. The result lands on the map as a new layer, aligned with the source, up to 4K. Compare it, refine it from a previous version, or vectorize it into polygons. ## Free images and Pro You get 3 free images every month, no card. Pro adds more images a month; prices are on the [pricing page](https://terra-lab.ai/pricing). ## Learn more - [AI Edit: the complete guide](https://terra-lab.ai/blog/ai-edit-complete-guide). - [Turn a satellite image into a site plan](https://terra-lab.ai/blog/satellite-image-to-site-plan). - [Product page](https://terra-lab.ai/ai-edit). Source: https://terra-lab.ai/docs/plugins/ai-edit · Updated 2026-10-27 --- # Quickstart > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Two paths: call the REST API from code, or add the MCP server to an AI agent. Both use the same account and the same 100 free calls a month. ## Call the API from code ### Create an API key 1. Sign in at [terra-lab.ai/login](https://terra-lab.ai/login). An account is free and needs no card. 2. Open [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp), then **Advanced**, **API keys**. 3. Name the key, accept the API terms and click **Create key**. 4. Copy the key now: it starts with `tlk_` and is shown only once. Keep it in an environment variable, never in your code: ```bash export TERRALAB_API_KEY="tlk_your_key_here" ``` ### Check the key `GET /v1/me` returns your account and the calls you have left this month. ```bash curl https://mcp.terra-lab.ai/v1/me \ -H "Authorization: Bearer $TERRALAB_API_KEY" ``` A `401` means the key is missing, mistyped or revoked. ### Make your first tool call Find the coordinates of an address with `find_places`: ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/find_places \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query":"12 rue de la Paix, Annecy"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/find_places", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={"query": "12 rue de la Paix, Annecy"}, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/find_places', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ query: '12 rue de la Paix, Annecy' }), }); const data = await response.json(); console.log(data.structuredContent); ``` The answer is a JSON object: `structuredContent` holds the result with its `sources`, `content` the same result as text, and `isError` says whether the tool refused the request. ### Go further - Extract buildings and roads for an area with [extract_open_data](https://terra-lab.ai/docs/api/extract_open_data). - Get elevation, a profile or contour lines with [get_elevation](https://terra-lab.ai/docs/api/get_elevation). - Browse all 40 tools in the [API reference](https://terra-lab.ai/docs/api). ## Add TerraLab to an AI agent In Claude Code, one command: ```bash claude mcp add --transport http terralab https://mcp.terra-lab.ai/mcp ``` Then run `/mcp` in Claude Code and sign in to TerraLab. For Claude, ChatGPT, Cursor, Codex and VS Code, see [MCP server](https://terra-lab.ai/docs/mcp). Ask, for example: "Show the buildings within 500 m of Lyon Part-Dieu station and give me a GeoPackage." Source: https://terra-lab.ai/docs/quickstart · Updated 2026-10-27 --- # Connect an agent > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. TerraLab is a remote MCP server over Streamable HTTP. One URL works in every agent: ```text https://mcp.terra-lab.ai/mcp ``` The first time, your agent asks you to sign in to TerraLab. Your free calls and balance show on [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp). ## Claude Open the prefilled dialog: [add TerraLab to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=TerraLab&connectorUrl=https%3A%2F%2Fmcp.terra-lab.ai%2Fmcp). Click **Add**, then **Connect**, and sign in to TerraLab. Or in Claude, open **Settings**, **Connectors**, **Add custom connector**, and paste the server URL. ## ChatGPT Open the [TerraLab app in ChatGPT](https://chatgpt.com/plugins/terralab), click **Add**, then start your message with `@TerraLab`. No TerraLab account is needed in ChatGPT today. ## Claude Code Run this in your terminal: ```bash claude mcp add --transport http terralab https://mcp.terra-lab.ai/mcp ``` Then run `/mcp` in Claude Code and sign in to TerraLab. Ready-made GIS workflows come as a plugin: ```text /plugin marketplace add TerraLabAI/mcp /plugin install terralab@terralab-ai-apps ``` ## Codex ```bash codex mcp add terralab --url https://mcp.terra-lab.ai/mcp ``` Codex adds the server and opens the TerraLab sign-in in your browser. It then works in the CLI, the IDE extension and the app. The same entry in `~/.codex/config.toml`: ```toml [mcp_servers.terralab] url = "https://mcp.terra-lab.ai/mcp" ``` ## Cursor Open the install link: [add TerraLab to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=terralab&config=eyJ1cmwiOiJodHRwczovL21jcC50ZXJyYS1sYWIuYWkvbWNwP3ZpYT1jdXJzb3IifQ%3D%3D). Cursor shows the server: click **Install**, then sign in when it asks. Or add a remote server in Cursor's MCP settings, in `.cursor/mcp.json`: ```json { "mcpServers": { "terralab": { "url": "https://mcp.terra-lab.ai/mcp" } } } ``` ## VS Code Open the install link: [add TerraLab to VS Code](vscode:mcp/install?%7B%22name%22%3A%22terralab%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.terra-lab.ai%2Fmcp%3Fvia%3Dvscode%22%7D). Click **Install**, sign in to TerraLab, then ask Copilot in agent mode. Or in `.vscode/mcp.json`: ```json { "servers": { "terralab": { "type": "http", "url": "https://mcp.terra-lab.ai/mcp" } } } ``` ## Microsoft Copilot Studio In your agent, open **Tools**, **Add a tool**, **New tool**, **Model Context Protocol**. Paste the server URL, choose **OAuth 2.0** with the type **Dynamic discovery**, then **Create**. Create a new connection, sign in to TerraLab, and select **Add to agent**. ## Other agents Add a remote MCP server with the URL above in any agent that takes one; it opens the TerraLab sign-in. Gemini CLI: ```bash gemini mcp add --transport http -s user terralab https://mcp.terra-lab.ai/mcp ``` To teach any agent when and how to use the tools, give it `https://terra-lab.ai/skills.md`. ## Tools The server exposes 40 tools. Each one is documented with its parameters and a request example in the [API reference](https://terra-lab.ai/docs/api): the MCP tool and the REST endpoint share the same name and arguments. ChatGPT lists all 40. Claude and other agents list 18: the layer operations are listed in ChatGPT only (elsewhere `process_geometry` and `measure` do the same work), and `get_route`, `get_travel_times`, `get_satellite_index`, `french_parcels_in_area`, `zonal_statistics` and `get_forest_type` are left out of the list but stay callable by name. - **Places**: [Find places and addresses](https://terra-lab.ai/docs/api/find_places), [Convert coordinates](https://terra-lab.ai/docs/api/convert_coordinates), [Measure distance, area, radius or buffer](https://terra-lab.ai/docs/api/measure) - **Map data**: [Extract open map data for an area](https://terra-lab.ai/docs/api/extract_open_data), [Open, map and convert GIS data](https://terra-lab.ai/docs/api/open_gis_file), [Buffer, clip, join, count or filter features](https://terra-lab.ai/docs/api/process_geometry) - **Terrain and routes**: [Elevation, profile and contour lines](https://terra-lab.ai/docs/api/get_elevation), [Road route between places](https://terra-lab.ai/docs/api/get_route), [Area reachable in a travel time](https://terra-lab.ai/docs/api/get_travel_area), [Travel times between many places](https://terra-lab.ai/docs/api/get_travel_times) - **Imagery and land**: [Satellite image of an area](https://terra-lab.ai/docs/api/get_satellite_image), [Sentinel-2 index and change](https://terra-lab.ai/docs/api/get_satellite_index), [Statistics of a raster per polygon](https://terra-lab.ai/docs/api/zonal_statistics), [Forest type (natural, planted, plantation)](https://terra-lab.ai/docs/api/get_forest_type), [Estimate the population of an area](https://terra-lab.ai/docs/api/estimate_population) - **France**: [French cadastral parcel and zoning](https://terra-lab.ai/docs/api/french_parcel), [French cadastral parcels and zoning in an area](https://terra-lab.ai/docs/api/french_parcels_in_area), [French building heights](https://terra-lab.ai/docs/api/french_building_heights), [Natural risks at an address or a point](https://terra-lab.ai/docs/api/get_natural_risks) - **Data catalog**: [Find a dataset in the TerraLab catalogue](https://terra-lab.ai/docs/api/find_datasets), [Extract a hosted dataset for an area](https://terra-lab.ai/docs/api/extract_dataset), [Describe a cloud GeoParquet dataset](https://terra-lab.ai/docs/api/inspect_dataset), [Count and sum a cloud GeoParquet per zone](https://terra-lab.ai/docs/api/aggregate_dataset), [Ask TerraLab to add data it does not have](https://terra-lab.ai/docs/api/request_data) - **Layer operations**: [Straight-line distance between places](https://terra-lab.ai/docs/api/measure_distance), [Area and perimeter of a shape](https://terra-lab.ai/docs/api/measure_area), [Circle of a given radius around a place](https://terra-lab.ai/docs/api/circle_around_place), [Buffer features by a distance](https://terra-lab.ai/docs/api/buffer_features), [Merge (dissolve) features into one](https://terra-lab.ai/docs/api/dissolve_features), [Keep the parts inside a second layer](https://terra-lab.ai/docs/api/intersect_layers), [Remove the parts inside a second layer](https://terra-lab.ai/docs/api/erase_with_layer), [Clip features to an area or a layer](https://terra-lab.ai/docs/api/clip_features), [Simplify feature outlines](https://terra-lab.ai/docs/api/simplify_features), [Centre point of each feature](https://terra-lab.ai/docs/api/feature_centroids), [Add area and length to each feature](https://terra-lab.ai/docs/api/add_area_and_length), [Count features inside each polygon](https://terra-lab.ai/docs/api/count_in_polygons), [Nearest feature and its distance](https://terra-lab.ai/docs/api/find_nearest_features), [Select features by location](https://terra-lab.ai/docs/api/select_by_location), [Join attributes by location](https://terra-lab.ai/docs/api/join_by_location), [Filter features by attribute](https://terra-lab.ai/docs/api/filter_by_attribute) ## What to ask - "Find the coordinates of these 40 addresses and give me a CSV for QGIS." - "Extract the buildings and roads within 1 km of Annecy station as a GeoPackage." - "Elevation profile from Chamonix to the Aiguille du Midi." - "Which natural risks apply at 12 rue de la Paix, Annecy?" Answers show a map in the chat when the agent supports it, and give files that open in QGIS, ArcGIS or Google Earth. ## Troubleshooting - **TerraLab shows as connected in Claude but has no tools.** If you added it before October 26, 2026, remove the connector and add it again: Claude then offers the TerraLab sign-in. - **The agent says the free calls are used.** Top up on [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) or wait for the 1st of the month. See [Pricing and free calls](https://terra-lab.ai/docs/pricing). - **A tool answers with an error.** Its `message` and `hint` say what to change. See [Errors and rate limits](https://terra-lab.ai/docs/errors). Source: https://terra-lab.ai/docs/mcp · Updated 2026-11-15 --- # Authentication > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Every call needs a TerraLab account, except the two public documents: [`/v1/openapi.json`](https://mcp.terra-lab.ai/v1/openapi.json) and [`/v1/meta/pricing`](https://mcp.terra-lab.ai/v1/meta/pricing). The TerraLab app in ChatGPT is the other exception today: it needs no TerraLab account. There are three ways to get access: an API key for code, OAuth 2.1 for agents with a browser, and a 6-digit code for agents without one. ## API keys Use a key for scripts, back ends and notebooks, anything that cannot open a browser to sign in. 1. Sign in at [terra-lab.ai/login](https://terra-lab.ai/login). 2. Open [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp), then **Advanced**, **API keys**. 3. Name the key, accept the API terms and click **Create key**. 4. Copy it at once. A key starts with `tlk_`, followed by 48 hexadecimal characters, and is shown only once: TerraLab stores a hash, never the key. Send it in the `Authorization` header: ```bash curl https://mcp.terra-lab.ai/v1/me \ -H "Authorization: Bearer $TERRALAB_API_KEY" ``` Keys do not expire, and an account holds up to 20 live keys. **Revoke** one from the same page when it leaks or a project ends: the next call with it answers `401`. Calls made with a key count against the account that created it. Keep keys out of source control, front-end code and screenshots. Read them from an environment variable or a secret manager. ## OAuth 2.1 for agents AI agents sign in instead of using a key. When an agent first calls `https://mcp.terra-lab.ai/mcp` without a token, the server answers `401` with a `WWW-Authenticate` header that points to its metadata, and the agent opens the TerraLab sign-in in your browser. You approve once; the agent then holds a token. | What | Value | | --- | --- | | Protected resource metadata | `https://mcp.terra-lab.ai/.well-known/oauth-protected-resource` | | Authorization server | `https://terra-lab.ai` | | Server metadata | `https://terra-lab.ai/.well-known/oauth-authorization-server` | | Grant | Authorization code with PKCE (`S256`), public clients | | Client registration | Dynamic registration, or a client ID metadata document | | Scope | `data` | | Access token lifetime | 1 hour, renewed with a refresh token valid 30 days | Most agents handle all of this themselves: you only paste the server URL. See [MCP server](https://terra-lab.ai/docs/mcp). An OAuth access token also works on the REST API, as a Bearer token in the same header. ## Agents without a browser Some agents run where no browser can open: a terminal on a server, a scheduled job, a chat that cannot follow a redirect. They register with your email instead, following the [auth.md](https://terra-lab.ai/auth.md) protocol. 1. The agent asks for the email of your TerraLab account. 2. It shows you a link and a 6-digit code. TerraLab never sends this code by email. 3. Open the link, sign in or sign up with that same email, check what the page says the agent will get, and type the code. 4. The agent is connected. It appears under **Connected apps** like any other. Confirm only a code from an agent you started yourself. If someone sends you a link or a code you did not ask for, press **Cancel**: confirming would let them use your account. | What | Value | | --- | --- | | Registration endpoint | `https://terra-lab.ai/agent/identity`, type `service_auth` | | Code lifetime | 10 minutes, 5 tries | | Registration lifetime | 1 hour | | Polling grant | `urn:workos:agent-auth:grant-type:claim` at `https://terra-lab.ai/oauth/token` | | Tokens | Same as OAuth: 1 hour access token, 30 day refresh token, scope `data` | The full request and answer shapes for agent builders are in [auth.md](https://terra-lab.ai/auth.md). ## Let an agent check your account A connected agent can read a short summary of the account it works for: the included calls left this month, the balance, and whether a top-up is needed. It never sees your email or your payment details. | What | Value | | --- | --- | | Endpoint | `GET https://terra-lab.ai/oauth/userinfo` with `Authorization: Bearer ` | | Accepted tokens | Any OAuth access token issued by TerraLab. An API key is refused. | | Without a valid token | `401` with a `WWW-Authenticate` header that points to `https://terra-lab.ai/.well-known/oauth-protected-resource` | ## Disconnect an agent [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) lists your **Connected apps**. **Disconnect** revokes that app's access: its next call answers `401` with `access_revoked`. Source: https://terra-lab.ai/docs/authentication · Updated 2026-11-15 --- # Team sign-in for Claude Team and Enterprise > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. With team sign-in, the members of your Claude organization use TerraLab in Claude without signing in to TerraLab each time. Claude vouches for the member with a signed identity assertion, and TerraLab answers with an access token for that member's account. This is Enterprise Managed Auth, from the [MCP enterprise-managed authorization extension](https://modelcontextprotocol.io/extensions/auth/enterprise-managed-authorization). It needs a Claude Team or Enterprise plan and an Owner or Primary Owner of the Claude organization. Claude Pro and Free accounts, ChatGPT and other agents keep the normal sign-in described in [Authentication](https://terra-lab.ai/docs/authentication). ## What each side does | Who | Does what | Where | | --- | --- | --- | | Claude admin | Adds TerraLab, turns on managed authorization, copies the issuer URL | Claude admin settings | | TerraLab team owner | Pastes the issuer URL, turns team sign-in on, invites members by email | [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp), **Team sign-in** | | Each member | Accepts the invitation once, signed in with the invited email | [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp), **Team invitations** | The admin and the owner can be the same person. ## 1. Add TerraLab to your Claude organization In Claude, open **Admin settings**, **Connectors**, and add TerraLab with the server URL: ```text https://mcp.terra-lab.ai/mcp ``` Open the connector. In its **Authentication** section, click **Set up** on the **Managed authorization** row and choose **Claude-issued** under **Identity source**. Claude shows an **Issuer URL** of the form `https://identity.anthropic.com/issuers/`. Copy it exactly. ## 2. Create your TerraLab team 1. Sign in at [terra-lab.ai/login](https://terra-lab.ai/login) with the account that owns the team. 2. Open [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) and unfold **Team sign-in for Claude Team and Enterprise**. 3. Paste the issuer URL in **Trusted issuer URL**, tick **Turn on team sign-in** and click **Save**. 4. Copy the **Tenant ID** shown under the form and paste it in the **Tenant ID** field of Claude's managed authorization setup. It is optional but recommended: it ties Claude's assertions to your team. Without it, TerraLab picks the team the member accepted; it is required only when one email has accepted several teams that trust the same issuer. ## 3. Invite your members Add each member's email under **Members**: the address of their Claude account. Each member then signs in to terra-lab.ai with that email, opens [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) and clicks **Accept** under **Team invitations**. A member without a TerraLab account creates one by signing in. From then on, the member's Claude connects to TerraLab on its own and renews access every hour without asking. The acceptance step is deliberate: an issuer URL is not a secret, so TerraLab never lets a team act for an account that did not agree to join it. The invitation shows the issuer URL, and the acceptance holds for that issuer only. ## 4. Test the connection In Claude's managed authorization setup, click **Run test** under **Connection status**. A member who has not accepted yet gets `invalid_grant` with the reason in the description. ## Usage and billing Each member's calls count against that member's own TerraLab account: 100 free calls a month, then their balance. See [Pricing](https://terra-lab.ai/docs/pricing). ## Remove access | To | Do | | --- | --- | | Remove one member | **Remove** next to the email. Their access stops at the next call. | | Stop the whole team | Untick **Turn on team sign-in** and save. Every member's access stops at the next call. | | Leave a team | **Leave** under **Team invitations**. | Changing the issuer URL also ends every access issued under the old one, and every member must accept again. When someone leaves your Claude organization, Claude stops vouching for them at once; remove them here too. ## For identity providers An identity provider that issues ID-JAG assertions (for example Okta Cross App Access) works the same way: paste its issuer URL instead of Claude's. TerraLab finds the member by the `email` claim, so the provider must send it. | What | Value | | --- | --- | | Token endpoint | `https://terra-lab.ai/oauth/token` | | Grant | `urn:ietf:params:oauth:grant-type:jwt-bearer` | | Assertion `typ` | `oauth-id-jag+jwt`, signed ES256 or RS256 | | Assertion `aud` | `https://terra-lab.ai` | | Optional `aud_tenant` | Your team's Tenant ID | | Access token | 1 hour, no refresh token | Source: https://terra-lab.ai/docs/team-sign-in · Updated 2026-11-04 --- # WebMCP tools for browser agents > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. WebMCP is a browser API that lets a web page hand tools to an AI agent running in the browser. The agent calls a tool with arguments and reads a structured answer, instead of reading the page and clicking through it. Every page of terra-lab.ai registers its tools through `document.modelContext.registerTool`, so an agent on the site can convert coordinates, read a page or call the Data API in one step. You do not need to install anything. When a browser has no WebMCP support, the site behaves as before and nothing is loaded. For an agent outside the browser (Claude, ChatGPT, Cursor, a script), connect the [MCP server](https://terra-lab.ai/docs/mcp) or call the [REST API](https://terra-lab.ai/docs/api) instead. ## Site tools | Tool | What it does | | --- | --- | | `list_terralab_products` | The QGIS plugins and services, with a one-line description and page for each. | | `get_terralab_pricing` | Free tiers and paid plans of the plugins, with the pricing page as the source. | | `get_qgis_plugin_install_links` | The plugin marketplace links and the install steps inside QGIS. | | `list_free_gis_tools` | The free tools of the site, with what each one does and its page. | | `read_terralab_page` | Any page of the site as markdown: product pages, docs, blog posts. | | `open_terralab_page` | Opens a page of the site in the tab the agent works in. | | `get_terralab_mcp_connection` | How to connect the MCP server and the REST API: URL, sign-in, OpenAPI document. | ## Free tools, no account These run in your browser or on the free public endpoints of the site. Nothing is counted. | Tool | What it does | | --- | --- | | `convert_coordinates` | Converts points between decimal degrees, degrees minutes seconds, UTM, MGRS, Lambert 93 and other EPSG systems, with the input format detected. | | `list_coordinate_systems` | Lists the systems `convert_coordinates` accepts, filtered by a word such as Lambert or UTM. | | `convert_vector_data` | Converts KML, CSV, GeoJSON, GPX or WKT text into another of these formats; Shapefile, KMZ and Excel outputs are saved as a download. | | `build_ogr2ogr_command` | Writes the GDAL `ogr2ogr` command for a conversion, a reprojection or a clip, for bash, PowerShell or cmd. | | `get_building_heights` | Height, floors and use of the buildings in a small area in France, from IGN BD TOPO. | | `get_isochrone` | The area reachable by car, bike or on foot from a point or a place within 1 to 60 minutes or a road distance, worldwide, with up to 4 bands and their km². | | `find_elevation` | Elevation of a point anywhere on Earth, by coordinates or place name, or the elevation profile of a line up to 500 km, from the Copernicus DEM. | | `get_building_footprints` | Building outlines in an area from Overture, OpenStreetMap, Microsoft and Google, with counts per source. | | `draw_radius_circles` | Geodesic circles of any radius around places or coordinates, with rings and areas; saves KML, GeoJSON, Shapefile or GPX. | | `measure_area` | Geodesic area and perimeter of polygons (GeoJSON, WKT or a list of points) in m², hectares and acres, with holes and roof area for a pitch. | | `measure_distance` | Straight-line (geodesic) distance along 2 to 200 points in metres, km, miles and nautical miles, with each leg and its bearing. | ## Data API tools, on your account When you are signed in to terra-lab.ai, the agent also gets the tools of the TerraLab Data API: the same tools as the [MCP server](https://terra-lab.ai/docs/mcp), such as `find_places`, `get_elevation`, `get_satellite_image`, `french_parcel`, `get_natural_risks` and `get_route`. The list is read from the server's live catalog, so a new tool shows up without a site change. Each tool is described in the [API reference](https://terra-lab.ai/docs/api). Calls go through the site with your session and count against your own account, like a call from any agent: free calls first, then your balance. They appear under connected apps on [your Data API page](https://terra-lab.ai/dashboard/mcp) as "Browser agent on terra-lab.ai". You accept the Data API terms once on that page before the first call; the agent cannot accept them for you. `request_data` files a data request with TerraLab, so it is not marked read-only. `get_satellite_image`, `get_satellite_index`, `extract_open_data` and `extract_dataset` can cost more than one call and ask the agent to confirm first. To turn browser agents off, revoke "Browser agent on terra-lab.ai" on that page: it stays off until you sign in again. See [Pricing and limits](https://terra-lab.ai/docs/pricing). Signed out, these tools answer with the sign-in link instead of running. ## Your account, read only | Tool | What it does | | --- | --- | | `get_my_terralab_account` | Your plugin plans and your Data API balance, when you are signed in. | No tool changes your account: none buys, subscribes, creates a key or deletes anything. ## Security - Tools are only visible to agents working on terra-lab.ai. Other sites and embedded frames cannot see or call them. - Tools that only read are marked `readOnlyHint`. The free tools return a link (`open_in_browser` or `edit_in_builder`) that opens the same result in the visible tool, and `open_terralab_page` shows it to you, so you can check what the agent did. Account and payment pages are never opened by a tool. Tools whose answer carries third-party text (open data, file contents) are marked `untrustedContentHint`, so the agent treats it as data, not instructions. - Data API calls use your existing session. No key or token is handed to the agent. - We record which tool was called, whether it worked and how long it took, never the arguments. ## Try it WebMCP is experimental in Chrome: an origin trial from Chrome 149 to 156, with shipping planned after that. 1. In Chrome, open `chrome://flags/#enable-webmcp-testing`, set it to **Enabled** and relaunch. 2. Open any page of terra-lab.ai, then DevTools, **Application**, **WebMCP**. The panel lists the registered tools, lets you run one with your own arguments, and logs every call an agent makes. 3. Ask an agent that supports WebMCP in your browser to use the site, for example to convert a list of coordinates or to read the pricing. Source: https://terra-lab.ai/docs/webmcp · Updated 2026-10-28 --- # TerraLab API reference > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The TerraLab REST API serves the same 40 tools as the MCP server, as HTTPS endpoints: each tool is a `POST` with a JSON body, the account endpoints are `GET`. ## Base URL ```text https://mcp.terra-lab.ai ``` Send your API key as a Bearer token on every call except the two public documents. See [Authentication](https://terra-lab.ai/docs/authentication). ## Account and discovery | Endpoint | Auth | What it returns | | --- | --- | --- | | `GET /v1/me` | Key | The account, its calls this month and today, its balance and its activation state. | | `GET /v1/tools` | Key | Every tool with its input and output JSON Schema. | | `GET /v1/openapi.json` | None | This reference as an OpenAPI 3.1 document: [https://mcp.terra-lab.ai/v1/openapi.json](https://mcp.terra-lab.ai/v1/openapi.json). | | `GET /v1/meta/pricing` | None | The price grid as JSON: [https://mcp.terra-lab.ai/v1/meta/pricing](https://mcp.terra-lab.ai/v1/meta/pricing). | Check your key and your remaining calls: ```bash curl https://mcp.terra-lab.ai/v1/me \ -H "Authorization: Bearer $TERRALAB_API_KEY" ``` ```python import os import requests response = requests.get( "https://mcp.terra-lab.ai/v1/me", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, timeout=120, ) response.raise_for_status() print(response.json()) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/me', { headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, }, }); const data = await response.json(); console.log(data); ``` ```json { "account": "3f9c0a1e7b2d4c6a8e0f1b3d", "auth": "key", "today": { "calls": 3, "limit": 100 }, "month": { "calls": 12, "included": 100, "resets_at": "2026-11-01T00:00:00.000Z" }, "balance": { "currency": "EUR", "amount": 0, "micros": 0 }, "activation": { "first_call_at": null, "first_call_client": null } } ``` An illustrative answer for a new account. `month.included` is the number of calls included this calendar month (UTC); later calls are taken from the balance. `today.limit` carries the same number for older clients. ## Tools ### Places | Tool | What it gives | | --- | --- | | [Find places and addresses](https://terra-lab.ai/docs/api/find_places) | Coordinates of an address or place name, the address at a point, or a list of up to 100 addresses placed on a map with a CSV for QGIS. | | [Convert coordinates](https://terra-lab.ai/docs/api/convert_coordinates) | Coordinates converted between decimal degrees, degrees minutes seconds, UTM, MGRS, Lambert 93 or any EPSG code, with the format detected for you. | | [Measure distance, area, radius or buffer](https://terra-lab.ai/docs/api/measure) | Geodesic distance and bearing between places, the length of a line, the area and perimeter of a polygon, or a circle or buffer around a shape. | ### Map data | Tool | What it gives | | --- | --- | | [Extract open map data for an area](https://terra-lab.ai/docs/api/extract_open_data) | OpenStreetMap and Overture layers for any area: buildings, roads, addresses, points of interest, land use, water and more, as GIS files. | | [Open, map and convert GIS data](https://terra-lab.ai/docs/api/open_gis_file) | Any GeoJSON, KML, KMZ, GPX, Shapefile, CSV or WKT read, checked, shown on a map and converted to another format. | | [Buffer, clip, join, count or filter features](https://terra-lab.ai/docs/api/process_geometry) | One GIS operation on a set of features: buffer, union, dissolve, intersection, difference, clip or simplify, returned as a file. | ### Terrain and routes | Tool | What it gives | | --- | --- | | [Elevation, profile and contour lines](https://terra-lab.ai/docs/api/get_elevation) | Elevation of points, a profile along a path, or a DEM, hillshade, slope and contour lines for an area, worldwide at 30 m. | | [Road route between places](https://terra-lab.ai/docs/api/get_route) | Driving, walking or cycling route through 2 to 25 places, with distance and travel time per leg and the route line. | | [Area reachable in a travel time](https://terra-lab.ai/docs/api/get_travel_area) | The area reachable from 1 to 10 places within a travel time or a distance on the road network, driving, walking or cycling (isochrones). | | [Travel times between many places](https://terra-lab.ai/docs/api/get_travel_times) | Driving, walking or cycling distances and travel times from up to 25 origins to up to 25 destinations in one call, as a matrix with a map and a CSV. | ### Imagery and land | Tool | What it gives | | --- | --- | | [Satellite image of an area](https://terra-lab.ai/docs/api/get_satellite_image) | A recent Sentinel-2 image of an area in true colour, false colour or NDVI, or an IGN aerial photo in France, as a GeoTIFF. | | [Sentinel-2 index and change](https://terra-lab.ai/docs/api/get_satellite_index) | NDVI, NDWI, NBR or NDBI statistics and a map for an area on one date, or the change between two dates, from cloud-masked Sentinel-2 scenes. | | [Statistics of a raster per polygon](https://terra-lab.ai/docs/api/zonal_statistics) | A raster summarised for each polygon of a layer: population, land cover shares, or elevation and slope per district, parcel or catchment. | | [Forest type (natural, planted, plantation)](https://terra-lab.ai/docs/api/get_forest_type) | Whether a forest is natural, naturally regenerating, planted, a plantation or tree crops, mapped at 10 m for 2020. | | [Estimate the population of an area](https://terra-lab.ai/docs/api/estimate_population) | A modelled estimate of the people living in a circle, a bounding box, a travel area or an administrative boundary, from the GHS-POP 2025 grid. | ### France | Tool | What it gives | | --- | --- | | [French cadastral parcel and zoning](https://terra-lab.ai/docs/api/french_parcel) | The French cadastral parcel at an address or point, its reference and area, and the urban plan zone that applies there. | | [French cadastral parcels and zoning in an area](https://terra-lab.ai/docs/api/french_parcels_in_area) | Every French cadastral parcel in an area, with its reference, its area and the urban plan zone it lies in, as a GIS file. | | [French building heights](https://terra-lab.ai/docs/api/french_building_heights) | Height in metres, floors, main use and year built of every building around an address or in a small area in France, from IGN BD TOPO. | | [Natural risks at an address or a point](https://terra-lab.ai/docs/api/get_natural_risks) | Natural risks at an address or point: flood zones, clay, seismic zone, cavities and commune risks in France, river flood depth elsewhere. | ### Data catalog | Tool | What it gives | | --- | --- | | [Find a dataset in the TerraLab catalogue](https://terra-lab.ai/docs/api/find_datasets) | Search the TerraLab catalogue of open datasets by need or place, with each licence, coverage, size and the call that gets it. | | [Extract a hosted dataset for an area](https://terra-lab.ai/docs/api/extract_dataset) | A hosted dataset from the TerraLab catalogue cut to an area: a GeoTIFF or a vector file with its licence, or only the statistics. | | [Describe a cloud GeoParquet dataset](https://terra-lab.ai/docs/api/inspect_dataset) | What a public cloud GeoParquet holds, read from its footer only: rows, columns with their ranges, geometry, CRS, extent and partitions. | | [Count and sum a cloud GeoParquet per zone](https://terra-lab.ai/docs/api/aggregate_dataset) | A count, sum or average over a large public GeoParquet for a place or per zone (state, county, region, district), without downloading it. | | [Ask TerraLab to add data it does not have](https://terra-lab.ai/docs/api/request_data) | Ask TerraLab to add geographic data the catalogue does not have yet, with what you need and up to five places where you need it. | ### Layer operations | Tool | What it gives | | --- | --- | | [Straight-line distance between places](https://terra-lab.ai/docs/api/measure_distance) | Straight-line geodesic distance between 2 or more places or points, with the midpoint and bearing for two, or the length of a line. | | [Area and perimeter of a shape](https://terra-lab.ai/docs/api/measure_area) | Geodesic area and perimeter of a shape given by its corner points, place names or a drawn polygon. | | [Circle of a given radius around a place](https://terra-lab.ai/docs/api/circle_around_place) | A circle of a given radius around a place or a point, with its area and circumference, as a map and a GIS file. | | [Buffer features by a distance](https://terra-lab.ai/docs/api/buffer_features) | A buffer of a given width around each feature of a layer, or one merged area whose overlaps count once, as a GIS file. | | [Merge (dissolve) features into one](https://terra-lab.ai/docs/api/dissolve_features) | The features of a layer merged into one, or into one per value of a field, with the total area or length. | | [Keep the parts inside a second layer](https://terra-lab.ai/docs/api/intersect_layers) | The parts of each feature that lie inside a second layer of polygons, with their attributes. | | [Remove the parts inside a second layer](https://terra-lab.ai/docs/api/erase_with_layer) | Each feature of a layer minus the parts inside a second layer of polygons, such as buildings outside the flood zones. | | [Clip features to an area or a layer](https://terra-lab.ai/docs/api/clip_features) | A layer cut to an area: a place, a place with a radius, a bounding box or a second layer of polygons. | | [Simplify feature outlines](https://terra-lab.ai/docs/api/simplify_features) | Lighter outlines: the lines or polygons of a layer simplified so no vertex moves more than a tolerance in metres. | | [Centre point of each feature](https://terra-lab.ai/docs/api/feature_centroids) | The centre point of each feature of a layer, with its attributes, for example to turn buildings or parcels into points. | | [Add area and length to each feature](https://terra-lab.ai/docs/api/add_area_and_length) | The geodesic area, perimeter and length added to every feature of a layer, with the totals. | | [Count features inside each polygon](https://terra-lab.ai/docs/api/count_in_polygons) | How many features of a layer fall inside each polygon of a second layer, with an optional sum of a numeric field. | | [Nearest feature and its distance](https://terra-lab.ai/docs/api/find_nearest_features) | For each feature of a layer, the nearest feature of a second layer and the distance to it. | | [Select features by location](https://terra-lab.ai/docs/api/select_by_location) | The features of a layer that intersect a second layer, lie within it or lie within a distance of it, or those that do not. | | [Join attributes by location](https://terra-lab.ai/docs/api/join_by_location) | A spatial join: each feature of a layer takes the attributes of the polygon of a second layer it falls in. | | [Filter features by attribute](https://terra-lab.ai/docs/api/filter_by_attribute) | Only the features of a layer whose attributes meet conditions, such as roads of class primary or buildings higher than 10 m. | ## Versioning and deprecation The API version is in the path. Within `/v1`, changes are additive only: new endpoints, new optional parameters and new response fields. A change that would break a client ships under a new path version (`/v2`) while `/v1` keeps working. An endpoint that will be removed is announced in the [changelog](https://terra-lab.ai/docs/changelog) at least 6 months ahead. During that period its responses carry a `Deprecation` header (RFC 9745) and a `Sunset` header (RFC 8594) with the removal date. No endpoint of `/v1` is deprecated today. ## OpenAPI Import [https://mcp.terra-lab.ai/v1/openapi.json](https://mcp.terra-lab.ai/v1/openapi.json) into Postman, Insomnia, Bruno or a client generator. It is built from the tool schemas the server runs, so it is never behind the server. Source: https://terra-lab.ai/docs/api · Updated 2026-11-23 --- # Find places and addresses > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Coordinates of an address or place name, the address at a point, or a list of up to 100 addresses placed on a map with a CSV for QGIS. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/find_places` | | MCP tool | `find_places` on `https://mcp.terra-lab.ai/mcp` | | Group | Places | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/find_places \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query":"12 rue de la Paix, Annecy"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/find_places", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "query": "12 rue de la Paix, Annecy", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/find_places', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "query": "12 rue de la Paix, Annecy" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"latitude":48.8584,"longitude":2.2945} ``` ```json {"addresses":["10 rue de Rivoli, Paris","Empire State Building, New York"],"title":"Visits"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `query` | string | No | One address or place name. The place the user asks about, not the user's own location. | | `latitude` | number | No | Latitude for a reverse lookup. The place the user asks about, not the user's own location. From -90 to 90. | | `longitude` | number | No | Longitude for a reverse lookup. The place the user asks about, not the user's own location. From -180 to 180. | | `limit` | integer | No | For a single query: maximum number of matches. From 1 to 10. Default `5`. | | `addresses` | array of string | No | A list of addresses to place, up to 100. The place the user asks about, not the user's own location. 1 to 100 items. | | `text` | string | No | A list as text: one address per line, or CSV with an address column. The place the user asks about, not the user's own location. | | `title` | string | No | For a list: map title, also used for file names. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the coordinates (latitude and longitude, GPS position) of an address or place name, the address at given coordinates, or wants places or addresses put, pinned or plotted on an interactive map, including a whole list of addresses (up to 100, pasted or as CSV with an address column). Send the whole list in one call (addresses): one call per address runs into the per-minute call limit and is refused. A list not finished in 45 s returns what was placed and retry_with for the rest: send it as it is. Worldwide, OpenStreetMap data; French street addresses are refined with the national address base. Shows the points on a map; for a list, gives a CSV with latitude and longitude added (opens directly in QGIS or any GIS as a delimited text layer), plus KML and GeoJSON. Not for weather, opening hours, reviews, driving or travel directions and times, property prices, or general knowledge about a place (history, facts, travel advice): answer those without this tool. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/find_places · Updated 2026-11-23 --- # Convert coordinates > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Coordinates converted between decimal degrees, degrees minutes seconds, UTM, MGRS, Lambert 93 or any EPSG code, with the format detected for you. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/convert_coordinates` | | MCP tool | `convert_coordinates` on `https://mcp.terra-lab.ai/mcp` | | Group | Places | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/convert_coordinates \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text":"48.8584, 2.2945\n45.8992 N 6.1294 E","target_epsg":"EPSG:2154"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/convert_coordinates", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "text": "48.8584, 2.2945\n45.8992 N 6.1294 E", "target_epsg": "EPSG:2154", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/convert_coordinates', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "text": "48.8584, 2.2945\n45.8992 N 6.1294 E", "target_epsg": "EPSG:2154" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `text` | string | Yes | One coordinate per line, up to 1,000 lines. A label may follow the numbers. | | `target_epsg` | string | No | Optional extra output system as an EPSG code. | | `source_epsg` | string | No | Optional system the input is in, as an EPSG code, when it cannot be detected: Dutch RD EPSG:28992, Swiss LV95 EPSG:2056, British National Grid EPSG:27700, Poland 1992 EPSG:2180, UTM zone 32N EPSG:32632, ETRS89 or ED50 UTM EPSG:25830 / EPSG:23030. Leave out to detect each line. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user gives coordinates and wants them in another system or format: decimal degrees, degrees minutes seconds (GPS), UTM, MGRS, Lambert 93 (EPSG:2154, the French grid) or an EPSG code, for example Lambert 93 to WGS84 latitude and longitude, or GPS coordinates to UTM. The format of each line is detected automatically. A plain pair of decimals is read as latitude, longitude unless the first number is above 90: give longitude-first pairs as POINT (lon lat) or [lon, lat]; for a national grid the numbers alone cannot reveal (Dutch RD, Swiss LV95, British National Grid, Polish 1992, Belgian Lambert 72) or a UTM zone given apart from the numbers, set source_epsg. Converts one point or up to 1,000 lines to decimal degrees, DMS, UTM and MGRS (1 m), and optionally to an EPSG code, shows them on a map, and recommends the local projected CRS for working in a GIS. Returns a CSV and a GeoJSON download (both open directly in QGIS or any GIS). Needs actual coordinates: to explain what a CRS, a projection or an EPSG code is, or to write conversion code, answer without this tool. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/convert_coordinates · Updated 2026-11-23 --- # Measure distance, area, radius or buffer > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Geodesic distance and bearing between places, the length of a line, the area and perimeter of a polygon, or a circle or buffer around a shape. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/measure` | | MCP tool | `measure` on `https://mcp.terra-lab.ai/mcp` | | Group | Places | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/measure \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"distance","points":["Paris, France","Geneva, Switzerland"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/measure", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "method": "distance", "points": ["Paris, France", "Geneva, Switzerland"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/measure', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "method": "distance", "points": [ "Paris, France", "Geneva, Switzerland" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"method":"radius","center":"Lyon Part-Dieu","radius_m":5000} ``` ```json {"method":"area","points":[{"latitude":45.9,"longitude":6.12},{"latitude":45.9,"longitude":6.13},{"latitude":45.91,"longitude":6.13}]} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `method` | string | Yes | What to measure. One of `"distance"`, `"area"`, `"radius"`, `"buffer"`. | | `geometry` | object | No | A drawn geometry as GeoJSON (Point, LineString, Polygon, MultiLineString or MultiPolygon, WGS 84 longitude, latitude), or a Feature holding one. | | `geometry.type` | string | No | | | `geometry.coordinates` | array | No | | | `geometry.geometry` | object | No | | | `formats` | array of string | No | Download formats. Default `["geojson","kml"]`. | | `points` | array of string or object | No | For distance (2+) and area (3+): points or place names in order. The place the user asks about, not the user's own location. 2 to 500 items. | | `center` | string or object | No | For radius: the center, a point or a place name. The place the user asks about, not the user's own location. | | `radius_m` | number | No | For radius and buffer: the distance in metres (convert km or miles to metres first). A buffer goes up to 100,000 m, a radius around a place up to 2,000,000 m. From 1 to 2000000. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a straight-line (as the crow flies) distance between places with midpoint and bearing, the length of a drawn line, the area and perimeter of a polygon, a circle of a given radius around a place, or a buffer of a given width around a drawn line or polygon. Distances and areas are geodesic on the WGS 84 ellipsoid, buffers are built in a local equidistant projection; every figure states its unit (m, km, m², ha, km²). method "distance" takes 2 or more points or place names, or a line in geometry; "area" takes 3 or more points or a polygon in geometry; "radius" takes a center and radius_m; "buffer" takes a geometry and radius_m. Not a road or travel distance (get_route), not an elevation profile (get_elevation). Returns the numbers, a map and GeoJSON, KML, Shapefile zip or CSV downloads. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/measure · Updated 2026-11-23 --- # Extract open map data for an area > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. OpenStreetMap and Overture layers for any area: buildings, roads, addresses, points of interest, land use, water and more, as GIS files. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/extract_open_data` | | MCP tool | `extract_open_data` on `https://mcp.terra-lab.ai/mcp` | | Group | Map data | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/extract_open_data \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"theme":"buildings","area":{"bbox":[2.34,48.857,2.343,48.859]},"formats":["shapefile"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/extract_open_data", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "theme": "buildings", "area": { "bbox": [2.34, 48.857, 2.343, 48.859], }, "formats": ["shapefile"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/extract_open_data', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "theme": "buildings", "area": { "bbox": [ 2.34, 48.857, 2.343, 48.859 ] }, "formats": [ "shapefile" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"theme":"pois","area":{"place":"Annecy","radius_m":500},"kind":"pharmacy"} ``` ```json {"theme":"divisions","area":{"place":"Bretagne, France"},"level":"county","formats":["shapefile"]} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `theme` | string | Yes | The data layer. One of `"buildings"`, `"places"`, `"roads"`, `"addresses"`, `"divisions"`, `"landuse"`, `"pois"`, `"waterways"`, `"water_areas"`, `"power"`, `"boundaries"`, `"railways"`, `"routes"`, `"transit_stops"`, `"protected_areas"`. | | `themes` | array of string | No | More layers for the same area in the same call, added to theme (5 themes in all at most). Returns one GeoPackage with a layer per theme. 1 to 5 items. | | `area` | object | Yes | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `formats` | array of string | No | Download formats. A GeoPackage is always included. Default `["geojson"]`. | | `level` | string | No | For the divisions theme: the administrative level to keep. region = French région, US state, German Land; county = French département, US county; municipality = commune, town or city. With a named place, a division of that name at this level is returned alone, and lower levels are kept only inside the named place ("the departments of Brittany": place Brittany, level county). One of `"country"`, `"region"`, `"county"`, `"municipality"`. | | `kind` | string or array of string | No | Keep only some kinds of feature, matched against their OpenStreetMap tag value in English: pharmacy, school, supermarket, restaurant, hospital, farmland, forest, vineyard. One kind, or several in one call (["forest", "meadow", "grass"]). Leave out for all of the theme. | | `count_only` | boolean | No | true: return the number of features of each theme (and kind) in the area, and whether it fits one extract, without extracting them or writing files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants map data or GIS layers for a place or an area anywhere in the world, such as the data of a city, a town, a neighbourhood or a site: buildings, roads, addresses, points of interest (shops, schools, pharmacies), land use, waterways, water areas, railways, transit stops, power lines, protected areas, administrative divisions and boundaries, places or routes. The area is a place, a place with a radius, or a bbox. Returns the count, sample attributes, a map and a GIS file (GeoJSON, KML, Shapefile zip or CSV) with its licence. One extract holds at most 20,000 features (40,000 over all the themes of one call): for a town centre use a radius of about 1 km, for dense cities less. For one kind of place (pharmacies, schools, supermarkets) or land (forest, vineyards), set kind: the limit then counts that kind only, so a whole city usually fits. A town named without a radius that is too large is cut to 1 km around its centre, and the answer says so. Area caps of one call: buildings 200 km² (1° a side), roads 1,000 km², addresses, places, pois and transit stops 2,000 km² (2° a side), divisions none in practice, the other themes 5,000 km² (3° a side). If a call returns area_too_large, send its retry_with arguments as they are, or split the area: its split_bboxes are smaller boxes to try one call each (a dense part may still be refused, then narrow that part). For administrative boundaries (a commune, the departments of a region, a country) use divisions with level and the place name, without a radius. For several layers of one area, add them in themes (5 themes at most): one call, one GeoPackage with a layer each. count_only: true counts the features of each theme without extracting them, to check that an area fits. Data: Overture Maps and OpenStreetMap. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/extract_open_data · Updated 2026-11-23 --- # Open, map and convert GIS data > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Any GeoJSON, KML, KMZ, GPX, Shapefile, CSV or WKT read, checked, shown on a map and converted to another format. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/open_gis_file` | | MCP tool | `open_gis_file` on `https://mcp.terra-lab.ai/mcp` | | Group | Map data | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/open_gis_file \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text":"A6.12,45.9","convert_to":["gpx"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/open_gis_file", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "text": "A6.12,45.9", "convert_to": ["gpx"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/open_gis_file', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "text": "A6.12,45.9", "convert_to": [ "gpx" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation. | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the file. | | `text` | string | No | The file content pasted as text (GeoJSON, KML, GPX, CSV or WKT). | | `points` | array of object | No | Points to show and convert, with a name. The places the user asks about, not the user's own location. 0 to 5000 items. | | `geojson` | object | No | A GeoJSON FeatureCollection, Feature or geometry in WGS 84, given as an object. | | `title` | string | No | Name for the map and the output files when there is no file name. | | `file_name` | string | No | Optional name of the file, used to name the outputs. | | `convert_to` | array of string | No | Output formats wanted. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user shares or links a geographic file (GeoJSON, KML, KMZ, GPX track, zipped Shapefile, CSV with coordinates, WKT), pastes its content, or has a list of points or GeoJSON to put on a map, and wants to see it, understand it (format, coordinate system, extent, feature count, geometry types, fields, problems) or convert it to GeoJSON, KML, KMZ, GPX, Shapefile zip or CSV, for example a GPX track to a Shapefile or a KML to GeoJSON. Shapefile, GeoJSON, KML and CSV outputs open directly in QGIS. Also covers long tracks or point lists too big to write in the chat. Not for fetching new data about a place: that is extract_open_data. Not for styling layers, print layouts or chaining steps on the layers of a QGIS project the user has open: TerraLab AI Agent in QGIS does that. Files up to 50 MB for a zipped Shapefile or KMZ, 20 MB for GeoJSON and 10 MB for KML and GPX; GeoPackage and rasters are not read, except from a TerraLab download link. Use it even for a short pasted file: it reads the coordinate system and writes valid files, so do not write the conversion by hand or in code. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/open_gis_file · Updated 2026-11-23 --- # Buffer, clip, join, count or filter features > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. One GIS operation on a set of features: buffer, union, dissolve, intersection, difference, clip or simplify, returned as a file. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/process_geometry` | | MCP tool | `process_geometry` on `https://mcp.terra-lab.ai/mcp` | | Group | Map data | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/process_geometry \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"operation":"buffer","geojson":{"type":"LineString","coordinates":[[6.12,45.9],[6.13,45.905]]},"radius_m":200}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/process_geometry", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "operation": "buffer", "geojson": { "type": "LineString", "coordinates": [[6.12, 45.9], [6.13, 45.905]], }, "radius_m": 200, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/process_geometry', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "operation": "buffer", "geojson": { "type": "LineString", "coordinates": [ [ 6.12, 45.9 ], [ 6.13, 45.905 ] ] }, "radius_m": 200 }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"operation":"clip","url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","area":{"place":"Annecy","radius_m":150}} ``` ```json {"operation":"count_within","url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson","with_url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `operation` | string | Yes | The operation to apply. One of `"buffer"`, `"union"`, `"intersection"`, `"difference"`, `"clip"`, `"simplify"`, `"centroid"`, `"area_length"`, `"count_within"`, `"nearest"`, `"select_by_location"`, `"spatial_join"`, `"filter"`. | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The second layer, uploaded in the conversation: for intersection, difference, clip, count_within, nearest, select_by_location and spatial_join. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84. Only its polygons count, except for nearest and select_by_location, which take any geometry. | | `area` | object | No | For clip: the area to keep, as a bbox or a place with a radius (its bounding box is used). The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `radius_m` | number | No | For buffer: the distance in metres (convert km or miles first). From 0.1 to 100000. | | `dissolve` | boolean | No | For buffer: merge all buffers into one feature, so overlaps count once in the total area. | | `tolerance_m` | number | No | For simplify: the largest allowed shift of the outline in metres. From 0.01 to 100000. | | `dissolve_field` | string | No | For union: dissolve into one feature per value of this field instead of one feature. | | `where` | array of object | No | For filter: the conditions on attributes. A missing field equals null. Text that writes a number plainly ("12", "12.5") compares as a number; other text compares without case, and never orders against a number. | | `match` | string | No | For filter: keep the features that meet all conditions (default) or any of them. One of `"all"`, `"any"`. | | `relation` | string | No | For select_by_location: keep the input features that intersect the second layer (default), lie wholly within one of its polygons, or lie within distance_m of it. One of `"intersects"`, `"within"`, `"within_distance"`. | | `distance_m` | number | No | For select_by_location with relation within_distance: the distance in metres. From 0.1 to 100000. | | `invert` | boolean | No | For select_by_location: keep the features that do not match instead. | | `sum_field` | string | No | For count_within: also sum this numeric field of the counted features per polygon, as sum_. | | `join_fields` | array of string | No | For spatial_join and nearest: the fields of the second layer to copy. By default spatial_join copies all of them and nearest copies name (as nearest_name). | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants one GIS operation on a set of features (an uploaded file, a link, inline GeoJSON, or a download link from another TerraLab answer), with the result as a file. On one layer: buffer by radius_m (dissolve merges the buffers), union (dissolve all features into one, or one per value of dissolve_field), simplify by tolerance_m, centroid of each feature, area_length (adds area_m2, perimeter_m and length_m, geodesic), filter by attribute (where). With a second layer: intersection, difference, clip (or clip to an area: place, place with radius_m, or bbox), count_within (how many input features fall in each polygon, points in polygons, with an optional sum), nearest (the nearest feature of the second layer and its geodesic distance), select_by_location (the features that intersect it, lie within it, or lie within distance_m of it), spatial_join (copy the attributes of the polygon each feature falls in). Overlays and point in polygon run in WGS 84 degrees; buffer, simplify, centroid and distances in a local equidistant projection. Up to 20,000 features and 100,000 vertices per layer (25,000 for buffer). Returns counts, the fields, a few sample rows, total area or length, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Not for one distance or the area of a shape drawn in the chat: that is measure. Not for reading or converting a file without changing it: that is open_gis_file. Not for styling layers, print layouts or chaining steps on the layers of a QGIS project the user has open: TerraLab AI Agent in QGIS does that. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/process_geometry · Updated 2026-11-23 --- # Elevation, profile and contour lines > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Elevation of points, a profile along a path, or a DEM, hillshade, slope and contour lines for an area, worldwide at 30 m. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_elevation` | | MCP tool | `get_elevation` on `https://mcp.terra-lab.ai/mcp` | | Group | Terrain and routes | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_elevation \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"mode":"point","points":["Annecy, France"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_elevation", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "mode": "point", "points": ["Annecy, France"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_elevation', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "mode": "point", "points": [ "Annecy, France" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"mode":"path","points":["Chamonix, France",{"latitude":45.8786,"longitude":6.8873,"name":"Aiguille du Midi"}]} ``` ```json {"mode":"area","area":{"place":"Chamonix, France","radius_m":2000},"interval_m":50} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `mode` | string | No | point: elevation of each point; path: profile along the points; area: DEM, hillshade and slope GeoTIFFs, plus contour lines and slope statistics for small areas. One of `"point"`, `"path"`, `"area"`. Default `"point"`. | | `points` | array of string or object | No | For point and path: points or place names. The place the user asks about, not the user's own location. 1 to 100 items. | | `samples` | integer | No | For path: number of samples along the path. From 10 to 500. Default `200`. | | `area` | object | No | For area: The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `interval_m` | number | No | For area: vertical interval between contour lines, in metres. From 1 to 1000. Default `20`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks how high a place is (altitude, height above sea level), wants an elevation profile or the climb between places (elevation gain and loss, highest and lowest points, cross-section; the profile follows straight lines between the points given, so for a hike, a ride or a road pass the points along the way, not only its two ends), or asks about the terrain of an area, anywhere in the world: a DEM, relief or hillshade GIS file, contour lines (topographic lines) and how steep or flat it is (slope). Place names work directly, for example a town and a summit. Reads the values from Copernicus DEM, a 30 m surface model of the whole world, and returns the numbers, a profile chart, the path or contours on a map and files. mode "point": up to 100 points. mode "path": 2 to 100 points, sampled into at most 500 samples. mode "area": a bbox, a place or a place with a radius, limited to 36 one-degree DEM tiles and 4 million cells: returns the DEM clipped to the area as a GeoTIFF (30 m, coarser for very large areas), a hillshade GeoTIFF and a slope GeoTIFF, which open directly in QGIS or any GIS; for areas up to about 10 x 10 km it also returns contour lines (interval_m between lines; Shapefile, GeoJSON, KML) and slope statistics, so one call answers how steep a site is. If area_too_large returns retry_with, try that smaller area once and report the reduced coverage; do not repeat a rejected call. Not for routes or travel times. Needs a place, coordinates or an area: to explain what a DEM, a DSM or contour lines are, answer without this tool. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/get_elevation · Updated 2026-11-23 --- # Road route between places > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Driving, walking or cycling route through 2 to 25 places, with distance and travel time per leg and the route line. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_route` | | MCP tool | `get_route` on `https://mcp.terra-lab.ai/mcp` | | Group | Terrain and routes | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_route \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"points":["Annecy, France","Chamonix-Mont-Blanc, France"],"mode":"driving"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_route", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "points": ["Annecy, France", "Chamonix-Mont-Blanc, France"], "mode": "driving", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_route', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "points": [ "Annecy, France", "Chamonix-Mont-Blanc, France" ], "mode": "driving" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"points":["Lyon Part-Dieu","Vieux Lyon","Croix-Rousse, Lyon"],"mode":"walking"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `points` | array of string or object | Yes | Start, optional stops and destination, in travel order: place names or {latitude, longitude}. 2 to 25 items. | | `mode` | string | No | How the route is travelled. One of `"driving"`, `"walking"`, `"cycling"`. Default `"driving"`. | | `avoid_tolls` | boolean | No | Driving: avoid toll roads where a reasonable alternative exists. Default `false`. | | `avoid_highways` | boolean | No | Driving or cycling: avoid motorways and highways where possible. Default `false`. | | `avoid_ferries` | boolean | No | Avoid ferries where possible. Default `false`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the driving, walking or cycling route between 2 to 25 places or points in order: the distance and travel time along the roads and paths, per leg and in total, and the route line. Computed by Valhalla on the TerraLab server from the OpenStreetMap road network, with each road's typical speed. Options avoid tolls, highways or ferries. Returns the figures (distance_m, distance_km, duration_s, duration_min), a map of the line and GeoJSON, KML, GPX, Shapefile zip and GeoPackage downloads. Not for a straight-line distance (measure_distance or measure), live traffic, departure-time travel times, public transport or turn-by-turn navigation. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. For distances or times between many places, each origin to each destination, use get_travel_times: one call answers up to 625 pairs. Source: https://terra-lab.ai/docs/api/get_route · Updated 2026-11-23 --- # Area reachable in a travel time > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The area reachable from 1 to 10 places within a travel time or a distance on the road network, driving, walking or cycling (isochrones). | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_travel_area` | | MCP tool | `get_travel_area` on `https://mcp.terra-lab.ai/mcp` | | Group | Terrain and routes | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_travel_area \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"starts":["Gare d'\''Annecy"],"minutes":[15,30],"mode":"walking"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_travel_area", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "starts": ["Gare d'Annecy"], "minutes": [15, 30], "mode": "walking", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_travel_area', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "starts": [ "Gare d'Annecy" ], "minutes": [ 15, 30 ], "mode": "walking" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"starts":["Lyon Part-Dieu","Grenoble"],"km":[10,25],"mode":"driving"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `starts` | array of string or object | Yes | Start places or points: place names or {latitude, longitude}. 1 to 10 items. | | `minutes` | array of number | No | Travel times in minutes, one polygon each. Leave out when km is given. 0 to 4 items. Default `[5,10,20]`. | | `km` | array of number | No | Distances along the roads in km, instead of minutes. 0 to 4 items. | | `mode` | string | No | How the area is travelled. One of `"driving"`, `"walking"`, `"cycling"`. Default `"driving"`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the area reachable from 1 to 10 places within a travel time or a distance along the roads (an isochrone, catchment or service area): for example everything within 5, 10 and 20 minutes on foot from a station, or 30 km by car. Driving, walking or cycling, computed by Valhalla on the TerraLab server from the OpenStreetMap road network with each road's typical speed. Returns one polygon per start and value, with fields start, minutes or km, and mode, a map, and GeoJSON, KML, Shapefile zip and GeoPackage downloads. Up to 4 values, at most 120 minutes or 200 km. Not for a circle of a fixed radius (circle_around_place or measure), live traffic, a given departure time or public transport. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/get_travel_area · Updated 2026-11-23 --- # Travel times between many places > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Driving, walking or cycling distances and travel times from up to 25 origins to up to 25 destinations in one call, as a matrix with a map and a CSV. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_travel_times` | | MCP tool | `get_travel_times` on `https://mcp.terra-lab.ai/mcp` | | Group | Terrain and routes | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_travel_times \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"origins":["Lyon","Grenoble"],"destinations":["Annecy","Chambéry","Valence"],"mode":"driving"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_travel_times", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "origins": ["Lyon", "Grenoble"], "destinations": ["Annecy", "Chambéry", "Valence"], "mode": "driving", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_travel_times', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "origins": [ "Lyon", "Grenoble" ], "destinations": [ "Annecy", "Chambéry", "Valence" ], "mode": "driving" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"origins":[{"latitude":48.8566,"longitude":2.3522,"name":"Depot"}],"destinations":["Versailles","Saint-Denis","Créteil"],"mode":"driving"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `origins` | array of string or object | Yes | Start places or points: place names or {latitude, longitude}. 1 to 25 items. | | `destinations` | array of string or object | Yes | End places or points. Repeat the origins for a matrix between every pair of the same places. 1 to 25 items. | | `mode` | string | No | How the trips are travelled. One of `"driving"`, `"walking"`, `"cycling"`. Default `"driving"`. | | `formats` | array of string | No | Download formats. Default `["csv","geojson"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants driving, walking or cycling distances and travel times between many places at once: a distance or travel-time matrix from up to 25 origins to up to 25 destinations (625 pairs) in one call, for example from each warehouse to each store, or between every pair of towns in a list. Computed by Valhalla on the TerraLab server from the OpenStreetMap road network, with each road's typical speed. Returns one row per origin and destination pair (distance_km, duration_min; null with status no_route when no road links them, or not_computed when the routing engine did not answer in time: ask those pairs again), a map of the places and CSV, GeoJSON, KML or Shapefile downloads with a straight line per pair. At most 25 different place names per call, and at most 25 pairs farther apart than 400 km by car (200 km on foot or by bike) in a straight line. For the line along the roads of one trip use get_route. Not for live traffic, a departure time or public transport. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/get_travel_times · Updated 2026-11-23 --- # Satellite image of an area > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A recent Sentinel-2 image of an area in true colour, false colour or NDVI, or an IGN aerial photo in France, as a GeoTIFF. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_satellite_image` | | MCP tool | `get_satellite_image` on `https://mcp.terra-lab.ai/mcp` | | Group | Imagery and land | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_satellite_image \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"Annecy, France","radius_m":300}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_satellite_image", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "Annecy, France", "radius_m": 300, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_satellite_image', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "Annecy, France", "radius_m": 300 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"area":{"place":"Annecy, France","radius_m":2000},"source":"sentinel2","date_from":"2026-09-01","date_to":"2026-09-30"} ``` ```json {"area":{"place":"Beauce, France","radius_m":3000},"product":"ndvi"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | Yes | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `source` | string | No | ign_ortho: IGN orthophotos, France only, true colour. sentinel2: Copernicus Sentinel-2, worldwide, 10 m. Default: ign_ortho inside metropolitan France for true colour without a date, sentinel2 otherwise. One of `"sentinel2"`, `"ign_ortho"`. | | `product` | string | No | Sentinel-2 only. true_color; false_color (B08, B04, B03: vegetation in red); ndvi (float32, NaN where cloud, shadow, snow or no data). One of `"true_color"`, `"false_color"`, `"ndvi"`. Default `"true_color"`. | | `date` | string | No | Sentinel-2: one day, YYYY-MM-DD. | | `date_from` | string | No | Sentinel-2: start of the date range, YYYY-MM-DD. Default: 60 days before date_to. | | `date_to` | string | No | Sentinel-2: end of the date range, YYYY-MM-DD. Default: today. | | `max_cloud_percent` | number | No | Sentinel-2: highest cloud cover of the whole scene, in percent. From 0 to 100. Default `20`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a satellite image or aerial photo of an area as a GIS file: a recent true colour picture, a false colour image, or NDVI to see vegetation, crops or forest health. The area is a bbox, a place, or a place with a radius. Two sources: IGN orthophotos (France only, about 0.5 to 1 m pixels, areas up to 2 x 2 km, radius_m 900 or less; the default inside metropolitan France for true colour) and Copernicus Sentinel-2 L2A (worldwide, 10 m, a scene every few days, areas up to 20 x 20 km, radius_m 9,500 or less; the default elsewhere and for false colour, NDVI or a date). For Sentinel-2 it picks, among the scenes covering the whole area in the date range (default: the last 60 days, at most 20 % cloud over the whole scene), the one clearest over the area itself, and says its date, id, cloud cover and clear share. When no scene passes, it takes the least cloudy one up to 60 % cloud, then looks 5 days either side, and without a date up to 180 days back; the answer says so. Returns a GeoTIFF in the source's own projected CRS (UTM or Lambert-93) with the licence in the file, and a preview on a map. Not for street-level photos, live weather or a picture more recent than a few days; to explain what NDVI or a band is, answer without this tool. For index statistics (NDVI, NDWI, NBR, NDBI) or the change between two dates, use get_satellite_index. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/get_satellite_image · Updated 2026-11-23 --- # Sentinel-2 index and change > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. NDVI, NDWI, NBR or NDBI statistics and a map for an area on one date, or the change between two dates, from cloud-masked Sentinel-2 scenes. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_satellite_index` | | MCP tool | `get_satellite_index` on `https://mcp.terra-lab.ai/mcp` | | Group | Imagery and land | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_satellite_index \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"Central Park, New York","radius_m":1500},"index":"ndvi","date":"2026-07-15","compare_date":"2026-01-15"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_satellite_index", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "Central Park, New York", "radius_m": 1500, }, "index": "ndvi", "date": "2026-07-15", "compare_date": "2026-01-15", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_satellite_index', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "Central Park, New York", "radius_m": 1500 }, "index": "ndvi", "date": "2026-07-15", "compare_date": "2026-01-15" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"area":{"place":"Lahaina, Maui","radius_m":3000},"index":"nbr","date":"2023-07-01","compare_date":"2023-08-15"} ``` ```json {"area":{"place":"Central Park, New York","radius_m":1500},"index":"ndvi","date":"2025-01-01","end_date":"2025-12-31"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | No | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `index` | string | No | ndvi (B08, B04): vegetation; ndwi (B03, B08): open water; nbr (B08, B12): burn scars; ndbi (B11, B08): built-up land. One of `"ndvi"`, `"ndwi"`, `"nbr"`, `"ndbi"`. Default `"ndvi"`. | | `date` | string | No | The day to analyse, YYYY-MM-DD; left out, today with window_days 30 (a recent index). With compare_date, one of the two days. | | `compare_date` | string | No | The other day for a change, YYYY-MM-DD, before or after date. The change is always the later minus the earlier. | | `window_days` | number | No | Days either side of each date in which to look for the clearest scene. From 0 to 45. Default `15`. | | `zones_url` | string | No | For the index of each polygon (parcels, fields, districts) on one date: a public link to the polygons, or a TerraLab download link. The zones' extent replaces area. | | `zones_geojson` | object | No | The zones as a GeoJSON FeatureCollection, Feature or polygon in WGS 84, instead of zones_url. | | `zones_file` | object | No | The zones as a file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `zones_file.download_url` | string | Yes | | | `zones_file.file_id` | string | Yes | | | `zones_file.file_name` | string | No | | | `zones_file.mime_type` | string | No | | | `name_field` | string | No | With zones: the attribute that names each zone. Left out: name, label or id when present. Up to 80 characters. | | `end_date` | string | No | For a time series: the last day, YYYY-MM-DD, with date as the first. One row per month (at most 12 months a call), no GeoTIFF. | | `step` | string | No | For a time series. month: the clearest scene of each month. scene: the 12 least cloudy scenes of the range, one per day. One of `"month"`, `"scene"`. Default `"month"`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants numbers or a change map from Sentinel-2 spectral indices: NDVI (vegetation, greenness, crops), NDWI (open water), NBR (burn scars, fire severity) or NDBI (built-up land), for an area on one date, or the change between two dates ("how much greener in July than in January", "burn scar after the fire"). Give area (or zones) and date (left out: the clearest scene of the last 30 days), and compare_date for a change. For each date it takes the clearest Copernicus Sentinel-2 L2A scene over the area within window_days (default 15), masks cloud, shadow and snow with the scene classification, and names each scene id, date and cloud cover. One date: mean, median and percentiles. Two dates: the later minus the earlier index, five classes (strong loss, loss, stable, gain, strong gain) with their area in hectares. Returns a float32 GeoTIFF (UTM, 10 m) and a coloured map. Time series (seasonal cycle, trend, "is this loss real or seasonal"): give date and end_date for one row per month, up to 12 months a call (mean, min, max, clear share, scene id) and a CSV; each month read counts as one scene. Per polygon (zonal statistics of an index): give zones_url, zones_geojson or zones_file with one date for the mean, min, max and clear share of each zone, as rows and as the zones with these attributes; the extent of the zones is the area. Areas up to 20 x 20 km (radius_m 9,500 or less). Not for a plain picture or a single NDVI image file (get_satellite_image), live weather, or to explain what an index is. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/get_satellite_index · Updated 2026-11-23 --- # Statistics of a raster per polygon > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A raster summarised for each polygon of a layer: population, land cover shares, or elevation and slope per district, parcel or catchment. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/zonal_statistics` | | MCP tool | `zonal_statistics` on `https://mcp.terra-lab.ai/mcp` | | Group | Imagery and land | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/zonal_statistics \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dataset":"population","url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson","name_field":"name"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/zonal_statistics", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "dataset": "population", "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson", "name_field": "name", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/zonal_statistics', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "dataset": "population", "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson", "name_field": "name" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"dataset":"land_cover","geojson":{"type":"Polygon","coordinates":[[[3.86,43.6],[3.9,43.6],[3.9,43.62],[3.86,43.62],[3.86,43.6]]]}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `dataset` | string | Yes | "population", "land_cover", "elevation", or a raster id from find_datasets such as "ghs_pop", "worldpop_1km", "esa_worldcover", "clc2018_cog", "ghs_built_h". Up to 80 characters. | | `url` | string | No | The zones: a public http(s) link to polygons, or a TerraLab download link from an earlier answer. | | `file` | object | No | The zones as a file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `geojson` | object | No | The zones as a GeoJSON FeatureCollection, Feature or polygon in WGS 84 (longitude, latitude). | | `name_field` | string | No | The attribute that names each zone in the rows. Left out: name, label or id when present, else the zones are numbered. Up to 80 characters. | | `variables` | object | No | Values for the dataset's variables, as find_datasets lists them: {"YEAR": "2015"}, {"RETURN_PERIOD": "100"}. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants zonal statistics, a raster summarised for each polygon of a layer (per district, parcel, catchment, buffer or isochrone): "population of each commune", "land cover shares per parcel", "mean elevation and slope of each catchment", "flood depth per neighbourhood". Give the zones as url (a public link or a TerraLab download link, such as the divisions of extract_open_data or a buffer of process_geometry), file or geojson, and dataset: "population" (GHS-POP 2025, 100 m), "land_cover" (ESA WorldCover, 10 m), "elevation" (Copernicus DEM, with mean slope) or any raster id from find_datasets. Returns one row per zone (population and density; share and hectares per class; or min, max, mean, sum) and the zones with these as attributes (GeoPackage, GeoJSON, CSV), never the pixels. A pixel counts when its centre lies inside the zone, on the dataset's own grid. Limits: 5,000 zones, 16 million pixels over their extent (8 million for 64-bit data such as population); a refusal gives the numbers. Not for one area (estimate_population, extract_dataset with summary), a Sentinel-2 index per zone (get_satellite_index with zones_url) or counting features per polygon (process_geometry). Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. TerraLab reads the zones to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/zonal_statistics · Updated 2026-11-23 --- # Forest type (natural, planted, plantation) > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Whether a forest is natural, naturally regenerating, planted, a plantation or tree crops, mapped at 10 m for 2020. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_forest_type` | | MCP tool | `get_forest_type` on `https://mcp.terra-lab.ai/mcp` | | Group | Imagery and land | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_forest_type \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"Morcenx, France","radius_m":3000}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_forest_type", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "Morcenx, France", "radius_m": 3000, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_forest_type', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "Morcenx, France", "radius_m": 3000 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"area":{"bbox":[-60.2,-2.6,-60.1,-2.5]}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | Yes | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks whether a forest is natural, primary, naturally regenerating, planted, a plantation or tree crops (oil palm, cocoa, coffee, rubber, orchards, agroforestry), for example for EUDR due diligence (deforestation-free sourcing, 2020 cut-off), certification, a carbon or biodiversity project or a land purchase. The area is a bbox, a named place (its whole extent), or a place with a radius (a point without a radius: 1,000 m), at most about 300 km². Reads Forest Typology (ForTy) 2020 v1 by Google DeepMind, a 10 m global map, and returns the share of each class in percent and hectares (primary forest, naturally regenerating forest, planted forest, plantation forest, tree crops and agroforestry, other land), the dominant class, a map, and a GeoTIFF of the class raster clipped to the area that opens in QGIS. Caveat: 2020 baseline; planted vs naturally regenerating is the least reliable class. Not for forest loss after 2020, tree height or species. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/get_forest_type · Updated 2026-11-23 --- # Estimate the population of an area > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A modelled estimate of the people living in a circle, a bounding box, a travel area or an administrative boundary, from the GHS-POP 2025 grid. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/estimate_population` | | MCP tool | `estimate_population` on `https://mcp.terra-lab.ai/mcp` | | Group | Imagery and land | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/estimate_population \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"Gare de Lyon Part-Dieu","radius_m":1000}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/estimate_population", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "Gare de Lyon Part-Dieu", "radius_m": 1000, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/estimate_population', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "Gare de Lyon Part-Dieu", "radius_m": 1000 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"travel":{"start":"Nairobi Central railway station","minutes":15,"mode":"walk"}} ``` ```json {"area":{"place":"Villeurbanne","level":"municipality"}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | No | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `area.level` | string | No | With a place and no radius: use its administrative boundary at this level (Overture divisions). One of `"country"`, `"region"`, `"county"`, `"municipality"`. | | `travel` | object | No | The area reachable from a start along the roads (Valhalla on the OpenStreetMap network), instead of area. | | `travel.start` | string or object | No | | | `travel.minutes` | number | No | At most 120. | | `travel.km` | number | No | At most 200. | | `travel.mode` | string | No | One of `"walk"`, `"drive"`, `"bike"`. Default `"walk"`. | | `source` | string | No | ghs_pop: GHS-POP 2025, 100 m. worldpop_1km: WorldPop, 1 km, to compare. One of `"ghs_pop"`, `"worldpop_1km"`. Default `"ghs_pop"`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks how many people live in an area: "how many people live within 1 km of Lyon Part-Dieu?", "within 15 minutes' walk of Nairobi Central station", "population of the commune of Villeurbanne". Give exactly one of: area with a place and radius_m (a circle) or a bbox; area with a place and level (municipality, county, region, country) for its administrative boundary; or travel (start, minutes or km, mode walk, drive or bike) for the area reachable along the roads. Sums the GHS-POP 2025 grid (100 m cells, EC JRC, CC BY 4.0) over the polygon, or worldpop_1km with source. Returns the population rounded to 10, the density per km², the area, and the polygon used as a GeoPackage. This is a modelled estimate from satellite-derived built-up areas and census totals, not a census count: say so, and never present it as an official figure. Limits: 50,000 km² per call; travel at most 120 minutes or 200 km. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/estimate_population · Updated 2026-11-23 --- # French cadastral parcel and zoning > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The French cadastral parcel at an address or point, its reference and area, and the urban plan zone that applies there. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/french_parcel` | | MCP tool | `french_parcel` on `https://mcp.terra-lab.ai/mcp` | | Group | France | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/french_parcel \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"address":"12 rue de la Paix, Annecy"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/french_parcel", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "address": "12 rue de la Paix, Annecy", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/french_parcel', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "address": "12 rue de la Paix, Annecy" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"latitude":48.8566,"longitude":2.3522} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `address` | string | No | An address in France. The place the user asks about, not the user's own location. | | `latitude` | number | No | Latitude in France. The place the user asks about, not the user's own location. From -90 to 90. | | `longitude` | number | No | Longitude in France. The place the user asks about, not the user's own location. From -180 to 180. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks which cadastral parcel (parcelle cadastrale, plot of land) is at an address or point in France, its reference (commune, section, number) and cadastral area, or which local urban plan zone applies there (PLU or PLUi zoning: zone label, type such as U, AU, A or N, and the plan document), for example before buying land or a house or before a building project. Reads the open data of the French cadastre (DGFiP) and of the Géoportail de l'Urbanisme. Shows the parcel on a map with GeoJSON and KML downloads. France only. Never returns owners or property sales. The zone is not a building permit decision. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file. Source: https://terra-lab.ai/docs/api/french_parcel · Updated 2026-11-23 --- # French cadastral parcels and zoning in an area > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Every French cadastral parcel in an area, with its reference, its area and the urban plan zone it lies in, as a GIS file. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/french_parcels_in_area` | | MCP tool | `french_parcels_in_area` on `https://mcp.terra-lab.ai/mcp` | | Group | France | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/french_parcels_in_area \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"Palais de l'\''Isle, Annecy","radius_m":1000},"formats":["geojson","csv"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/french_parcels_in_area", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "Palais de l'Isle, Annecy", "radius_m": 1000, }, "formats": ["geojson", "csv"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/french_parcels_in_area', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "Palais de l'Isle, Annecy", "radius_m": 1000 }, "formats": [ "geojson", "csv" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | Yes | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `formats` | array of string | No | Download formats. Default `["geojson"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks for all the cadastral parcels (parcelles cadastrales) in an area of France, for example "the parcels within 1 km of Annecy old town" or "the plots and their PLU zones in this bbox": each parcel with its reference (commune, INSEE code, section, number), cadastral area and the local urban plan zone it lies in (PLU or PLUi: label, type U, AU, A or N, document). The area is a place with a radius (default 300 m, at most 1,000 m) or a bbox of at most 4 km². For the single parcel at one address or point, use french_parcel instead. Shows the parcels on a map with GeoJSON, KML, Shapefile zip or CSV downloads. France only. Never returns owners or property sales. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/french_parcels_in_area · Updated 2026-11-23 --- # French building heights > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Height in metres, floors, main use and year built of every building around an address or in a small area in France, from IGN BD TOPO. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/french_building_heights` | | MCP tool | `french_building_heights` on `https://mcp.terra-lab.ai/mcp` | | Group | France | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/french_building_heights \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"area":{"place":"10 place Bellecour, Lyon","radius_m":150}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/french_building_heights", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "area": { "place": "10 place Bellecour, Lyon", "radius_m": 150, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/french_building_heights', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "area": { "place": "10 place Bellecour, Lyon", "radius_m": 150 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"area":{"bbox":[2.294,48.857,2.299,48.86]},"formats":["shapefile"]} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `area` | object | Yes | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `formats` | array of string | No | Download formats. Default `["geojson"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks how tall the buildings are around an address or in a small area in France: height in metres per building, floors, main use, year built and ground altitude, from IGN BD TOPO. The area is a place with a radius (default 150 m, at most 2,000 m) or a bbox of at most 16 km². Shows the buildings on a map with a height summary (count, median, tallest) and GeoJSON, KML, Shapefile zip or CSV downloads. France only (mainland, Corsica and overseas departments). Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/french_building_heights · Updated 2026-11-23 --- # Natural risks at an address or a point > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Natural risks at an address or point: flood zones, clay, seismic zone, cavities and commune risks in France, river flood depth elsewhere. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/get_natural_risks` | | MCP tool | `get_natural_risks` on `https://mcp.terra-lab.ai/mcp` | | Group | France | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/get_natural_risks \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"address":"12 quai Saint-Antoine, 69002 Lyon"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/get_natural_risks", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "address": "12 quai Saint-Antoine, 69002 Lyon", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/get_natural_risks', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "address": "12 quai Saint-Antoine, 69002 Lyon" }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"latitude":24.45,"longitude":89.7,"risks":["flood"]} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `address` | string | No | An address or place. The place the user asks about, not the user's own location. Up to 300 characters. | | `latitude` | number | No | From -90 to 90. | | `longitude` | number | No | From -180 to 180. | | `risks` | array of string | No | Keep only these risks. Leave out for all. 0 to 8 items. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks about the natural risks of an address or a point: "is 12 quai Saint-Antoine, Lyon in a flood zone?", "clay shrink-swell hazard at this address", "100-year flood depth at 24.45, 89.70 in Sirajganj, Bangladesh". Give exactly one of: address, or latitude with longitude. In France (TerraLab copies of Géorisques files, refreshed weekly): flood zones of the 124 TRI, clay shrink-swell exposure, seismic zone and cavities within 500 m at the point; flood, radon, landslide, wildfire and industrial risks of the commune (scope says point or commune). Elsewhere: JRC river flood depth for 10, 100 and 500-year floods (about 1 km cells). risks keeps some of them. Each value has a status: ok, absent (the source maps this place and finds nothing), failed (the source did not answer: say it is unknown and can be retried, never that there is no risk) or not_mapped (no source covers it here: unknown, not safe). Read the status before the value. One point per call. Regulatory zones are not a building decision; give the Géorisques report link for France. Never use the user's current location unless they type it. Source: https://terra-lab.ai/docs/api/get_natural_risks · Updated 2026-11-23 --- # Find a dataset in the TerraLab catalogue > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Search the TerraLab catalogue of open datasets by need or place, with each licence, coverage, size and the call that gets it. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/find_datasets` | | MCP tool | `find_datasets` on `https://mcp.terra-lab.ai/mcp` | | Group | Data catalog | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/find_datasets \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query":"land cover","area":{"place":"Kenya"}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/find_datasets", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "query": "land cover", "area": { "place": "Kenya", }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/find_datasets', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "query": "land cover", "area": { "place": "Kenya" } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"query":"administrative boundaries","area":{"place":"Indonesia"}} ``` ```json {"ids":["esa_worldcover"],"area":{"place":"Belgium"}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `query` | string | No | What the data is about, in a few English words (the catalogue is in English: translate the user's words): "land cover", "flood hazard", "administrative boundaries", "population". Local collections (Portolan) are titled in the publisher's language: add the user's own word when it is not English ("playgrounds Spielplätze"). Up to 200 characters. | | `area` | object | No | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `kind` | string | No | Keep one kind of dataset only. One of `"addresses"`, `"air_quality"`, `"basemap"`, `"biodiversity"`, `"boundaries"`, `"buildings"`, `"cadastre"`, `"climate"`, `"elevation"`, `"energy"`, `"extract"`, `"geology"`, `"hazards"`, `"health"`, `"hydrology"`, `"imagery"`, `"landcover"`, `"poi"`, `"population"`, `"settlements"`, `"soil"`, `"topographic_base"`, `"transport"`. | | `ids` | array of string | No | Describe these dataset ids (from an earlier answer, portolan: ids too) instead of searching; with area, each gets its size estimate there. 0 to 20 items. | | `limit` | integer | No | How many datasets to return. From 1 to 20. Default `5`. | | `open_catalogues` | boolean | No | Also search the open catalogues (adds a few seconds). False: TerraLab catalogue only. Default `true`. | | `request_id` | string | No | An id request_data returned (dr_ and 10 characters): gives that data request's status instead of searching. Up to 40 characters. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user asks what data exists for a need or a place before getting it: "what land cover data do you have for Kenya?", "official district boundaries of Indonesia", "is there a flood hazard map for Romania?". Searches the TerraLab catalogue of 353 hosted open datasets (land cover, boundaries, hazards, population, elevation, soil, buildings, hydrology, climate) and about 9,800 datasets TerraLab only points to. Give query (a few words), and area (a country or a place) to keep only datasets covering it and to get a size estimate. Also searches open catalogues live (data.gouv.fr for France, dados.gov.pt for Portugal, data.public.lu for Luxembourg, data.europa.eu for the other European countries, Source Cooperative, Microsoft Planetary Computer, Copernicus Data Space) and the Portolan catalogues (cloud-native GeoParquet, PMTiles and COG files with a publisher AGENTS.md, ranked by how well their extent fits the area): open_registry lists the Portolan matches with publisher, official or mirror, last sync date, SPDX licence, file URLs, columns, MapLibre styles and, for the first (or each portolan: id given in ids), the publisher's AGENTS.md notes quoted as third-party data; open_catalogues lists their matches, each with an open licence, extent, formats and read_with (a TerraLab call) or download_url, and, when the catalogue says it, context: last update, planned frequency, overdue update, EU high-value dataset, metadata quality score and the producer's own account of how the data was made. Returns up to limit hosted datasets (5 by default, 20 at most) and up to 3 datasets TerraLab only points to (with ids, every id asked), best first, each with its licence and attribution quoted from the catalogue, resolution, date, coverage, whether TerraLab hosts it, and the call that gets it (extract_dataset, extract_open_data, get_elevation or get_satellite_image). Read hosted first: hosted false means TerraLab does not serve that data, so give its page and offer request_data; never present it as available. An empty list means the catalogue has nothing for this need here, not that the data does not exist. Not for OpenStreetMap features of a place (extract_open_data), whether a forest is natural, planted or a plantation (get_forest_type), elevation (get_elevation) or satellite images and NDVI (get_satellite_image, get_satellite_index): those tools answer in one call. Never use the user's current location unless they type it. Source: https://terra-lab.ai/docs/api/find_datasets · Updated 2026-11-23 --- # Extract a hosted dataset for an area > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A hosted dataset from the TerraLab catalogue cut to an area: a GeoTIFF or a vector file with its licence, or only the statistics. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/extract_dataset` | | MCP tool | `extract_dataset` on `https://mcp.terra-lab.ai/mcp` | | Group | Data catalog | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/extract_dataset \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dataset":"esa_worldcover","area":{"place":"Nakuru, Kenya","radius_m":5000}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/extract_dataset", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "dataset": "esa_worldcover", "area": { "place": "Nakuru, Kenya", "radius_m": 5000, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/extract_dataset', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "dataset": "esa_worldcover", "area": { "place": "Nakuru, Kenya", "radius_m": 5000 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"dataset":"esa_worldcover","area":{"place":"Gare de Montpellier Saint-Roch","radius_m":2000},"summary":true} ``` ```json {"dataset":"cod_ab_idn","area":{"place":"Bandung, Indonesia","radius_m":10000},"variables":{"LEVEL":"3"}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `dataset` | string | No | A dataset id from find_datasets, such as "esa_worldcover", "ghs_pop", "cod_ab_idn", or a portolan: id, or the https URL of a public GeoParquet. Up to 400 characters. | | `area` | object | No | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `variables` | object | No | Values for the dataset's variables, as find_datasets lists them: {"LEVEL": "2"}, {"RETURN_PERIOD": "100"}, {"YEAR": "2015"}. | | `summary` | boolean | No | Rasters: return the class shares or statistics only, without a file. Default `false`. | | `formats` | array of string | No | Vectors: extra download formats. A GeoPackage is always included. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a dataset from the TerraLab catalogue cut to an area, as a GIS file or as numbers: "ESA WorldCover for 5 km around Nakuru as a GeoTIFF". Give dataset (an id from find_datasets) and area (a place with radius_m, or a bbox). Rasters: a GeoTIFF on the dataset's own grid, licence in the file and in a zip, plus class shares or min, max and mean (summary true: numbers only). Vectors: a GeoPackage (GeoJSON, KML, Shapefile or CSV on request) with the feature count. Limits: 4,000 x 4,000 pixels (8 million for 64-bit data) or 20,000 features per call; a larger area gets area_too_large with retry_with, the same call on an area that fits (send it as it is), never a partial file. Some datasets need variables (admin level, year, return period): find_datasets lists them. A Portolan collection (a portolan: id from find_datasets) or any public GeoParquet URL is cut in place: the features whose box meets the area, with variables picking a partition ({"year": "2024"}; the newest otherwise). Quote the licence and attribution in the answer. Not for OpenStreetMap or Overture (extract_open_data), elevation (get_elevation), forest type (get_forest_type) or satellite images (get_satellite_image). Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/extract_dataset · Updated 2026-11-23 --- # Describe a cloud GeoParquet dataset > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. What a public cloud GeoParquet holds, read from its footer only: rows, columns with their ranges, geometry, CRS, extent and partitions. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/inspect_dataset` | | MCP tool | `inspect_dataset` on `https://mcp.terra-lab.ai/mcp` | | Group | Data catalog | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/inspect_dataset \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dataset":"portolan:nasa-firms-active-fire/detections"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/inspect_dataset", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "dataset": "portolan:nasa-firms-active-fire/detections", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/inspect_dataset', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "dataset": "portolan:nasa-firms-active-fire/detections" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `dataset` | string | Yes | A portolan: id from find_datasets (open_registry), or the https URL of a public GeoParquet file, a hive glob such as https://.../year=*/data.parquet, an s3:// or gs:// address, or a STAC collection.json. Up to 400 characters. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants to know what a public cloud GeoParquet holds before querying it: "what columns does the Fields of The World file have?", "which years does the FIRMS fire archive cover?". Give dataset: a portolan: id from find_datasets (open_registry), or the https URL of a GeoParquet file or of a hive-partitioned folder (.../year=*/x.parquet). Reads only the file footer, never the rows: row count, row groups, columns with type, min, max and null count, geometry column, CRS and bbox, compression, and for a partitioned dataset its partitions (keys and values). zone_queries says whether aggregate_dataset can count it per zone. Then aggregate_dataset counts or sums it per zone and extract_dataset cuts it to an area. Source: https://terra-lab.ai/docs/api/inspect_dataset · Updated 2026-11-23 --- # Count and sum a cloud GeoParquet per zone > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A count, sum or average over a large public GeoParquet for a place or per zone (state, county, region, district), without downloading it. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/aggregate_dataset` | | MCP tool | `aggregate_dataset` on `https://mcp.terra-lab.ai/mcp` | | Group | Data catalog | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/aggregate_dataset \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"dataset":"portolan:harmonized-field-data/glocab","zones":{"per":"state","units":["Arkansas"]}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/aggregate_dataset", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "dataset": "portolan:harmonized-field-data/glocab", "zones": { "per": "state", "units": ["Arkansas"], }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/aggregate_dataset', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "dataset": "portolan:harmonized-field-data/glocab", "zones": { "per": "state", "units": [ "Arkansas" ] } }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"dataset":"portolan:nasa-firms-active-fire/detections","zones":{"per":"county","within":"California"},"where":[{"column":"year","op":"eq","value":2024}]} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `dataset` | string | Yes | A portolan: id from find_datasets (open_registry), or the https URL of a public GeoParquet file, a hive glob such as https://.../year=*/data.parquet, an s3:// or gs:// address, or a STAC collection.json. Up to 400 characters. | | `area` | object | No | The area: a bbox, or a place (name, address or coordinates) with an optional radius in metres. The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `zones` | object | No | One row per zone instead of one area. | | `zones.per` | string | Yes | The zone level. One of `"state"`, `"county"`, `"zip"`, `"place"`, `"country"`, `"region"`, `"locality"`, `"neighborhood"`, `"adm1"`, `"adm2"`, `"adm3"`, `"adm4"`. | | `zones.within` | string | No | The place whose zones are read: "California", "Kenya", or a zone id (US-STATE-06). Up to 200 characters. | | `zones.units` | array of string | No | Only these zones, by name or code, at the level per gives. 0 to 200 items. | | `where` | array of object | No | Conditions that must all hold. A condition on a partition key (year) picks the files before any byte is read; without one, only the newest partition is read. 0 to 12 items. | | `group_by` | array of string | No | Columns to group by, one row per value (per zone). 0 to 2 items. | | `aggregates` | array of object | No | Values beside the count: sum, mean, min or max of a column; area_m2 of the geometries. 0 to 8 items. | | `limit` | integer | No | Rows returned, largest count first; distinct_groups says how many there are. From 1 to 100. Default `50`. | | `dry_run` | boolean | No | Only the plan: files, row groups and bytes the query would read. Default `false`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a count, sum or average over a large public GeoParquet for a place or per zone, without downloading it: "how many crop fields are in Arkansas?", "active fires per county in California in 2024", "total building footprint area in Berlin Mitte", "fields per crop type". Give dataset (a portolan: id from find_datasets, or a GeoParquet URL; inspect_dataset lists its columns and partitions), then the area: area (a named place is cut to its outline; a place with radius_m is a disk; a bbox), or zones for one row per zone (per: state, county, zip, place in the US; country, region, locality, neighborhood anywhere; adm1 to adm4 official units; within: the parent place, or units: the zones by name). Without either, the whole file. where filters rows (a condition on the partition key, such as year, picks the files; without one only the newest partition is read). group_by gives one row per value (up to 2 columns); aggregates adds sum, mean, min or max of a column, or area_m2 of the geometries (reads the geometry, heavier). A row counts in a zone when the centre of its bounding box lies inside. Only the row groups the zones touch are read (a state from a multi-GB file in seconds); a query over the caps gets too_large with the estimate. Returns the table (zone, group, count, values), totals, distinct_groups and what was read. No features: extract_dataset cuts them. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Source: https://terra-lab.ai/docs/api/aggregate_dataset · Updated 2026-11-23 --- # Ask TerraLab to add data it does not have > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Ask TerraLab to add geographic data the catalogue does not have yet, with what you need and up to five places where you need it. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/request_data` | | MCP tool | `request_data` on `https://mcp.terra-lab.ai/mcp` | | Group | Data catalog | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/request_data \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"description":"Official flood zones of Morocco","example_locations":["Fes, Morocco"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/request_data", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "description": "Official flood zones of Morocco", "example_locations": ["Fes, Morocco"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/request_data', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "description": "Official flood zones of Morocco", "example_locations": [ "Fes, Morocco" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"description":"Noise maps of Lyon","example_locations":["Lyon"],"idempotency_key":"noise-lyon-1"} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `description` | string | No | The data needed, in the user's words: "official flood zones of Morocco". Up to 2000 characters. | | `example_locations` | array of string or object | No | Up to 5 places where the data is needed: each a place name, {"place": name}, or {"latitude", "longitude"}; never both a place and coordinates. 0 to 5 items. | | `use_case` | string | No | What the user wants to do with it, when they said so. Up to 500 characters. | | `file_anyway` | boolean | No | File the request even when a hosted dataset seems to answer it (the user said it does not). Default `false`. | | `idempotency_key` | string | No | Any string that stays the same if this call is sent again; the same key and description return the first request. Up to 80 characters. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user needs geographic data that find_datasets did not find, and wants TerraLab to add it: "you don't have the official flood zones of Morocco? Can you ask TerraLab to add them?". Give description (what data, in the user's words) and up to 5 example_locations (places or coordinates where it is needed). The catalogue is searched first: when a hosted dataset already answers, the answer is matched_existing with the call that gets it and nothing is filed (file_anyway true files it all the same, for data the user says is different). Otherwise the request is filed and gets a request_id (dr_ and 10 characters) to quote to the user; find_datasets with request_id gives its status later. Someone at TerraLab reads every request once a week; no date is promised, so never promise one. The same idempotency_key with the same description returns the first request instead of filing it twice. Only for data TerraLab could host (maps, layers, statistics by place), not for questions or bugs. Never use the user's current location unless they type it. Source: https://terra-lab.ai/docs/api/request_data · Updated 2026-11-23 --- # Straight-line distance between places > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Straight-line geodesic distance between 2 or more places or points, with the midpoint and bearing for two, or the length of a line. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/measure_distance` | | MCP tool | `measure_distance` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/measure_distance \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"points":["Paris, France","Geneva, Switzerland"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/measure_distance", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "points": ["Paris, France", "Geneva, Switzerland"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/measure_distance', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "points": [ "Paris, France", "Geneva, Switzerland" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` Other valid request bodies: ```json {"geometry":{"type":"LineString","coordinates":[[2.35,48.85],[2.36,48.86]]}} ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `points` | array of string or object | No | Points or place names in order, 2 or more. The place the user asks about, not the user's own location. 2 to 500 items. | | `geometry` | object | No | A drawn LineString or MultiLineString as GeoJSON (WGS 84 longitude, latitude), instead of points. | | `geometry.type` | string | No | | | `geometry.coordinates` | array | No | | | `geometry.geometry` | object | No | | | `formats` | array of string | No | Download formats. Default `["geojson","kml"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the straight-line (as the crow flies) distance between 2 or more places or points, with the midpoint and bearing for two, or the length of a drawn line. Geodesic on the WGS 84 ellipsoid, in m, km and miles. Not a road or travel distance (get_route), not an elevation profile (get_elevation). Returns the figures, a map and GeoJSON, KML, Shapefile zip or CSV downloads. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/measure_distance · Updated 2026-11-23 --- # Area and perimeter of a shape > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Geodesic area and perimeter of a shape given by its corner points, place names or a drawn polygon. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/measure_area` | | MCP tool | `measure_area` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/measure_area \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"points":[{"latitude":45.9,"longitude":6.12},{"latitude":45.9,"longitude":6.13},{"latitude":45.91,"longitude":6.13}]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/measure_area", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "points": [{ "latitude": 45.9, "longitude": 6.12, }, { "latitude": 45.9, "longitude": 6.13, }, { "latitude": 45.91, "longitude": 6.13, }], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/measure_area', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "points": [ { "latitude": 45.9, "longitude": 6.12 }, { "latitude": 45.9, "longitude": 6.13 }, { "latitude": 45.91, "longitude": 6.13 } ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `points` | array of string or object | No | Corner points or place names in order, 3 or more. The place the user asks about, not the user's own location. 2 to 500 items. | | `geometry` | object | No | A drawn Polygon or MultiPolygon as GeoJSON (WGS 84 longitude, latitude), instead of points. | | `geometry.type` | string | No | | | `geometry.coordinates` | array | No | | | `geometry.geometry` | object | No | | | `formats` | array of string | No | Download formats. Default `["geojson","kml"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the area and perimeter of a shape given by 3 or more corner points or place names, or of a drawn polygon. Geodesic on the WGS 84 ellipsoid, in m², ha and km². Not for the area of every feature in a file (add_area_and_length). Returns the figures, a map and GeoJSON, KML, Shapefile zip or CSV downloads. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/measure_area · Updated 2026-11-23 --- # Circle of a given radius around a place > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A circle of a given radius around a place or a point, with its area and circumference, as a map and a GIS file. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/circle_around_place` | | MCP tool | `circle_around_place` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/circle_around_place \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"center":"Lyon Part-Dieu","radius_m":5000}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/circle_around_place", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "center": "Lyon Part-Dieu", "radius_m": 5000, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/circle_around_place', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "center": "Lyon Part-Dieu", "radius_m": 5000 }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `center` | string or object | Yes | The center, a place name or {latitude, longitude}. The place the user asks about, not the user's own location. | | `radius_m` | number | Yes | The radius in metres (convert km or miles first). From 1 to 2000000. | | `formats` | array of string | No | Download formats. Default `["geojson","kml"]`. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a circle of a given radius around a place or a point, as a map and a GIS file, with its area and circumference: "everything within 5 km of Lyon Part-Dieu". Not a travel-time or road-distance area (get_travel_area). Returns the figures, a map and GeoJSON, KML, Shapefile zip or CSV downloads. Never use the user's current location unless they type it. Give the place as the user names it (place name, address or coordinates): this tool locates it, so find_places is not needed first. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. Source: https://terra-lab.ai/docs/api/circle_around_place · Updated 2026-11-23 --- # Buffer features by a distance > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A buffer of a given width around each feature of a layer, or one merged area whose overlaps count once, as a GIS file. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/buffer_features` | | MCP tool | `buffer_features` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/buffer_features \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"geojson":{"type":"LineString","coordinates":[[6.12,45.9],[6.13,45.905]]},"radius_m":200}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/buffer_features", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "geojson": { "type": "LineString", "coordinates": [[6.12, 45.9], [6.13, 45.905]], }, "radius_m": 200, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/buffer_features', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "geojson": { "type": "LineString", "coordinates": [ [ 6.12, 45.9 ], [ 6.13, 45.905 ] ] }, "radius_m": 200 }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `radius_m` | number | Yes | The buffer distance in metres (convert km or miles first). From 0.1 to 100000. | | `dissolve` | boolean | No | Merge all buffers into one feature, so overlaps count once in the total area. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a buffer (zone of a given width) around features or a drawn line or polygon: an uploaded file, a link, inline GeoJSON, or a download link from another TerraLab answer. Each feature gets its own buffer polygon, or with dissolve one merged area whose overlaps count once, built in a local equidistant projection; up to 25,000 vertices. Returns the feature count, total area, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Not for a circle around one place (circle_around_place). Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/buffer_features · Updated 2026-11-23 --- # Merge (dissolve) features into one > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The features of a layer merged into one, or into one per value of a field, with the total area or length. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/dissolve_features` | | MCP tool | `dissolve_features` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/dissolve_features \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","dissolve_field":"class"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/dissolve_features", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "dissolve_field": "class", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/dissolve_features', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "dissolve_field": "class" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `dissolve_field` | string | No | Dissolve into one feature per value of this field instead of one feature. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants to merge, union or dissolve the features of a layer (an uploaded file, a link, inline GeoJSON or a TerraLab download link) into one feature, or one per value of dissolve_field. Up to 20,000 features and 100,000 vertices. Returns the feature count, total area or length, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/dissolve_features · Updated 2026-11-23 --- # Keep the parts inside a second layer > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The parts of each feature that lie inside a second layer of polygons, with their attributes. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/intersect_layers` | | MCP tool | `intersect_layers` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/intersect_layers \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","with_url":"https://example.com/flood-zones.geojson"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/intersect_layers", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/flood-zones.geojson", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/intersect_layers', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/flood-zones.geojson" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The second layer, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84. Only its polygons count. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the intersection of a layer with a second layer of polygons: the parts of each feature that lie inside it, with their attributes. Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link. Up to 20,000 features and 100,000 vertices. Returns the feature count, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. To cut to a place or a box instead of a layer, use clip_features. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/intersect_layers · Updated 2026-11-23 --- # Remove the parts inside a second layer > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Each feature of a layer minus the parts inside a second layer of polygons, such as buildings outside the flood zones. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/erase_with_layer` | | MCP tool | `erase_with_layer` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/erase_with_layer \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","with_url":"https://example.com/flood-zones.geojson"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/erase_with_layer", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/flood-zones.geojson", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/erase_with_layer', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/flood-zones.geojson" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The second layer, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84. Only its polygons count. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the difference of a layer with a second layer of polygons: each feature minus the parts inside it ("buildings outside the flood zones"). Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link. Up to 20,000 features and 100,000 vertices. Returns the feature count, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/erase_with_layer · Updated 2026-11-23 --- # Clip features to an area or a layer > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A layer cut to an area: a place, a place with a radius, a bounding box or a second layer of polygons. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/clip_features` | | MCP tool | `clip_features` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/clip_features \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","area":{"place":"Annecy","radius_m":150}}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/clip_features", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "area": { "place": "Annecy", "radius_m": 150, }, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/clip_features', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "area": { "place": "Annecy", "radius_m": 150 } }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `area` | object | No | For clip: the area to keep, as a bbox or a place with a radius (its bounding box is used). The place the user asks about, not the user's own location. | | `area.bbox` | array of number | No | [west, south, east, north] in decimal degrees (WGS 84). Exactly 4 items. | | `area.place` | string or object | No | A place name or address, or a point. | | `area.radius_m` | number | No | Radius around the place in metres. From 1 to 100000. | | `with_file` | object | No | The second layer, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84. Only its polygons count. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants to clip (cut) a layer to an area: a place, a place with radius_m or a bbox (its bounding box is used), or a second layer of polygons. The layer can be an uploaded file, a link, inline GeoJSON or a TerraLab download link. Up to 20,000 features and 100,000 vertices. Returns the feature count, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/clip_features · Updated 2026-11-23 --- # Simplify feature outlines > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Lighter outlines: the lines or polygons of a layer simplified so no vertex moves more than a tolerance in metres. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/simplify_features` | | MCP tool | `simplify_features` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/simplify_features \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","tolerance_m":5}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/simplify_features", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "tolerance_m": 5, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/simplify_features', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "tolerance_m": 5 }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `tolerance_m` | number | Yes | The largest allowed shift of the outline in metres. From 0.01 to 100000. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants lighter outlines: simplify the lines or polygons of a layer (an uploaded file, a link, inline GeoJSON or a TerraLab download link) so no vertex moves more than tolerance_m. Runs in a local equidistant projection; up to 20,000 features and 100,000 vertices. Returns the feature count, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/simplify_features · Updated 2026-11-23 --- # Centre point of each feature > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The centre point of each feature of a layer, with its attributes, for example to turn buildings or parcels into points. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/feature_centroids` | | MCP tool | `feature_centroids` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/feature_centroids \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/feature_centroids", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/feature_centroids', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the centre point (centroid) of each feature of a layer (an uploaded file, a link, inline GeoJSON or a TerraLab download link), with its attributes, for example to turn buildings or parcels into points. Up to 20,000 features and 100,000 vertices. Returns the point count, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/feature_centroids · Updated 2026-11-23 --- # Add area and length to each feature > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The geodesic area, perimeter and length added to every feature of a layer, with the totals. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/add_area_and_length` | | MCP tool | `add_area_and_length` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/add_area_and_length \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/add_area_and_length", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/add_area_and_length', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the area, perimeter or length of every feature of a layer (an uploaded file, a link, inline GeoJSON or a TerraLab download link): adds area_m2, perimeter_m and length_m to each feature, geodesic on the WGS 84 ellipsoid, and gives the totals. Up to 20,000 features and 100,000 vertices. Not for a shape drawn in the chat with a single figure (measure_distance, measure_area), not for converting the format of a file (open_gis_file). Returns a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/add_area_and_length · Updated 2026-11-23 --- # Count features inside each polygon > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. How many features of a layer fall inside each polygon of a second layer, with an optional sum of a numeric field. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/count_in_polygons` | | MCP tool | `count_in_polygons` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/count_in_polygons \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson","with_url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson"}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/count_in_polygons", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson", }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/count_in_polygons', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson" }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The polygons to count in, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the polygons to count in, or a TerraLab download link. | | `with_geojson` | object | No | The polygons to count in, as GeoJSON in WGS 84. | | `sum_field` | string | No | Also sum this numeric field of the counted features per polygon, as sum_. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants to count points in polygons: how many features of a layer (shops, buildings, addresses, accidents) fall inside each polygon of a second layer (districts, parcels, zones), with an optional sum of a numeric field. Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link, up to 20,000 features each. A line or polygon counts where its centroid falls. Returns the polygons with feature_count (and sum_), the largest counts as sample rows, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. To copy the polygon's attributes onto each feature instead, use join_by_location. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/count_in_polygons · Updated 2026-11-23 --- # Nearest feature and its distance > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. For each feature of a layer, the nearest feature of a second layer and the distance to it. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/find_nearest_features` | | MCP tool | `find_nearest_features` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/find_nearest_features \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","with_url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson","join_fields":["name"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/find_nearest_features", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "join_fields": ["name"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/find_nearest_features', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "join_fields": [ "name" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The second layer, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84, of any geometry. | | `join_fields` | array of string | No | The fields of the nearest feature to copy, as nearest_. Its name by default. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants, for each feature of a layer, the nearest feature of a second layer and the distance to it: the closest school to each building, the nearest road to each point. Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link, up to 20,000 features each. Adds nearest_distance_m (geodesic on the WGS 84 ellipsoid, between the two closest points, 0 when they touch) and the chosen fields of the nearest feature as nearest_. Returns the least, median and greatest distance, sample rows, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Not a road distance or travel time (get_travel_times). Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/find_nearest_features · Updated 2026-11-23 --- # Select features by location > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. The features of a layer that intersect a second layer, lie within it or lie within a distance of it, or those that do not. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/select_by_location` | | MCP tool | `select_by_location` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/select_by_location \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson","with_url":"https://example.com/rivers.geojson","relation":"within_distance","distance_m":200}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/select_by_location", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/rivers.geojson", "relation": "within_distance", "distance_m": 200, }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/select_by_location', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/buildings.geojson", "with_url": "https://example.com/rivers.geojson", "relation": "within_distance", "distance_m": 200 }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The second layer, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the second layer, or a TerraLab download link. | | `with_geojson` | object | No | The second layer as GeoJSON in WGS 84, of any geometry. | | `relation` | string | No | intersects (default), within (wholly inside one polygon of the second layer) or within_distance (needs distance_m). One of `"intersects"`, `"within"`, `"within_distance"`. | | `distance_m` | number | No | For within_distance: the distance in metres (convert km or miles first). From 0.1 to 100000. | | `invert` | boolean | No | Keep the features that do not match instead. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants the features of a layer chosen by where they are against a second layer: those that intersect it, lie wholly within one of its polygons, or lie within distance_m of it ("buildings within 200 m of a river", "parcels touching the road"), or with invert those that do not. Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link, up to 20,000 features each. Features keep their attributes and geometry unchanged. Returns the count selected, sample rows, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. To cut features at the edge of an area, use clip_features. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/select_by_location · Updated 2026-11-23 --- # Join attributes by location > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. A spatial join: each feature of a layer takes the attributes of the polygon of a second layer it falls in. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/join_by_location` | | MCP tool | `join_by_location` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/join_by_location \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson","with_url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson","join_fields":["name"]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/join_by_location", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson", "join_fields": ["name"], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/join_by_location', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/pois.geojson", "with_url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/divisions.geojson", "join_fields": [ "name" ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `with_file` | object | No | The polygons whose attributes are copied, uploaded in the conversation. | | `with_file.download_url` | string | Yes | | | `with_file.file_id` | string | Yes | | | `with_file.file_name` | string | No | | | `with_file.mime_type` | string | No | | | `with_url` | string | No | A link to the polygons whose attributes are copied, or a TerraLab download link. | | `with_geojson` | object | No | The polygons whose attributes are copied, as GeoJSON in WGS 84. | | `join_fields` | array of string | No | The fields of the polygons to copy. All of them by default. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants a spatial join: each feature of a layer takes the attributes of the polygon of a second layer it falls in (the district of each shop, the zone of each parcel). Both layers can be an uploaded file, a link, inline GeoJSON or a TerraLab download link, up to 20,000 features each. A line or polygon joins where its centroid falls; a field both layers have is written as _2; features outside every polygon are kept with empty joined fields. Returns the count matched, the joined fields, sample rows, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. To count features per polygon instead, use count_in_polygons. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/join_by_location · Updated 2026-11-23 --- # Filter features by attribute > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Only the features of a layer whose attributes meet conditions, such as roads of class primary or buildings higher than 10 m. | | | | --- | --- | | REST | `POST https://mcp.terra-lab.ai/v1/tools/filter_by_attribute` | | MCP tool | `filter_by_attribute` on `https://mcp.terra-lab.ai/mcp` | | Group | Layer operations | ## Request ```bash curl -X POST https://mcp.terra-lab.ai/v1/tools/filter_by_attribute \ -H "Authorization: Bearer $TERRALAB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://mcp.terra-lab.ai/dl/geojson/TOKEN/roads.geojson","where":[{"field":"class","op":"in","value":["primary","secondary"]}]}' ``` ```python import os import requests response = requests.post( "https://mcp.terra-lab.ai/v1/tools/filter_by_attribute", headers={"Authorization": f"Bearer {os.environ['TERRALAB_API_KEY']}"}, json={ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/roads.geojson", "where": [{ "field": "class", "op": "in", "value": ["primary", "secondary"], }], }, timeout=120, ) response.raise_for_status() print(response.json()["structuredContent"]) ``` ```javascript const response = await fetch('https://mcp.terra-lab.ai/v1/tools/filter_by_attribute', { method: 'POST', headers: { Authorization: `Bearer ${process.env.TERRALAB_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "url": "https://mcp.terra-lab.ai/dl/geojson/TOKEN/roads.geojson", "where": [ { "field": "class", "op": "in", "value": [ "primary", "secondary" ] } ] }), }); const data = await response.json(); console.log(data.structuredContent); ``` ## Parameters A JSON object in the request body; in an MCP client, the arguments of the tool call. | Name | Type | Required | Description | | --- | --- | --- | --- | | `file` | object | No | A file uploaded in the conversation (GeoJSON, KML, KMZ, GPX, zipped Shapefile, CSV or WKT). | | `file.download_url` | string | Yes | | | `file.file_id` | string | Yes | | | `file.file_name` | string | No | | | `file.mime_type` | string | No | | | `url` | string | No | A public http(s) link to the features, or a TerraLab download link from an earlier answer. | | `geojson` | object | No | The features as a GeoJSON FeatureCollection, Feature or geometry in WGS 84 (longitude, latitude). | | `where` | array of object | Yes | The conditions, each {field, op, value}. A missing field equals null. Text that writes a number plainly ("12", "12.5") compares as a number; other text compares without case, and never orders against a number. | | `match` | string | No | Keep the features that meet all conditions (default) or any of them. One of `"all"`, `"any"`. | | `formats` | array of string | No | Download formats. All five by default. | | `title` | string | No | Name for the map and the output files. | ## Response `structuredContent` holds the result, `content` the same result as text for a model, and `isError` is `true` when the tool refused the request or failed; then `structuredContent.code`, `message` and `hint` say what to change. ```json { "structuredContent": { "sources": [{ "name": "...", "licence": "...", "url": "..." }], "downloads": [{ "label": "...", "format": "...", "url": "...", "name": "..." }] }, "content": [{ "type": "text", "text": "..." }], "isError": false } ``` Every result lists its `sources` with their licence. File results come as `downloads`: each link builds its file when opened. ## Errors A missing key answers `401`, an empty balance `402`, too many calls `429`. A call that fails or finds nothing is not counted. See [Errors and rate limits](https://terra-lab.ai/docs/errors). ## Description for agents The text the server gives an agent to decide when to call this tool: > Use this when the user wants only the features of a layer (an uploaded file, a link, inline GeoJSON or a TerraLab download link) whose attributes meet conditions: roads of class primary, buildings higher than 10 m, places whose name contains a word. Each condition is a field, an operator (= != > >= < <= in contains) and a value; match says whether all (default) or any must hold. Text that writes a number plainly compares as a number, other text without case. Up to 20,000 features. Returns the count kept, sample rows, a map and GeoJSON, KML, Shapefile zip, GeoPackage and CSV downloads. Never use the user's current location unless they type it. Download links build their file when opened; no file is saved. The user opens the file in QGIS or any GIS: this server cannot load it into the user's own QGIS or any app on their computer. Never pass these links to open_gis_file: list every format the user needs in formats, in this one call. TerraLab reads the file or link to answer and keeps no copy. Source: https://terra-lab.ai/docs/api/filter_by_attribute · Updated 2026-11-23 --- # Pricing and free calls > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Pay only for what you use. The MCP server and the REST API share one grid and one balance per account. | What | Price | | --- | --- | | Calls included every month | 100, at no cost | | Calls after that | 5 per 1,000 calls | | Satellite image | Counts as 10 calls (0.05 at most) | Amounts are the same figure in EUR and USD, excluding VAT. EUR applies where VAT is added (the European Union), USD elsewhere. ## How it works - The included calls reset on the 1st of each month at 00:00 UTC. - Past them, each call is taken from your prepaid balance. A satellite image counts as 10 calls: it uses the included calls first, then the call price. - Top up from [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) by card: 10, 25, 50, 100. The balance does not expire. - No subscription and no commitment. Within 14 days of a top-up, you can withdraw from it and get back what is left unused. - A call that fails or finds nothing is given back. A call refused for invalid input is counted. ## Read the grid from code The same grid as JSON, with no key needed: ```bash curl https://mcp.terra-lab.ai/v1/meta/pricing ``` Your own usage and balance come from [`GET /v1/me`](https://terra-lab.ai/docs/api#account-and-discovery). ## The QGIS plugins AI Agent, AI Segmentation and AI Edit have their own free tiers and plans, on the [pricing page](https://terra-lab.ai/pricing). See [QGIS plugins](https://terra-lab.ai/docs/plugins). Source: https://terra-lab.ai/docs/pricing · Updated 2026-11-15 --- # Errors and rate limits > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Errors come as JSON with a stable `error` code and a `message` written for a person: ```json { "error": "auth_required", "message": "This tool needs a TerraLab account. Connect TerraLab in your assistant's settings; see https://terra-lab.ai/mcp." } ``` Branch on `error`, never on `message`: the wording can change. ## HTTP errors | Status | `error` | Meaning | What to do | | --- | --- | --- | --- | | 400 | `invalid_input` | The body is not a JSON object of the tool arguments. | Fix the request body. | | 400 | `bad_request` | The request could not be read. | Check the JSON and the headers. | | 401 | `auth_required` | No key or token was sent. | Send `Authorization: Bearer `. | | 401 | `invalid_token` | The key or token is invalid, revoked or expired. | Create a new key, or let the agent sign in again. | | 401 | `access_revoked` | The app was disconnected from the dashboard. | Reconnect the agent. | | 402 | `balance_required` | The free calls of the month are used, or the operation is paid, and the balance is empty. | Add funds; the answer carries `hint` and `account_url`. | | 404 | `not_found` | There is no such API path. | Check the URL. | | 404 | `unknown_tool` | No tool has that name. | List tools with `GET /v1/tools`. | | 405 | `method_not_allowed` | Tools are called with `POST`. | Use `POST`. | | 413 | `too_large` | The request body is too large. | Send a smaller file or fewer features. | | 429 | `rate_limited` | Too many requests in the last minute. | Wait for `Retry-After` seconds, then retry. | | 429 | `daily_limit` | The account reached its daily safety ceiling. | Retry the next day (UTC) or write to support. | | 503 | `unavailable` | The account service did not answer. | Retry after `Retry-After` seconds. | ## Tool errors A tool that runs but cannot answer returns `200` with `isError: true`. Its `structuredContent` then carries `code`, `message` and, most of the time, a `hint` saying what to change: a place it could not find, an area too large, a country it does not cover. ```json { "structuredContent": { "code": "...", "message": "...", "hint": "..." }, "content": [{ "type": "text", "text": "..." }], "isError": true } ``` ## What is counted A call that fails or finds nothing is given back: the included call or the amount taken from the balance returns to the account. A call refused for invalid input (`invalid_input`) is counted, so fix the arguments before you retry. ## Rate limits Every account can make 60 calls a minute. Past it, the API answers `429` with `Retry-After: 60`. Spread batch jobs over time, and retry with a growing delay: ```python import time import requests def call(url, headers, body, attempts=5): for attempt in range(attempts): response = requests.post(url, headers=headers, json=body, timeout=120) if response.status_code not in (429, 503): return response time.sleep(int(response.headers.get("Retry-After", 2 ** attempt))) return response ``` Retry only `429` and `503`. A `401` or `402` will not pass on a second try. Source: https://terra-lab.ai/docs/errors · Updated 2026-11-15 --- # Data sources and licences > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. TerraLab serves open data. Every result lists its `sources` with their licence, and every file you download keeps that licence and its attribution. You pay for the service, never for the data. ## Main sources | Source | Used for | Licence | | --- | --- | --- | | OpenStreetMap | Roads, places, waterways, land use, transit, routes and travel-time areas | ODbL 1.0 | | Overture Maps | Buildings, places, addresses and boundaries | ODbL or CDLA Permissive 2.0, by theme | | Copernicus DEM | Elevation, profiles and contour lines, worldwide at 30 m | Copernicus DEM licence, free with attribution | | Copernicus Sentinel-2 | Satellite images worldwide at 10 m | Copernicus data, free with attribution | | IGN and DGFiP | French addresses, cadastral parcels, urban plan zones, building heights and aerial photos | Licence Ouverte 2.0 | | GHS-POP 2025 (European Commission, JRC) | Population estimates, 100 m grid | CC BY 4.0 | | ForTy 2020 (Google DeepMind, Google Research, WRI, IIASA) | Forest type at 10 m | CC BY 4.0, modified by TerraLab (clip, reprojection) | | Géorisques, BRGM, ASNR | French natural risks: flood zones, clay, radon, seismic zoning, cavities | Licence Ouverte 2.0 | | JRC global river flood hazard | Flood depth outside France | CC BY 4.0 | Hosted datasets from the TerraLab catalogue ([find_datasets](https://terra-lab.ai/docs/api/find_datasets), [extract_dataset](https://terra-lab.ai/docs/api/extract_dataset)) each keep their own licence, quoted with them. The full list of licences and the attribution to show is on [Data licences](https://terra-lab.ai/legal/data-licences). ## Attribution When you publish a map or a dataset built from a TerraLab result, show the credits from its `sources`. For OpenStreetMap data, that is "© OpenStreetMap contributors"; ODbL also asks that a database you share stays under ODbL. ## Limits - Up to 20,000 features per extract, about 1 km around a town centre. - Elevation at 30 m; contour areas up to about 10 × 10 km. - Files up to 50 MB, lists up to 100 addresses. - Parcels, zoning, building heights and IGN photos: France only. - Routes through 25 places; travel areas up to 120 min or 200 km. - Satellite images up to 20 × 20 km at 10 m. - Approximate: not for navigation, surveying or legal boundaries. Each tool page in the [API reference](https://terra-lab.ai/docs/api) gives the exact range of every parameter. ## Privacy - Only what the request needs is sent: a place, an area or a file. - Logs keep the tool, its status and duration, never your question. The requested area is kept 30 days, with no user identifier. - Files are processed in memory, never stored. - Never sold, never used to train AI. Read the [privacy policy](https://terra-lab.ai/privacy-policy) and the [API terms](https://terra-lab.ai/legal/api-terms). Source: https://terra-lab.ai/docs/data-sources · Updated 2026-10-27 --- # Support > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Write to [yvann.barbot@terra-lab.ai](mailto:yvann.barbot@terra-lab.ai). The founders read every message and answer within 2 working days. ## What to include - What you called: the tool name, or the agent and your question. - The request body, without your API key. - The answer you got: status code, `error` code and `message`, or the `structuredContent.code` of a tool error. - The time of the call, with its time zone. Never send an API key by email. If one leaked, revoke it on [Dashboard, MCP](https://terra-lab.ai/dashboard/mcp) and create a new one. ## A wrong or missing result Data comes from open sources and can be wrong or incomplete. Tell us the place and what you expected: we check the source and fix what is ours. To ask for a dataset TerraLab does not have yet, call [request_data](https://terra-lab.ai/docs/api/request_data) or write to us. ## Other pages - [Errors and rate limits](https://terra-lab.ai/docs/errors) explains every error code. - The [support page](https://terra-lab.ai/support) covers accounts, invoices and the QGIS plugins. - The [API terms](https://terra-lab.ai/legal/api-terms) and the [acceptable use policy](https://terra-lab.ai/legal/acceptable-use) set the rules of use. Source: https://terra-lab.ai/docs/support · Updated 2026-10-27 --- # Changelog > Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL. Changes to the MCP server and the REST API, newest first. Additive changes keep older clients working; anything that breaks a client is announced here first. ## Versioning and deprecation The API version is in the path. Within `/v1`, changes are additive only: new endpoints, new optional parameters and new response fields. A change that would break a client ships under a new path version (`/v2`) while `/v1` keeps working. An endpoint that will be removed is announced on this page at least 6 months ahead. During that period its responses carry a `Deprecation` header (RFC 9745) and a `Sunset` header (RFC 8594) with the removal date. No endpoint of `/v1` is deprecated today. ## 2026-11-15 - The API reference documents all 40 tools, including the layer operations, `get_satellite_index`, `zonal_statistics`, `get_travel_times`, `french_parcels_in_area`, `inspect_dataset` and `aggregate_dataset`. ## 2026-11-14 - Agents without a browser can connect with a link and a 6-digit code the person types on terra-lab.ai: see [agent registration](https://terra-lab.ai/docs/authentication). - `GET https://terra-lab.ai/oauth/userinfo` tells an agent the calls left this month and the balance of the account it acts for. - Disconnecting an app from the dashboard, or revoking its token, cuts its access to the MCP server and the REST API within about a minute; the answer is `401 access_revoked`. - Every REST answer carries `RateLimit` and `RateLimit-Policy` headers; every `429` and `503` carries `Retry-After`. - The [OpenAPI document](https://mcp.terra-lab.ai/v1/openapi.json) describes every error answer with one named `Error` schema. ## 2026-11-13 - New tools: `inspect_dataset` describes a public cloud GeoParquet from its footer, and `aggregate_dataset` counts, sums or averages one for a place or per zone without downloading it. ## 2026-11-12 - Claude and other agents are listed 18 tools. `get_route`, `get_travel_times`, `get_satellite_index`, `french_parcels_in_area`, `zonal_statistics` and `get_forest_type` are left out of their list and stay callable by name; ChatGPT still lists them. See [Connect an agent](https://terra-lab.ai/docs/mcp#tools). - `extract_open_data` returns a small extract inline, in a `features` field of the answer (up to 50 features and 60 KB), next to the download links. ## 2026-11-11 - New tool: `zonal_statistics`, a raster summarised per polygon (population, land cover or elevation per district). - Five more layer operations: `count_in_polygons`, `find_nearest_features`, `select_by_location`, `join_by_location` and `filter_by_attribute`. - A call whose client left stops and is given back. ## 2026-10-30 - New tool: `get_travel_times`, distances and travel times from up to 25 origins to up to 25 destinations in one call. ## 2026-10-28 - Every page of terra-lab.ai registers [WebMCP tools](https://terra-lab.ai/docs/webmcp) for agents running in the browser, including the Data API tools on the signed-in visitor's account. ## 2026-10-27 - New tools: `get_satellite_index` (Sentinel-2 NDVI, NDWI, NBR or NDBI for a date, or their change between two dates) and `french_parcels_in_area` (every French parcel in an area, with its urban plan zone). - A satellite image counts as 10 calls: it uses the included calls first, then the call price (0.05 at most). - Single-operation tools for ChatGPT, one per operation of `measure` and `process_geometry`: `measure_distance`, `measure_area`, `circle_around_place`, `buffer_features`, `dissolve_features`, `intersect_layers`, `erase_with_layer`, `clip_features`, `simplify_features`, `feature_centroids` and `add_area_and_length`. - Developer documentation published at [terra-lab.ai/docs](https://terra-lab.ai/docs), with a markdown copy of every page and [/docs/llms.txt](https://terra-lab.ai/docs/llms.txt). - Tool descriptions state the `radius_m` limits of `get_satellite_image`, so agents get a valid call on the first try. - `HEAD` works on `/v1/openapi.json` and `/v1/meta/pricing`, for link checkers. ## 2026-10-26 - Out of free calls or balance, the `402` answer points to the account page in `account_url`. ## 2026-10-25 - New price grid: 100 calls included every month, then 5 per 1,000 calls and 0.05 per satellite image, from a prepaid balance. No subscription. See [Pricing](https://terra-lab.ai/docs/pricing). - A call that fails or finds nothing is no longer counted. A call refused for invalid input still counts. - `GET /v1/me` returns the exact balance in `balance.micros`. - `GET /v1/meta/pricing` publishes the grid as JSON. - `get_natural_risks` reads a weekly mirror of the Géorisques files. ## 2026-10-24 - TerraLab accounts on the MCP server, with OAuth 2.1 sign-in for agents and `tlk_` API keys for code. - REST API at `https://mcp.terra-lab.ai/v1`, with an [OpenAPI 3.1 document](https://mcp.terra-lab.ai/v1/openapi.json). - New tools: `find_datasets`, `extract_dataset`, `request_data`, `estimate_population`, `get_forest_type` and `get_natural_risks`. - Sentinel-2 images are cached 90 days by area, scene and rendering. ## 2026-10-23 - New tools: `get_route`, `get_travel_area`, `process_geometry` and `get_satellite_image`. - `extract_open_data` accepts `geopackage` as a format. ## 2026-10-19 - TerraLab app live in ChatGPT. - `get_elevation` area mode returns DEM, hillshade and slope GeoTIFFs for any area. - Every open data extract also offers a GeoPackage. Source: https://terra-lab.ai/docs/changelog · Updated 2026-11-15