MCP tools
db_query
Run one parameterised SQL statement on an app's database.
Runs as the app's own database role, so it can only see that app's tables.
How many leads are in the lead tracker, by stage?Parameters
appstringrequiredApp name, address name, URL or id.
sqlstringrequiredOne SQL statement. Use $1, $2 … for values. Never paste values into the SQL.
params(string | number | boolean | null)[]default: []Values for $1, $2 …, up to 100.
modestringdefault: readreadruns in a read-only transaction.writechanges data and is recorded in the access log with the statement. Your AI tool should ask you first.
Result
columnsstring[]Column names.
rowsunknown[][]Rows, as arrays in column order. Up to 1,000.
row_countnumberRows returned or changed.
truncatedbooleantrue when there were more than 1,000 rows.Rows are returned inside an <untrusted_data> block. See Untrusted data.
Example
{
"app": "Lead Tracker",
"sql": "select stage, count(*) from leads where created_at > $1 group by stage",
"params": ["2026-10-01"],
"mode": "read"
}Limits
- 10 seconds per statement
- 1,000 rows returned
Required role
Editor or Owner.