> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PlanetScale

> Inspect PlanetScale organizations, databases, branches, and deploy requests

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key comes from `PLANETSCALE_SERVICE_TOKEN`.
* **Docs**: [https://planetscale.com/docs/api/reference/service-tokens](https://planetscale.com/docs/api/reference/service-tokens)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable                    | Required | Description                                                                                                                                                                                                                              |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PLANETSCALE_SERVICE_TOKEN` | Yes      | PlanetScale service token as the combined 'TOKEN\_ID:TOKEN' value (e.g. abc123xyz:pscale\_tkn\_...) - the Authorization header is sent verbatim with no Bearer prefix [Docs](https://planetscale.com/docs/api/reference/service-tokens). |

## Setup

1. **Sign in to PlanetScale**: Go to [https://app.planetscale.com](https://app.planetscale.com) and sign in to your organization.
2. **Create a service token**: Open your organization's Settings > Service tokens > New service token, name it, and copy both the token ID and the token secret immediately.
3. **Grant permissions**: On the token's page, grant organization-level read access (e.g. read\_databases) and database-level permissions (e.g. read\_branch, read\_deploy\_request) for the databases you want to inspect.
4. **Set the environment variable**: IMPORTANT: PlanetScale auth uses a composite value. Set PLANETSCALE\_SERVICE\_TOKEN to the token ID and token joined by a colon, e.g. PLANETSCALE\_SERVICE\_TOKEN=abc123xyz:pscale\_tkn\_.... The connector sends this verbatim as the Authorization header.
5. **Verify access**: Run List Organizations, then List Databases with your organization name.

* PlanetScale's Authorization header is '\<TOKEN\_ID>:\<TOKEN>' with no Bearer prefix - the env var must contain both parts joined by a colon
* Service token permissions are granular; missing database-level grants return 404s rather than 403s
* List responses wrap items in a 'data' array with current\_page/next\_page pagination

Provider API reference: [https://planetscale.com/docs/api](https://planetscale.com/docs/api)

## Tools

| Tool                 | Access | Description                                     |
| -------------------- | ------ | ----------------------------------------------- |
| List Organizations   | Read   | List organizations the service token can access |
| List Databases       | Read   | List databases in an organization               |
| Get Database         | Read   | Get details of a database                       |
| List Branches        | Read   | List branches of a database                     |
| List Deploy Requests | Read   | List deploy requests for a database             |

## Example prompts

* List my PlanetScale databases and their branches, and flag any open deploy requests.
* Show open PlanetScale deploy requests for my database and whether they are approved.
