mydatabase_execute_safe_query
Execute validated SQL queries against the configured schema, with row caps and blocked full-table scans to prevent unsafe or runaway database access.
Instructions
Executes SQL against the database with AST validation. SELECT results are capped by MCP_QUERY_ROW_LIMIT (default 500, AST-injected LIMIT) and include a '-- rows: N (truncated at LIMIT X)' footer when the cap is reached. Unindexed full table scans above MCP_EXPLAIN_MAX_SCAN_ROWS are blocked before execution. Only the configured schema is reachable: SHOW statements, information_schema/mysql/performance_schema/sys, other schemas, server variables, SELECT ... INTO and functions such as LOAD_FILE or SLEEP are rejected by the server. To explore the schema use 'search_schema'.
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": "mydatabase_execute_safe_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL SELECT statement to execute. |