Create DataLens dataset
datalens_datasets_createCreates a dataset in a workbook and returns its ID; create it empty, then populate sources, fields, and joins with update calls.
Instructions
Create a dataset in a workbook and return it with its id.
A dataset with no source and no field is valid: create it empty, then fill it with
datasets_update.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset": "<dataset>"
},
"name": "datalens_datasets_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The dataset's name. | |
| rev_id | No | The revision. | |
| dataset | Yes | What the dataset holds: sources, their joins, fields. An empty one is valid. Its schema is not listed here: read `DatasetContent` with schema_get(service="datalens", name="DatasetContent"), then the definitions it refers to. | |
| dry_run | No | Send nothing: answer `{dry_run: true, request}`, the first write the tool would make (null: none). | |
| options | No | What the editor may do with it. | |
| preview | No | Whether it is a preview. | |
| dir_path | No | The folder to create it in (old placement model). | |
| saved_id | No | The saved revision. | |
| created_via | No | How it is created: `user` or `workbook_copy`. | |
| workbook_id | No | The workbook to create it in. | |
| published_id | No | The published revision. | |
| collection_id | No | The collection to create it in. |