Skip to main content
Glama
aptro

Superset MCP Integration

by aptro

superset_saved_query_get_by_id

Retrieve details of a saved SQL query from Apache Superset by its unique ID to access SQL text and database information.

Instructions

Get details for a specific saved query

Makes a request to the /api/v1/saved_query/{id} endpoint to retrieve information about a saved SQL query.

Args: query_id: ID of the saved query to retrieve

Returns: A dictionary with the saved query details including SQL text and database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_idYes

Implementation Reference

  • Handler function decorated with @mcp.tool() that implements the tool by calling make_api_request to GET /api/v1/saved_query/{query_id}.
    @mcp.tool()
    @requires_auth
    @handle_api_errors
    async def superset_saved_query_get_by_id(ctx: Context, query_id: int) -> Dict[str, Any]:
        """
        Get details for a specific saved query
    
        Makes a request to the /api/v1/saved_query/{id} endpoint to retrieve information
        about a saved SQL query.
    
        Args:
            query_id: ID of the saved query to retrieve
    
        Returns:
            A dictionary with the saved query details including SQL text and database
        """
        return await make_api_request(ctx, "get", f"/api/v1/saved_query/{query_id}")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the API endpoint and that it 'retrieves information about a saved SQL query,' which implies a read-only operation, but doesn't explicitly state this is a safe read operation. It lacks details about authentication requirements, rate limits, error conditions, or what happens if the query_id doesn't exist. The description adds some context about what information is returned but doesn't fully compensate for the lack of annotations.

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 with three clear sections: purpose statement, API endpoint context, and parameter/return documentation. Each sentence adds value without redundancy. The structure with 'Args:' and 'Returns:' headings is helpful, though the formatting could be slightly cleaner. There's no wasted verbiage.

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?

For a single-parameter read operation with no annotations and no output schema, the description provides adequate basic information about what the tool does and what parameter it requires. However, it lacks details about authentication requirements, error handling, rate limits, and the complete structure of the returned dictionary. The mention of 'including SQL text and database' gives some output context but doesn't fully compensate for the missing output schema.

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 for the single parameter: 'query_id: ID of the saved query to retrieve.' With schema description coverage at 0% (the schema only shows 'Query Id' as title with no description), this parameter documentation in the description is essential. It clarifies that this is an identifier for retrieving a specific saved query, though it doesn't specify format constraints or where to obtain valid IDs.

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 as 'Get details for a specific saved query' with the specific verb 'Get' and resource 'saved query'. It distinguishes from sibling tools like 'superset_saved_query_create' and 'superset_sqllab_get_saved_queries' by focusing on retrieving details for a single query by ID rather than creating or listing queries. However, it doesn't explicitly differentiate from 'superset_query_get_by_id' which appears to serve a similar purpose for different query types.

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

Usage Guidelines3/5

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

The description implies usage context by specifying it retrieves 'a specific saved query' and mentions the query_id parameter, suggesting this should be used when you have a known query ID. However, it provides no explicit guidance on when to use this versus alternatives like 'superset_query_get_by_id' or 'superset_sqllab_get_saved_queries', nor does it mention prerequisites or exclusions.

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