query_d1
Run read-only SQL queries like SELECT, WITH, EXPLAIN, or PRAGMA against a local D1 database. Writes and multi-statement payloads are rejected to ensure safety.
Instructions
Run a read-only SQL query (SELECT / WITH / EXPLAIN / PRAGMA only) against the local D1. Multi-statement payloads and writes are rejected.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "query_d1"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | D1 binding name (default: auto-detect) | |
| sql | Yes | Read-only SQL statement |