Skip to main content
Glama
aptro

Superset MCP Integration

by aptro

superset_sqllab_export_query_results

Export SQL query results to CSV format for data analysis and sharing. Use this tool to download query outputs from Apache Superset for further processing.

Instructions

Export the results of a SQL query to CSV

Makes a request to the /api/v1/sqllab/export/{client_id} endpoint to download query results in CSV format.

Args: client_id: Client ID of the query

Returns: A dictionary with the exported data or error information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYes

Implementation Reference

  • The handler function implementing the 'superset_sqllab_export_query_results' tool. It makes a GET request to the Superset API endpoint /api/v1/sqllab/export/{client_id} to export query results as CSV and returns the data or error information.
    @mcp.tool() @requires_auth @handle_api_errors async def superset_sqllab_export_query_results( ctx: Context, client_id: str ) -> Dict[str, Any]: """ Export the results of a SQL query to CSV Makes a request to the /api/v1/sqllab/export/{client_id} endpoint to download query results in CSV format. Args: client_id: Client ID of the query Returns: A dictionary with the exported data or error information """ superset_ctx: SupersetContext = ctx.request_context.lifespan_context try: response = await superset_ctx.client.get(f"/api/v1/sqllab/export/{client_id}") if response.status_code != 200: return { "error": f"Failed to export query results: {response.status_code} - {response.text}" } return {"message": "Query results exported successfully", "data": response.text} except Exception as e: return {"error": f"Error exporting query results: {str(e)}"}

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