Skip to main content
Glama

superset_sqllab_execute

Execute SQL queries via Superset's SQL Lab to retrieve data. Provide database ID and SQL; set schema, catalog, or template params as needed.

Instructions

Execute a SQL query via SQL Lab and return the result.

IMPORTANT: before executing, make sure the SQL query is correct. Use superset_database_table_metadata or superset_database_tables to find actual table and column names. Maximum 1000 rows in the result (queryLimit).

Args: database_id: Database connection ID (from superset_database_list). sql: SQL query to execute. Examples: - SELECT * FROM public.my_table LIMIT 10 - SELECT count(*) FROM source.stat schema: Default schema for the query (e.g. "public", "source"). If not specified, the database default schema is used. catalog: Database catalog (for databases with catalog support, optional). tab_name: Tab name in SQL Lab UI (optional, for organization). template_params: JSON string with Jinja template parameters (optional). Example: '{"start_date": "2024-01-01"}'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
schemaNo
catalogNo
tab_nameNo
database_idYes
template_paramsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries full disclosure burden. It reveals the 1000-row limit, default schema behavior, catalog optionality, and template_params usage. However, it does not explicitly warn that arbitrary SQL can include destructive operations or that permissions may be required. The 'IMPORTANT' caution is a general warning but lacks specificity about side effects.

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

Conciseness5/5

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

The description is well-structured with a front-loaded purpose, a cautionary note, metadata tool pointer, row limit, and a parameter list. Every section adds value and the length is justified by the need to document six parameters thoroughly.

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

Completeness4/5

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

The presence of an output schema means return values need not be documented. The description covers prerequisites, limitations, and all parameters with examples. It does not mention error handling or asynchronous execution, but overall it is sufficient for correct invocation.

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

Parameters5/5

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

All six parameters are explained in detail with examples for sql and template_params, default behavior for schema, and provenance for database_id. This fully compensates for the 0% schema_description_coverage and significantly adds meaning beyond the raw schema.

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

Purpose5/5

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

The description clearly states it executes a SQL query via SQL Lab and returns the result, distinguishing it from siblings like superset_sqllab_export_csv (which exports) and superset_sqllab_format_sql (which formats). The action and output are explicit.

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

Usage Guidelines4/5

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

It provides clear context for use (executing validated SQL queries) and references superset_database_table_metadata and superset_database_tables as prerequisite tools for schema discovery. It also notes the 1000-row limit, but does not explicitly state when to prefer alternative execution tools or exclude this tool for certain query types.

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

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