Datasource Calculated Fields Create
datasource_calculated_fields_createValidate and create calculated fields in an attached Data Studio datasource using fingerprint checks and dry-run previews, then apply and read back the draft.
Instructions
Validate and create calculated fields in an attached datasource.
Requires matching draft/published and datasource_get fingerprint. Expressions reference existing internal fields (t0.revenue); no within-batch references. Explicit aggregation is required; aggregate expressions require AUTO (7). Preview IDs are provisional. Publishes the full source draft once and reads both states back. operation_restore restores its recorded before-state. Does not create a datasource asset. Row/aggregate creation and undo were verified live; numeric results and all formula types remain unverified.
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": {
"datasource_id": "<datasource_id>",
"fields": "<fields>",
"expected_fingerprint": "<expected_fingerprint>"
},
"name": "datasource_calculated_fields_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | ||
| dry_run | No | ||
| report_id | No | ||
| datasource_id | Yes | ||
| allow_shared_source | No | ||
| expected_fingerprint | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||