# TurfGap MCP server reference

> Everything an AI app or a developer needs to use the TurfGap MCP server: the address, how to sign in, every tool and its parameters, what costs credit, the limits and the errors.

Server version 0.4.0. Updated November 30, 2026. Web page: https://turfgap.com/docs/mcp

## On this page

- [Overview](#overview)
- [Authentication](#authentication)
- [Connect your app](#connect-your-app)
- [Tools reference](#tools-reference)
- [Credits and limits](#credits-and-limits)
- [Errors](#errors)
- [Plain data endpoint](#plain-data-endpoint)
- [Example requests](#example-requests)

## Overview

**One address for every AI app.** TurfGap is an MCP server. Any AI app or tool that speaks MCP connects to one address and gets the same 20 tools. It covers businesses and markets in the United States only.

| Item | Value |
| --- | --- |
| Endpoint | `https://turfgap.com/mcp` |
| Transport | Streamable HTTP (`streamable-http`): plain `POST` requests with a JSON-RPC 2.0 body. Answers come back as JSON. Other methods get `405`. |
| Protocol versions | `2026-07-28` (stateless), `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05` |
| Server | `turfgap` (TurfGap), version 0.4.0 |
| Sign-in | OAuth 2.1 sign-in from the app, or a personal key sent as `Authorization: Bearer`. See [Authentication](#authentication). |
| Server card | [/.well-known/mcp/server-card.json](https://turfgap.com/.well-known/mcp/server-card.json) |
| This page as Markdown | [/docs/mcp.md](https://turfgap.com/docs/mcp.md) |

### Two ways to talk to it

- **Older protocol (`2024-11-05` to `2025-11-25`).** Open with `initialize`, then call `tools/list` and `tools/call`. `ping` works too. A notification gets an empty `202` answer. Up to 20 messages can go in one batch.
- **Stateless protocol (`2026-07-28`).** No `initialize`. Every request carries `_meta["io.modelcontextprotocol/protocolVersion"]` and `_meta["io.modelcontextprotocol/clientCapabilities"]` (which may be `{}`), plus the headers `MCP-Protocol-Version`, `Mcp-Method` and, for `tools/call`, `Mcp-Name`. The methods are `server/discover`, `tools/list` and `tools/call`.
- There is no session. Each request stands on its own, and the tool list is the same for every account, so an app may keep it for an hour.

### What the server tells your AI

Every connection starts with these instructions from the server, word for word:

> TurfGap maps Google Maps rankings onto real population data and checks how competitive a local market is. Start with list_scans, or get_balance to see which account you are connected to. get_scan gives the headline numbers; get_cells and get_rankings return the data cell by cell in small pages (follow next_offset); export_data returns the same data as CSV; get_report returns the finished report; compare_scans shows change between two scans. get_trend shows the whole history of repeat scans, and schedule_scan repeats a scan automatically (each run spends scan credit, so confirm with the user first). Reading tools are free. find_business costs a fraction of a cent. run_scan and rescan spend scan credit: always show the user the cost and get a yes before calling them with confirm: true, and never pass a daily limit by splitting a scan. Report links in the answers open without a sign-in for 7 days; give them to the user rather than fetching them. "Reach" means the share of residents living where the business ranks in the top 3. United States only.

## Authentication

**Sign in from the app, or send a key.** Every request needs a key or a token. Chat apps sign you in and never see a key. Coding tools and scripts send your personal key.

### Sign in from an AI app (OAuth)

- The app sends you to TurfGap. You sign in with the code we email you and press **Allow**.
- The app gets its own token for your account. It never sees a key or your sign-in code.
- A token lasts 1 hour and the app renews it on its own. A connection that goes unused for 90 days ends, and you connect again.
- For developers: OAuth 2.1 with PKCE (`S256`), scope `turfgap`. Discovery is at `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`. An app registers at `/oauth/register` or identifies itself with a client ID metadata document. A request with no working key or token gets `401` and a `WWW-Authenticate` header that points to the sign-in.

### Use your personal key

- Find it on your [account page](https://turfgap.com/account#mcp) under MCP connection, with **Show key** and **Copy key**. Keys start with `tg_`.
- Send it with every request: `Authorization: Bearer YOUR_KEY`.
- Treat it like a password. **Make a new key** stops the old one at once, for every tool that had it.

### See and disconnect apps

- Your account page lists every app that signed in and every tool that used your key, with the date each was last used. A tool that uses your key is recognized by the name it sends.
- **Disconnect** ends an app's access at once. A disconnected key tool is refused until you press **Allow again**.
- A browser sign-in does not count at `/mcp`. Every request needs the key or a token.

### What an app can and cannot do

**A connected app can:**

- See your saved scans, rankings and reports.
- Look up businesses and area profiles.
- Start scans with your scan credits, after showing you the cost.
- Give you report links that work for 7 days.

**It cannot:**

- See your payment details.
- Change your email or sign in as you on the website.
- See anyone else's scans.

## Connect your app

**Paste the address, then sign in.** The address is the same everywhere: `https://turfgap.com/mcp`. The [MCP connection page](https://turfgap.com/connect-ai) has the full steps for each app.

| App | Steps |
| --- | --- |
| Claude | Open Settings, then Connectors, and add a custom connector. Paste the address, press Connect, sign in to TurfGap and press Allow. |
| ChatGPT | On the web, open chatgpt.com/plugins, press the plus button and choose "Add custom MCP server". Paste the address as the Server URL, choose OAuth, sign in and press Allow. As of November 2026 this needs a Pro, Business, Enterprise or Edu plan, and ChatGPT lets only Business and higher start scans. |
| Grok | Open grok.com/connectors, press "New Connector" and choose "Custom". Paste the address, sign in and press Allow. On a Grok Business team, an admin adds the connector first. |
| Coding tools and scripts | Copy the key from your [account page](https://turfgap.com/account#mcp) and send it as `Authorization: Bearer YOUR_KEY`. This works for Claude Code, Cursor, VS Code, the Grok API and your own scripts. |

In Claude Code, one command does it:

```bash
claude mcp add --transport http turfgap https://turfgap.com/mcp \
  --header "Authorization: Bearer YOUR_KEY"
```

## Tools reference

**20 tools. Reading is free.** 17 tools only read and cost no credit. Three spend scan credit and always show the cost first: `run_scan`, `rescan` and `schedule_scan`. This list is built from the server's own tool definitions, so it matches what `tools/list` returns.

| Tool | What it does | Spends credit |
| --- | --- | --- |
| [`list_scans`](#list_scans) | List saved scans | No |
| [`get_scan`](#get_scan) | Get scan summary | No |
| [`get_competitors`](#get_competitors) | Get competitors | No |
| [`compare_scans`](#compare_scans) | Compare two scans | No |
| [`get_trend`](#get_trend) | Get trend across repeat scans | No |
| [`get_cells`](#get_cells) | Get map cells | No |
| [`get_rankings`](#get_rankings) | Get raw rankings | No |
| [`get_report`](#get_report) | Get the report | No |
| [`export_data`](#export_data) | Export scan data | No |
| [`get_market_check`](#get_market_check) | Get market check | No |
| [`get_area_profile`](#get_area_profile) | Get area profile | No |
| [`list_industries`](#list_industries) | List industries | No |
| [`find_business`](#find_business) | Find a business | No |
| [`estimate_scan`](#estimate_scan) | Estimate a scan | No |
| [`run_scan`](#run_scan) | Run a scan | Yes |
| [`rescan`](#rescan) | Run a scan again | Yes |
| [`get_scan_status`](#get_scan_status) | Get scan status | No |
| [`schedule_scan`](#schedule_scan) | Repeat a scan on a schedule | Yes |
| [`list_schedules`](#list_schedules) | List scheduled scans | No |
| [`get_balance`](#get_balance) | Get balance and limits | No |

### Reading scans

Find a scan, read its headline numbers, and follow a business over time.

#### list_scans

**List saved scans**. Read-only, no credit.

Lists saved TurfGap scans, newest first, with id, business or area, keyword, radius and date. Start here to find a `scan_id`. Use search to narrow by business, area or keyword.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `search` | string | no | Optional: only scans whose business, area or keyword contains this text. |  |
| `type` | string | no | Optional: only business scans or only market scans. | `business`, `market` |
| `limit` | number | no | Default 25, max 100. | Default 25 |
| `offset` | number | no | Default 0. | Default 0 |

#### get_scan

**Get scan summary**. Read-only, no credit.

Headline results of one scan: reach (share of residents who see the business in Google Maps top 3), average rank, coverage, the top competitors and links to the report. For a market scan the figures describe the market leader.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |

#### get_competitors

**Get competitors**. Read-only, no credit.

Every business seen in a scan, ranked by reach, with rank, rating, reviews and address. Use limit to shorten the list.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `limit` | number | no | Default 20, max 200. | Default 20 |

#### compare_scans

**Compare two scans**. Read-only, no credit.

What changed between two scans of the same business and keyword: reach, average rank and top-3 cells before and after, which cells improved or dropped, and how each competitor moved. Put the older scan first.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `older_scan_id` | string | yes | The earlier scan. |  |
| `newer_scan_id` | string | yes | The later scan. |  |

#### get_trend

**Get trend across repeat scans**. Read-only, no credit.

How a business moved over time: reach, top-3 cells and average rank for every finished scan with the same business, keyword, radius and cell size as the scan given, oldest first, plus the change from first to last and whether the scan is set to repeat.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Any scan in the series. |  |

### Scan data and exports

The data behind a scan, cell by cell, in small pages or as CSV text.

#### get_cells

**Get map cells**. Read-only, no credit.

Cell-by-cell data for a scan: residents, homes, daytime workers, income, home value, age of homes, owners vs renters, households with children, seniors, single-family share, the rank of the scanned business and who ranks first. Returned as a table: "columns" names the fields and each entry of "rows" is one cell in that order. Sorted by residents, most first; follow `next_offset` for more. `cell_id` matches `get_rankings` and `export_data`. Use for questions about specific neighborhoods.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `offset` | number | no | First cell to return. Default 0. | Default 0 |
| `limit` | number | no | Cells per page. Default 40, max 150. | Default 40 |
| `place_names` | boolean | no | Look up the town or neighborhood name of each cell on this page (slower; at most 30 cells a page). Default false. | Default false |
| `business_name` | string | no | Optional: rank this business instead of the scanned one (exact name from `get_competitors`). |  |

#### get_rankings

**Get raw rankings**. Read-only, no credit.

The raw data points of a scan: for each cell, the businesses Google Maps returned in rank order, with place id, category, rating and reviews, plus the cell's residents and income. The results of each cell are rows in the order given by `result_columns`. Paged by cell: follow `next_offset` to walk through all cells. Use this to build your own analysis or data set. For the whole data set as one file, give the user the `rankings_csv` link from `get_scan`.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `offset` | number | no | First cell to return. Default 0. | Default 0 |
| `limit` | number | no | Cells per page. Default 10, max 40. | Default 10 |
| `depth` | number | no | Businesses per cell. Default 10, max 20. | Default 10 |
| `all_cell_facts` | boolean | no | Include every neighborhood fact for each cell (homes, home value, renters, children, seniors, workers), not just residents and income. Default false. | Default false |

#### get_report

**Get the report**. Read-only, no credit.

The full structured report for a scan as CSV text with labeled sections (summary, headline, competitors, market check, easier areas, and optionally every cell), plus links to the PDF and the web report. Use it to write a client update or build your own report.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `include_cells` | boolean | no | Also include the per-cell table. Default false. | Default false |

#### export_data

**Export scan data**. Read-only, no credit.

A data file from a scan as CSV text. kind "cells" is one row per cell (residents, income, rank, top three); "rankings" is one row per business per cell (the complete data set); "underserved" is the per-cell market check numbers. Paged by row: follow `next_offset` until it is null. For the complete rankings file in one piece, give the user the `rankings_csv` link from `get_scan` instead.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `kind` | string | yes | Which data file to return. | `cells`, `rankings`, `underserved` |
| `offset` | number | no | First data row. Default 0. | Default 0 |
| `limit` | number | no | Rows per page. Default 60, max 250. | Default 60 |

### Market and area

How competitive a market is, and who lives in an area.

#### get_market_check

**Get market check**. Read-only, no credit.

How competitive the market in a scan is: a Low to Very high verdict with its score, the facts behind it, the strongest competitors, the most underserved areas (most residents per nearby business), the same ranked by household income (residents times their income, per nearby business) with households earning $100k+, and the income brackets of the area. `travel_miles` is how far customers typically travel for this kind of business.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |
| `travel_miles` | number | no | Default 3. | `2`, `3`, `5`, `8`, `10`, `15`, `25`. Default 3 |

#### get_area_profile

**Get area profile**. Read-only, no credit.

Free profile of the area around a city within a radius: residents, homes, daytime workers, household income, home value, age of homes, owners vs renters, households with children, residents 65 and over, and single-family share. Does not use scan credit.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `city` | string | yes | "City, ST" |  |
| `radius_miles` | number | no | Default 5, max 50. | Default 5 |

#### list_industries

**List industries**. Read-only, no credit.

The industries TurfGap has ready for market scans. Optional search narrows the list.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `search` | string | no | Optional: only items whose name contains this text. |  |

### Running and repeating scans

Find a business, see the cost, run or repeat a scan, and follow its progress. Tools that spend credit use [the confirm step](#the-confirm-step).

#### find_business

**Find a business**. Read-only, no credit.

Looks up a business on Google Maps by name and city and returns candidates with `place_id` and coordinates, needed for a business scan. Costs a fraction of a cent per call.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `name_and_city` | string | yes | For example "Joe's Plumbing Vancouver WA". |  |

#### estimate_scan

**Estimate a scan**. Read-only, no credit.

Says how many cells a scan would cover and what it would cost, without running it. Give "city" plus "industry" for a market scan, or "business" plus "keyword" for a business scan.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `city` | string | no | For a market scan: the city as "City, ST", for example "Vancouver, WA". |  |
| `industry` | string | no | For a market scan: the kind of business, for example "dentist". See `list_industries`. |  |
| `business` | object | no | For a business scan: one result from `find_business`. Fields: `place_id` (string), `name` (string), `address` (string), `lat` (number), `lng` (number). |  |
| `keyword` | string | no | The search phrase to rank for. Required for a business scan. |  |
| `radius_miles` | number | no | Radius of the area, 2 to 50. Default 5. | Default 5 |
| `detail` | string | no | Cell size. Default standard. Wide areas are made coarser automatically. | `very_coarse`, `coarse`, `standard`, `fine`. Default standard |
| `speed` | string | no | standard takes about 5 minutes and is cheapest; instant uses 4 scan credits per cell instead of 1. | `standard`, `instant` |

#### run_scan

**Run a scan**. Spends scan credit.

Starts a scan. THIS SPENDS DATA CREDIT. Call once without confirm to see the cost, tell the user the cost, and only call again with `confirm: true` after they agree. Returns a `scan_id`; poll `get_scan_status` until it is done (standard speed takes about 5 minutes).

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `city` | string | no | For a market scan: the city as "City, ST", for example "Vancouver, WA". |  |
| `industry` | string | no | For a market scan: the kind of business, for example "dentist". See `list_industries`. |  |
| `business` | object | no | For a business scan: one result from `find_business`. Fields: `place_id` (string), `name` (string), `address` (string), `lat` (number), `lng` (number). |  |
| `keyword` | string | no | The search phrase to rank for. Required for a business scan. |  |
| `radius_miles` | number | no | Radius of the area, 2 to 50. Default 5. | Default 5 |
| `detail` | string | no | Cell size. Default standard. Wide areas are made coarser automatically. | `very_coarse`, `coarse`, `standard`, `fine`. Default standard |
| `speed` | string | no | standard takes about 5 minutes and is cheapest; instant uses 4 scan credits per cell instead of 1. | `standard`, `instant` |
| `confirm` | boolean | no | Must be true to actually run and spend credit. |  |

#### rescan

**Run a scan again**. Spends scan credit.

Repeats a saved scan with the same business or area, keyword, radius and cell size, using fresh Google Maps data, so the two can be compared with `compare_scans`. THIS SPENDS DATA CREDIT. Call once without confirm to see the cost, tell the user, and only call again with `confirm: true` after they agree.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | The scan to repeat. |  |
| `speed` | string | no | standard takes about 5 minutes and is cheapest; instant uses 4 scan credits per cell instead of 1. Default standard. | `standard`, `instant`. Default standard |
| `confirm` | boolean | no | Must be true to actually run and spend credit. |  |

#### get_scan_status

**Get scan status**. Read-only, no credit.

Progress of a running scan.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | Id of a saved scan. `list_scans` gives the ids. |  |

#### schedule_scan

**Repeat a scan on a schedule**. Spends scan credit.

Sets a saved business scan to repeat on its own every week, every 2 weeks or every month with fresh Google Maps data, or stops it with every: "off". EVERY AUTOMATIC SCAN SPENDS SCAN CREDIT until it is stopped. Call once without confirm to see the cost of each run, tell the user, and only call again with `confirm: true` after they agree. Stopping needs no confirm.

| Parameter | Type | Required | Description | Values |
| --- | --- | --- | --- | --- |
| `scan_id` | string | yes | The scan to repeat. |  |
| `every` | string | yes | How often to repeat it, or off to stop. | `week`, `2_weeks`, `month`, `off` |
| `confirm` | boolean | no | Must be true to turn a schedule on or change it. |  |

#### list_schedules

**List scheduled scans**. Read-only, no credit.

The scans this account has set to repeat: business, keyword, how often, when each runs next and what the last run did.

No parameters.

### Account

Which account a connection belongs to, and what it has left.

#### get_balance

**Get balance and limits**. Read-only, no credit.

Which account this connection belongs to, the scan credits left, whether the free scan is still available, and how many scan credits AI connections have used today. The owner account also gets its daily AI spending limit.

No parameters.

## Credits and limits

**Reading is free. Scans cost credit.** Only `run_scan`, `rescan` and `schedule_scan` spend scan credit, and each one shows the cost before anything runs. Every other tool is free to call.

| What | Cost |
| --- | --- |
| Reading and exporting | Free. 17 of the 20 tools never use scan credit. |
| `find_business` | No scan credit. A member account can look up 30 businesses a day, in the app and through AI together. |
| `run_scan`, `rescan` | 1 credit per cell at standard speed (about 5 minutes). 4 credits per cell at instant speed. |
| `schedule_scan` | Each automatic run spends one credit per cell, until the schedule is stopped. A run is skipped when the account does not have enough credits. |
| The free scan | Each account gets one free rank scan and one free market check, up to 5 miles at standard speed. |
| Repeats within 7 days | Cells you already scanned for the same keyword in the last 7 days are not charged again. `rescan` always fetches fresh data, so it charges every cell. |

### The confirm step

A tool that spends credit never spends on the first call. Without `confirm: true` it only reports the cost. The server cannot hear your yes, so the asking is up to the AI app. What it can spend is capped by the credits on the account.

1. Call `run_scan`, `rescan` or `schedule_scan` without `confirm`. Nothing runs. The answer has `not_started: true` (`not_scheduled: true` for a schedule), the credits needed and a `next_step`.
2. Tell the user the cost and wait for a yes.
3. Call again with the same arguments and `confirm: true`. The answer has `started: true` and the new `scan_id` (or `scheduled: true` and the next date for a schedule).
4. Call `get_scan_status` until `status` is `done`, then read the scan with `get_scan` or `get_market_check`.

Stopping a schedule with `every: "off"` needs no confirm. The first answer from `run_scan` looks like this (the numbers are an example):

```json
{
  "not_started": true,
  "would_scan": "Example Plumbing",
  "cells": 44,
  "scan_credits_needed": 44,
  "scan_credits_left": 1000,
  "next_step": "Tell the user this cost. If they agree, call run_scan again with the same arguments and confirm: true."
}
```

### Daily limits

- **Member accounts** have no separate daily cap for AI connections. A connection can spend the scan credits on the account, and scans stop when they run out. `get_balance` shows the credits left and what AI connections used today.
- **The TurfGap owner account** works on a daily dollar limit for AI connections instead, set on its account page (up to $100 a day).
- **Requests:** up to 240 a minute per account, and 6,000 a day for a member account. Past that the server answers `429` with `Retry-After: 60`.

### Paging

Big answers come in pages. Pass `offset` and `limit`. Each answer gives `next_offset`, which is `null` on the last page.

| Tool | Default page | Largest page | Pages with offset |
| --- | --- | --- | --- |
| [`list_scans`](#list_scans) | 25 | 100 | Yes |
| [`get_competitors`](#get_competitors) | 20 | 200 | No, one list |
| [`get_cells`](#get_cells) | 40 | 150 | Yes |
| [`get_rankings`](#get_rankings) | 10 | 40 | Yes |
| [`export_data`](#export_data) | 60 | 250 | Yes |

### Report links

Answers from `get_scan`, `get_market_check` and `get_report` include links to the web report, the PDF, the CSV report and the full rankings CSV. They open without a sign-in and stop working after 7 days. Anyone who has a link can see that report, so give links only to people who should see it. Your AI should hand them to you rather than fetch them.

## Errors

**Plain words, so your AI can fix it.** Errors say what went wrong in plain words. An AI can read the message, fix the call and try again.

- **A tool that cannot do the job** still answers normally, with `isError: true` and one text item that starts with "Could not do that:". Read the message and fix the arguments.
- **A request the server cannot accept** gets a JSON-RPC `error` with a code, and an HTTP status.

### Tool errors

**Finding the scan**

| Message | What to do |
| --- | --- |
| No scan with that id. Call list_scans to see the ids. | Call `list_scans` and use a `scan_id` from it. |
| This scan has no results yet. | Wait until `get_scan_status` says `done`. |
| No business by that exact name in this scan. Check get_competitors. | Copy the exact name from `get_competitors`. |

**The wrong kind of scan**

| Message | What to do |
| --- | --- |
| Market checks need a scan run in TurfGap; imported scans do not carry business locations. | Use a scan run in TurfGap, not an imported one. |
| Market data needs a scan run in TurfGap. | The same, from `export_data` with the `underserved` kind. Use a scan run in TurfGap. |
| Imported scans cannot be run again. | Start a new scan with `run_scan`. |
| Trends are for business scans. A market scan has no single business to follow. | Use `get_market_check` for a market scan. |
| Only business scans can be repeated on a schedule. | Repeat a market scan by hand with `rescan`. |

**Missing or wrong arguments**

| Message | What to do |
| --- | --- |
| Give an industry (for example "dentist") for a market scan. | Add `industry`. `list_industries` has the ready list. |
| Give either "city" (for a market scan) or "business" with place_id, name, lat and lng from find_business. | Give `city` and `industry`, or a `business` from `find_business`. |
| Give the keyword to rank for, for example "plumber vancouver wa". | Add `keyword`. |
| every must be week, 2_weeks, month or off. | Use one of those values. |
| Unknown kind. | `kind` must be `cells`, `rankings` or `underserved`. |
| Type the area as City, ST or as a five-digit ZIP code. For example: Vancouver, WA or 98661. TurfGap covers the United States only. | Write `city` as "City, ST". A five-digit ZIP code also works. |

**Credits and limits**

| Message | What to do |
| --- | --- |
| This scan needs {n} scan credits and you have {m}. Add credits on your billing page. | Add credits on the [billing page](https://turfgap.com/account/billing), or lower the radius or detail. |
| Your free scan covers up to 5 miles at standard detail and the 5-minute speed. ... | Lower `radius_miles` to 5 or less at standard speed, or add credits. |
| A free scan has already been used for this business. This scan needs {n} scan credits. | Add credits, or scan with credits you have. |
| You have reached today's limit for business lookups. Pick from your recent businesses or try again tomorrow. | Reuse a `place_id` you already have, or try tomorrow. |
| Scanning is paused for a short while. Please try again later. | Try again later. No credit was spent. |
| This scan would pass today's AI spending limit of ... (owner account only) | Raise the limit on the account page, or run the scan in the app. |

### Request errors

| HTTP | Code | Message | What to do |
| --- | --- | --- | --- |
| 401 | -32001 | Sign in to TurfGap to use this connection. ... | Send the key as `Authorization: Bearer`, or let the app sign you in. |
| 401 | -32001 | That key or token is wrong or has expired. ... | Connect the app again, or copy the current key from the account page. |
| 401 | none | This tool was disconnected on the TurfGap account page. ... | Press **Allow again** on the account page, or use a new key. |
| 403 | -32000 | Origin not allowed. | Call from a server, a desktop app or a script, not from a web page on another site. |
| 405 | -32000 | Use POST. | Send every request as `POST`. |
| 429 | -32029 | Too many requests. Wait a minute and try again. | Wait 60 seconds, as the `Retry-After` header says. |
| 400 | -32700 | Parse error | Send valid JSON. |
| 400 | -32600 | Invalid request, or Too many requests in one batch (limit 20). | Send JSON-RPC 2.0 with a `method`. Keep batches to 20 messages. |
| 200 or 404 | -32601 | Method not found: ... | Use `initialize`, `ping`, `tools/list` or `tools/call`, or `server/discover` on the stateless protocol. |
| 200 or 400 | -32602 | Unknown tool: ... | Call `tools/list` for the tool names. |
| 400 | -32022 | Unsupported protocol version | Use a version from `data.supported` in the error. |
| 400 | -32020 | Header mismatch: ... | On `2026-07-28`, send `MCP-Protocol-Version`, `Mcp-Method` and `Mcp-Name` headers that match the body. |
| 400 | -32602 | Invalid params: every request must carry _meta[...] | On `2026-07-28`, add the protocol version and client capabilities to `_meta`. |

The older protocol answers an unknown method or tool with HTTP `200` and the error in the body. The stateless protocol uses `404` and `400`.

## Plain data endpoint

**The same data, without MCP.** Scripts that do not speak MCP can read the same data over ordinary web requests. Send the same key or token in the `Authorization: Bearer` header.

| Address (GET) | Returns |
| --- | --- |
| `/api/v1/scans` | Your saved scans, as JSON. |
| `/api/v1/scans/{id}` | One scan in full, as JSON. |
| `/api/v1/scans/{id}/rankings.csv` | Every ranking in every cell: one row per business per cell. |
| `/api/v1/scans/{id}/cells.csv` | One row per cell: residents, neighborhood facts, the rank and the top three. |
| `/api/v1/scans/{id}/cells.geojson` | The cells as map shapes (GeoJSON) with the same facts, for mapping software. |
| `/api/v1/scans/{id}/report.csv` | The structured report. |
| `/api/v1/scans/{id}/report.pdf` | The PDF report. |
| `/api/v1/scans/{id}/market` | The market check, as JSON. |

- A request without a working key or token gets `401`. An address that does not exist gets `404` and a list of the ones that do.
- The report links from the MCP tools open the PDF, the CSV report, the rankings CSV and the cells CSV without a key, for 7 days.

```bash
curl -s https://turfgap.com/api/v1/scans \
  -H "Authorization: Bearer YOUR_KEY"
```

## Example requests

**Ask in plain words, or call it raw.** In a chat app, ask in your own words and your AI picks the tools. In your own code, send JSON-RPC.

### Things to ask your AI

- "Pull every ranking from my last scan and build a spreadsheet of who wins each neighborhood."
- "Run a market scan for dentists within five miles of Camas, WA. Tell me the cost first."
- "Compare this week's scan with last week's and write the client update with the cells we lost."

### A raw tools/call request

This calls `list_scans` for the two newest scans. No `initialize` is needed first.

```bash
curl -s https://turfgap.com/mcp \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "list_scans",
      "arguments": {
        "limit": 2
      }
    }
  }'
```

The answer carries the data twice: as JSON text in `content`, and as an object in `structuredContent`. Shortened, with example values:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"scans_total\":12,\"offset\":0,\"next_offset\":2,\"scans\":[...]}"
      }
    ],
    "structuredContent": {
      "scans_total": 12,
      "offset": 0,
      "next_offset": 2,
      "scans": [
        {
          "scan_id": "mx12ab34cd56",
          "type": "business scan",
          "business_or_area": "Example Plumbing",
          "keyword": "plumber vancouver wa",
          "radius_miles": 5,
          "cells": 44,
          "status": "done",
          "scanned_on": "2026-11-30"
        },
        "..."
      ]
    },
    "isError": false
  }
}
```

### The same call on the stateless protocol (2026-07-28)

```bash
curl -s https://turfgap.com/mcp \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: tools/call" \
  -H "Mcp-Name: list_scans" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "list_scans",
      "arguments": {
        "limit": 2
      },
      "_meta": {
        "io.modelcontextprotocol/protocolVersion": "2026-07-28",
        "io.modelcontextprotocol/clientCapabilities": {}
      }
    }
  }'
```

Its answer has the same `result`, plus `resultType` and the server's name and version in `_meta`.
