superset_saved_query_create
Save SQL queries for reuse by storing them in Apache Superset with database connection, schema, and descriptive labels.
Instructions
Create a new saved query
Makes a request to the /api/v1/saved_query/ POST endpoint to save a SQL query for later reuse.
Args: query_data: Dictionary containing the query information including: - db_id: Database ID - schema: Schema name (optional) - sql: SQL query text - label: Display name for the saved query - description: Optional description of the query
Returns: A dictionary with the created saved query information including its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query_data | Yes |
Implementation Reference
- main.py:1366-1389 (handler)The handler function for the 'superset_saved_query_create' tool. It creates a new saved query in Superset by sending a POST request to the /api/v1/saved_query/ endpoint with the provided query_data dictionary containing db_id, schema, sql, label, and description.@mcp.tool() @requires_auth @handle_api_errors async def superset_saved_query_create( ctx: Context, query_data: Dict[str, Any] ) -> Dict[str, Any]: """ Create a new saved query Makes a request to the /api/v1/saved_query/ POST endpoint to save a SQL query for later reuse. Args: query_data: Dictionary containing the query information including: - db_id: Database ID - schema: Schema name (optional) - sql: SQL query text - label: Display name for the saved query - description: Optional description of the query Returns: A dictionary with the created saved query information including its ID """ return await make_api_request(ctx, "post", "/api/v1/saved_query/", data=query_data)