query
Execute read-only SQL queries on a chosen MySQL or PostgreSQL database, with optional parameterized values and support for statements like SELECT, SHOW, DESCRIBE, and EXPLAIN.
Instructions
Execute a read-only SELECT query against a selected MySQL or PostgreSQL database. Supports optional parameterized values. Only SELECT/SHOW/DESCRIBE/EXPLAIN statements are allowed.
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": {
"dbName": "<dbName>",
"sql": "<sql>"
},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A read-only SQL SELECT statement. | |
| dbName | Yes | The name of the database to query (as shown by list_db). | |
| params | No | Optional positional parameters for the SQL statement. Use ? placeholders for MySQL or $1, $2, ... for PostgreSQL. |