get_execution_plan
Analyze SQL query performance by retrieving the actual execution plan with runtime statistics using the Adb MySQL MCP Server interface.
Instructions
Get the actual execution plan with runtime statistics for a SQL query
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The SQL query to analyze |
Implementation Reference
- Handler logic for the get_execution_plan tool: retrieves the query argument and prepends 'EXPLAIN ANALYZE' to it for execution.elif name == "get_execution_plan": query = arguments.get("query") if not query: raise ValueError("Query is required") query = f"EXPLAIN ANALYZE {query}"
- src/adb_mysql_mcp_server/server.py:151-164 (registration)Registration of the get_execution_plan tool within the list_tools() function, defining its name, description, and input schema.Tool( name="get_execution_plan", description="Get the actual execution plan with runtime statistics for a SQL query", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "The SQL query to analyze" } }, "required": ["query"] } )
- Input schema definition for the get_execution_plan tool, specifying the required 'query' parameter.inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "The SQL query to analyze" } }, "required": ["query"] }