Skip to main content
Glama
aptro

Superset MCP Integration

by aptro

superset_sqllab_format_sql

Format SQL queries for improved readability by applying standard formatting rules to enhance code structure and clarity.

Instructions

Format a SQL query for better readability

Makes a request to the /api/v1/sqllab/format_sql endpoint to apply standard formatting rules to the provided SQL query.

Args: sql: SQL query to format

Returns: A dictionary with the formatted SQL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Implementation Reference

  • The main handler function implementing the 'superset_sqllab_format_sql' tool. It formats the provided SQL string by making a POST request to Superset's /api/v1/sqllab/format_sql endpoint using the shared make_api_request helper.
    @mcp.tool() @requires_auth @handle_api_errors async def superset_sqllab_format_sql(ctx: Context, sql: str) -> Dict[str, Any]: """ Format a SQL query for better readability Makes a request to the /api/v1/sqllab/format_sql endpoint to apply standard formatting rules to the provided SQL query. Args: sql: SQL query to format Returns: A dictionary with the formatted SQL """ payload = {"sql": sql} return await make_api_request( ctx, "post", "/api/v1/sqllab/format_sql", data=payload )
Install Server

Other 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/aptro/superset-mcp'

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