d8a_prepare_insight_change
Prepare creating or updating a table, funnel or journeys insight without saving or running it. content has title, description, kind (table, funnel or journeys), definition_schema_version (1 table, 2 funnel, 3 journeys: it names the type, it is not a newer version) and definition. mode=create needs title, kind, definition_schema_version and the complete definition. mode=update needs insight_id and lock_version from d8a_get_insight_definition and keeps omitted fields; a title or description change keeps the saved definition exactly. A new definition needs its definition_schema_version, and changing the type also needs kind. Table definitions use dimensions, metrics and filters: [[{column: {id}, operator, values: [...]}]] (values, not d8a_run_query's value); dates, paging and comparisons are not saved. Use exact IDs from d8a_get_query_catalog. Show the user the complete before and after and the warnings, ask them to approve, then call d8a_execute_change. Running the insight first is a good check but not required. Insights can't be deleted here.
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": {
"property_id": "<property_id>",
"mode": "<mode>",
"content": "<content>"
},
"name": "d8a_prepare_insight_change"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | create or update. | |
| content | Yes | Fields to save; omitted ones stay as saved. | |
| insight_id | No | Insight to update; omit when creating. | |
| property_id | Yes | Property ID. | |
| lock_version | No | From d8a_get_insight_definition. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| review | No | ||
| target | Yes | ||
| preview | Yes | ||
| expires_at | No | ||
| proposal_id | No | ||
| requires_acknowledgment | Yes |