superset_dataset_create
Create datasets in Apache Superset by connecting database tables or views to enable data visualization and analysis.
Instructions
Create a new dataset in Superset
Makes a request to the /api/v1/dataset/ POST endpoint to create a new dataset from an existing database table or view.
Args: table_name: Name of the physical table in the database database_id: ID of the database where the table exists schema: Optional database schema name where the table is located owners: Optional list of user IDs who should own this dataset
Returns: A dictionary with the created dataset information including its ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | ||
| database_id | Yes | ||
| schema | No | ||
| owners | No |
Implementation Reference
- main.py:1126-1163 (handler)The main handler function for the 'superset_dataset_create' MCP tool. It constructs a payload with table_name, database_id, optional schema and owners, and makes a POST request to Superset's /api/v1/dataset/ endpoint to create the dataset.@mcp.tool() @requires_auth @handle_api_errors async def superset_dataset_create( ctx: Context, table_name: str, database_id: int, schema: str = None, owners: List[int] = None, ) -> Dict[str, Any]: """ Create a new dataset in Superset Makes a request to the /api/v1/dataset/ POST endpoint to create a new dataset from an existing database table or view. Args: table_name: Name of the physical table in the database database_id: ID of the database where the table exists schema: Optional database schema name where the table is located owners: Optional list of user IDs who should own this dataset Returns: A dictionary with the created dataset information including its ID """ payload = { "table_name": table_name, "database": database_id, } if schema: payload["schema"] = schema if owners: payload["owners"] = owners return await make_api_request(ctx, "post", "/api/v1/dataset/", data=payload)