execute_sql
Execute a single SQL statement for PostgreSQL or MySQL databases with positional parameters. Use placeholders $1, $2 for PostgreSQL and ? for MySQL.
Instructions
Execute one PostgreSQL or MySQL SQL statement with optional positional parameters. Generate normal SQL, not MongoDB syntax. Use params instead of interpolating values into sql. For PostgreSQL placeholders use $1, $2, ...; for MySQL placeholders use ?. In --readOnly mode, write/transaction/unknown SQL is 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": "execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Single SQL statement for PostgreSQL or MySQL. PostgreSQL uses $1, $2 placeholders; MySQL uses ? placeholders. | |
| params | No | Values for positional placeholders. Use this instead of string-concatenating user values into SQL. | |
| connectionId | No | Connection id. Defaults to the latest connection. |