redshift-utils-mcp

MIT License
1
  • Linux
  • Apple

handle_execute_ad_hoc_query

Execute custom SQL queries directly via Redshift Data API. Returns structured results or detailed error messages for troubleshooting. Ideal for advanced queries not covered by specialized tools.

Instructions

Executes an arbitrary SQL query provided by the user via Redshift Data API.

Designed as an escape hatch for advanced users or queries not covered by specialized tools. Returns a structured dictionary indicating success (with results) or failure (with error details). Args: ctx: The MCP context object. sql_query: The exact SQL query string to execute. Returns: A dictionary conforming to ExecuteAdHocQueryResult structure: - On success: {"status": "success", "columns": [...], "rows": [...], "row_count": ...} - On error: {"status": "error", "error_message": "...", "error_type": "..."} (Note: Actual return might be handled by FastMCP error handling for raised exceptions) Raises: DataApiConfigError: If configuration is invalid. SqlExecutionError: If the SQL execution itself fails. DataApiTimeoutError: If the Data API call times out. DataApiError: For other Data API related errors or unexpected issues. ClientError: For AWS client-side errors.

Input Schema

NameRequiredDescriptionDefault
sql_queryYes

Input Schema (JSON Schema)

{ "properties": { "sql_query": { "title": "Sql Query", "type": "string" } }, "required": [ "sql_query" ], "title": "handle_execute_ad_hoc_queryArguments", "type": "object" }

You must be authenticated.

Other Tools from redshift-utils-mcp

Related Tools

ID: qzrmslh41x