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
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool formats SQL for readability via an API endpoint, implying a read-only, non-destructive operation. However, it lacks details on rate limits, authentication needs, error handling, or what 'standard formatting rules' entail (e.g., indentation, capitalization). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by implementation details and parameter/return info. Each sentence adds value without redundancy. It could be slightly more concise by merging some lines, but overall it's efficient with zero waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally complete. It covers the basic purpose, parameter meaning, and return type. However, for a tool with no annotations and no output schema, it should ideally include more behavioral context (e.g., what the formatted output looks like, any limitations). It's adequate but has clear gaps in fully informing the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context beyond the input schema. With 0% schema description coverage (the schema only has a generic 'sql' parameter with no details), the description specifies that 'sql' is the 'SQL query to format,' clarifying its purpose. Since there's only one parameter, the description adequately compensates for the low schema coverage, though it could provide more on format constraints (e.g., SQL dialect).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Format a SQL query for better readability' and 'apply standard formatting rules to the provided SQL query.' This specifies the verb (format) and resource (SQL query) with the goal of improved readability. However, it doesn't explicitly differentiate from potential siblings like 'superset_database_validate_sql' which might also process SQL queries, though the formatting focus is distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions the endpoint but doesn't specify scenarios (e.g., before execution, for debugging, or for presentation) or prerequisites. With many sibling tools related to SQL processing (e.g., 'superset_sqllab_execute_query', 'superset_database_validate_sql'), there's no explicit comparison or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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