execute_sql
Run a single SQL statement on a named database connection, returning columns and rows for SELECT queries or row count and insert ID for DML. Use positional parameters for PostgreSQL or MySQL.
Instructions
Execute a single SQL statement on a named connection. SELECT returns columns/rows; DML returns rowCount (and lastInsertId for mysql). Use positional params: $1.. for postgres, ? for mysql.
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": {
"connection": "<connection>",
"sql": "<sql>"
},
"name": "execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| params | No | positional query parameters | |
| database | No | database to run against; defaults to the connection default | |
| rowLimit | No | ||
| connection | Yes | connection name, see list_connections |