Skip to main content
Glama
Moonlight-CL

Redshift MCP Server

by Moonlight-CL

get_execution_plan

Analyze SQL query performance by retrieving the actual execution plan with runtime statistics from the Redshift MCP Server.

Instructions

Get actual execution plan with runtime statistics for a SQL query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL query to analyze

Implementation Reference

  • Specific dispatch logic for the get_execution_plan tool: extracts and validates the SQL input, then prefixes it with 'EXPLAIN' to obtain the execution plan. The actual execution and result formatting follow in the shared code block.
    elif name == "get_execution_plan": sql = args.get("sql") if not sql: raise ValueError("sql parameter is required when calling get_query_plan tool") sql = f"EXPLAIN {sql}"
  • Defines the input schema for the get_execution_plan tool, requiring a single 'sql' property of type string.
    inputSchema={ "type": "object", "properties": { "sql": { "type": "string", "description": "The SQL query to analyze" } }, "required": ["sql"] }
  • Registers the get_execution_plan tool within the server's list_tools() response, including its name, description, and input schema.
    Tool( name="get_execution_plan", description="Get actual execution plan with runtime statistics for a SQL query", inputSchema={ "type": "object", "properties": { "sql": { "type": "string", "description": "The SQL query to analyze" } }, "required": ["sql"] } )

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Moonlight-CL/redshift-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server