Connect PlanetScale to Toolspoke
Browse PlanetScale databases and branches, read schemas and query insights, and open, deploy or cancel deploy requests. Toolspoke gives your agents 18 of its actions, and you decide which ones each project allows.
- Connection
- Provider REST API
- Authentication
- Service token
- Actions exposed
- 18
- What a call bills
- Nothing
- Adapter
- Maintained by Toolspoke
- Category
- Database
Connected in three steps
Install PlanetScale
Open the marketplace in your workspace, add PlanetScale to the project your agents work in, and it appears on the gateway immediately.
Connect the credential
Provide the credential PlanetScale asks for. Where to get it, and what it has to be able to reach, is the next section.
Give it to an agent
Describe the job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. It can use every PlanetScale action the project leaves on.
Where the agent answers
Slack
Ask it in a channel or a thread, and it replies in the thread it was asked in.
Email
Email it. Each write waits for a person's go-ahead unless that action is allowed in advance.
GitHub
Mention it on a pull request, and it answers there.
Schedule
A routine wakes it on a schedule, or when a new item matches.
Any agent in the project can use PlanetScale, and only the actions the project leaves on.
What PlanetScale asks for
Service token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Service token ID and tokenRequired
- PlanetScale → your organization → Settings → Service tokens → New service token. Paste the token ID and the token joined by a colon, ID first. Then open the token and grant it access: read_databases under Organization access, then under Database access pick each database and tick read_branch, create_branch and the deploy request permissions it should have. A token sees nothing it was not granted.
- abc123def456:pscale_tkn_…
What an agent can do in PlanetScale
18 actions, each one declared by name in the connector. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
12 read, 3 write, 3 destructive
Reads
12Fetches data and changes nothing.
list_organizationsList the organizations this service token can reach. A service token belongs to one organization, so this usually returns one row; its name is the `organization` every other action takes.
list_databasesList the databases in an organization, with their engine (mysql or postgresql), region, state and default branch.
get_databaseRead one database's settings, engine, region, default branch and whether safe migrations are required.
list_branchesList a database's branches, with which are production branches and which have safe migrations on.
get_branchRead one branch, including its parent, its state and whether it is a production branch.
get_branch_schemaReturn the CREATE statement of every table on a branch. Use it before writing a query or a migration against an unfamiliar database.
lint_branch_schemaList the schema lint errors on a branch, the problems that would block a deploy request from it.
list_query_insightsList the queries a branch has run, grouped by pattern, with counts, rows read and latency. Use it to find what is slow or expensive. The statements are normalized patterns, not the literal values sent.
list_query_errorsList the errors a branch's queries have raised, grouped by error, with counts and when each last happened.
list_schema_recommendationsList PlanetScale's index and schema recommendations for a database, each with the DDL that would apply it.
list_deploy_requestsList a database's deploy requests, the schema changes proposed from one branch into another, with their state and deployment status.
get_deploy_requestRead one deploy request by its number, including whether it can be deployed and the state of its deployment.
Writes
3Creates or updates something on the other side.
create_branchCreate a development branch from an existing branch. It copies the parent's schema, not its data, unless a backup is named.
create_deploy_requestOpen a deploy request proposing a branch's schema changes into another branch. Nothing is deployed until deploy_deploy_request is called.
close_deploy_requestClose an open deploy request without deploying it. The branch and its changes are left as they are.
Destructive
3Deletes or permanently alters something. Worth granting on purpose.
deploy_deploy_requestQueue a deploy request, which applies its schema changes to the target branch, usually production. Destructive because it changes a live schema: a dropped column's data goes with it, and a revert is only possible within the revert window, if at all.
cancel_deploy_requestCancel a deploy request that is queued or in progress. Destructive because it stops a running schema change partway, and the request has to be opened again to retry.
delete_branchDelete a branch and all the data on it. There is no undo. PlanetScale refuses to delete a production branch or one with deletion protection on.
What it will not do
The gateway enforces each of these, so they can be stated flatly.
- It cannot call anything else
- The 18 actions above are the whole of it. A call to any other name is refused before it reaches PlanetScale rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It reaches no further than your credential
- Toolspoke holds no access to PlanetScale of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from PlanetScale
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in PlanetScale. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around PlanetScale's own rate limits. A call that PlanetScale refuses comes back to the agent as a failed call.
Before you connect it
What can an agent do in PlanetScale?
18 named actions: 12 that only read, 3 that write and 3 that delete or permanently alter something. They include list_organizations, list_databases and get_database. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the PlanetScale connector need?
Service token. The connector asks for service token id and token. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
How does an agent get to use PlanetScale?
Install PlanetScale in a project and every agent in that project can use the actions the project leaves on. Describe a job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. The agent answers when someone asks it in Slack, emails it or mentions it on a GitHub pull request, or when its routine wakes it.
What does the PlanetScale connector not do?
The 18 actions above are the whole of it. A call to any other name is refused before it reaches PlanetScale rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Toolspoke holds no access to PlanetScale of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in PlanetScale. An agent has to ask. Toolspoke does not retry, queue or back off around PlanetScale's own rate limits. A call that PlanetScale refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches PlanetScale's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls PlanetScale?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and what the call cost in sandbox time and model tokens. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.
More database connectors
Browse all of themConnect PlanetScale to Toolspoke
Add PlanetScale to a project and give it to an agent.