explain_query
Analyze SQL query execution plans and receive plain-English performance recommendations. Supports PostgreSQL and MySQL.
Instructions
Analyze a SQL query's execution plan and return plain-English performance recommendations. Runs EXPLAIN ANALYZE (Postgres) or EXPLAIN FORMAT=JSON (MySQL). [BUILD tier]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- bin/server.js:88-93 (schema)Definition and registration of the 'explain_query' tool in the static TOOLS array. It's a BUILD tier tool described as analyzing a SQL query's execution plan and returning plain-English performance recommendations. The inputSchema is a generic { type: 'object' } with no specific field validation.
// BUILD tier { name: "explain_query", description: "Analyze a SQL query's execution plan and return plain-English performance recommendations. Runs EXPLAIN ANALYZE (Postgres) or EXPLAIN FORMAT=JSON (MySQL). [BUILD tier]", inputSchema: { type: "object" }, - bin/server.js:188-188 (registration)Tool registration via ListToolsRequestSchema handler. All tools in the TOOLS array (including explain_query) are returned as the tool catalog.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); - bin/server.js:190-193 (handler)Generic redirect handler for all tools. Since bin/server.js is only a local reference adapter (not the real execution server), this handler returns a static redirect message for all tools including explain_query rather than executing the actual logic. The real execution would happen at the hosted server https://data.thinair.co/mcp.
server.setRequestHandler(CallToolRequestSchema, async () => ({ content: [{ type: "text", text: REDIRECT_MESSAGE }], isError: false, }));