@salesforce/afv-skills 1.59.0 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-architecture-analyze/SKILL.md +66 -17
  3. package/skills/agentforce-architecture-analyze/assets/cli/show_access_token.yaml +4 -7
  4. package/skills/agentforce-architecture-analyze/references/contract.json +1 -1
  5. package/skills/agentforce-architecture-analyze/scripts/emit_env.py +2 -2
  6. package/skills/agentforce-architecture-analyze/scripts/main.py +40 -44
  7. package/skills/agentforce-architecture-analyze/scripts/rest_client.py +11 -3
  8. package/skills/agentforce-architecture-analyze/scripts/sf_cli.py +77 -10
  9. package/skills/agentforce-architecture-analyze/scripts/tests/test_end_to_end_fixture.py +1 -0
  10. package/skills/agentforce-architecture-analyze/scripts/tests/test_flow_children_inflation.py +1 -0
  11. package/skills/agentforce-architecture-analyze/scripts/tests/test_main_pipeline.py +53 -2
  12. package/skills/agentforce-architecture-analyze/scripts/tests/test_resolve_creds.py +184 -36
  13. package/skills/agentforce-architecture-analyze/scripts/tests/test_rest_client.py +17 -0
  14. package/skills/agentforce-architecture-analyze/scripts/tests/test_sf_cli.py +165 -11
  15. package/skills/agentforce-architecture-analyze/scripts/tests/test_skill_md_pipeline_block.py +319 -0
  16. package/skills/agentforce-d360-analyze/SKILL.md +28 -10
  17. package/skills/agentforce-d360-analyze/scripts/dc.py +200 -50
  18. package/skills/agentforce-d360-analyze/scripts/discover_sessions.py +10 -6
  19. package/skills/agentforce-d360-analyze/scripts/fetch_dc.py +22 -6
  20. package/skills/agentforce-d360-analyze/scripts/resolve_session.py +21 -13
  21. package/skills/agentforce-d360-analyze/scripts/tests/test_dc_and_resolve_session.py +298 -76
  22. package/skills/agentforce-d360-analyze/scripts/tests/test_default_target_org.py +432 -0
  23. package/skills/agentforce-d360-analyze/scripts/tests/test_discover_sessions.py +1 -1
  24. package/skills/agentforce-d360-analyze/scripts/tests/test_resolve_session_main.py +9 -3
  25. package/skills/agentforce-d360-analyze/scripts/tests/test_skill_md_prefix_block.py +176 -0
  26. package/skills/consumer-goods-accruals-datakit-deploy/SKILL.md +17 -27
  27. package/skills/consumer-goods-accruals-datakit-deploy/scripts/setup.js +7 -17
  28. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/00-check-prerequisites.js +47 -63
  29. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/01-download-static-resource.js +10 -13
  30. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/02-replace-org-id.js +46 -46
  31. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/03-deploy-metadata.js +4 -21
  32. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/06-create-dataspace.js +58 -82
  33. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/07-deploy-accruals-reports.js +16 -315
  34. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/08-deploy-ui.js +9 -24
  35. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/09-completion.js +44 -44
  36. package/skills/consumer-goods-accruals-datakit-deploy/scripts/steps/utils.js +11 -63
  37. package/skills/consumer-goods-rtr-datacloud-export-configure/SKILL.md +2 -1
  38. package/skills/consumer-goods-tpe-dashboard-configure/SKILL.md +2 -1
  39. package/skills/consumer-goods-tpe-dashboard-custom-kpi-configure/SKILL.md +2 -1
  40. package/skills/consumer-goods-tpe-datakit-deploy/SKILL.md +2 -1
  41. package/skills/data360-schema-get/SKILL.md +3 -3
  42. package/skills/design-systems-slds-validate/references/report-format.md +1 -1
  43. package/skills/dx-org-manage/SKILL.md +1 -0
  44. package/skills/dx-org-shape-manage/SKILL.md +1 -0
  45. package/skills/dx-org-snapshot-manage/SKILL.md +172 -0
  46. package/skills/dx-org-snapshot-manage/examples/create_error_output.json +16 -0
  47. package/skills/dx-org-snapshot-manage/examples/create_success_output.json +19 -0
  48. package/skills/dx-org-snapshot-manage/examples/delete_output.json +9 -0
  49. package/skills/dx-org-snapshot-manage/examples/get_output.json +19 -0
  50. package/skills/dx-org-snapshot-manage/examples/list_output.json +36 -0
  51. package/skills/dx-org-snapshot-manage/references/cli_flags.md +179 -0
  52. package/skills/dx-org-snapshot-manage/references/snapshot_usage.md +55 -0
  53. package/skills/dx-org-trial-expiration-check/SKILL.md +1 -1
  54. package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +2 -2
  55. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +7 -5
  56. package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +11 -11
  57. package/skills/experience-content-media-image-generate/SKILL.md +83 -0
  58. package/skills/experience-content-media-image-generate/scripts/download-image.sh +84 -0
  59. package/skills/external-diagram-mermaid-generate/SKILL.md +12 -12
  60. package/skills/field-service-data-capture-migrate/references/component-mapping.md +1 -1
  61. package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +1 -2
  62. package/skills/field-service-data-capture-migrate/references/known-deploy-errors.md +1 -0
  63. package/skills/field-service-data-capture-migrate/references/transformer-rules.md +1 -1
  64. package/skills/field-service-data-capture-migrate/scripts/transform_flow.py +12 -1
  65. package/skills/field-service-data-capture-migrate/scripts/vendor/build_flow.py +4 -1
  66. package/skills/field-service-setup-orchestrator-get/SKILL.md +0 -1
  67. package/skills/insurance-brokerage-agency-billing-configure/SKILL.md +233 -0
  68. package/skills/insurance-brokerage-agency-billing-configure/references/accounting-setup.md +117 -0
  69. package/skills/insurance-brokerage-agency-billing-configure/references/billing-rules-config.md +237 -0
  70. package/skills/insurance-brokerage-agency-billing-configure/references/billing-settings.md +271 -0
  71. package/skills/insurance-brokerage-agency-billing-configure/references/demo-policy-config.md +138 -0
  72. package/skills/insurance-brokerage-agency-billing-configure/references/org-defaults.md +64 -0
  73. package/skills/insurance-brokerage-agency-billing-configure/references/permissions-config.md +226 -0
  74. package/skills/insurance-brokerage-agency-billing-configure/references/prerequisites.md +142 -0
  75. package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +3 -2
  76. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +3 -3
  77. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +68 -45
  78. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +17 -18
  79. package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +16 -3
  80. package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +16 -13
  81. package/skills/marketing-message-test/SKILL.md +194 -0
  82. package/skills/marketing-message-test/references/api-contract.md +333 -0
  83. package/skills/omnistudio-callable-apex-generate/SKILL.md +3 -3
  84. package/skills/omnistudio-datamapper-generate/SKILL.md +6 -6
  85. package/skills/omnistudio-datapacks-deploy/SKILL.md +11 -11
  86. package/skills/omnistudio-dependencies-analyze/SKILL.md +5 -5
  87. package/skills/omnistudio-epc-catalog-generate/SKILL.md +6 -6
  88. package/skills/omnistudio-flexcard-generate/SKILL.md +6 -6
  89. package/skills/omnistudio-integration-procedure-generate/SKILL.md +6 -6
  90. package/skills/omnistudio-omniscript-generate/SKILL.md +6 -5
  91. package/skills/platform-apex-logs-debug/SKILL.md +1 -0
  92. package/skills/platform-metadata-deploy/SKILL.md +1 -0
  93. package/skills/platform-models-api-configure/SKILL.md +5 -5
  94. package/skills/platform-soql-query/SKILL.md +1 -0
  95. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +17 -6
  96. package/skills/service-itsm-agentic-setup-incident-sla-configure/SKILL.md +107 -192
  97. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/attach-milestone-action.json +6 -6
  98. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/milestone-patterns.md +49 -20
  99. package/skills/service-itsm-agentic-setup-incident-sla-configure/examples/output-templates.md +4 -4
  100. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/mcp-invocation.md +224 -290
  101. package/skills/service-itsm-agentic-setup-incident-sla-configure/references/workflow.md +295 -0
  102. package/skills/service-itsm-incident-priority-configure/SKILL.md +1 -1
  103. package/skills/service-itsm-slack-itservice-configure/SKILL.md +2 -1
  104. package/skills/service-itsm-slack-itservice-configure/references/manage-slack-connection.md +2 -2
  105. package/skills/service-omni-channel-setup-coordinate/SKILL.md +20 -13
  106. package/skills/service-omni-channel-setup-coordinate/scripts/integration-driver.sh +5 -55
  107. package/skills/service-omni-channel-setup-coordinate/scripts/tests/test_omni_contracts.py +0 -38
  108. package/skills/service-omni-command-center-analyze/SKILL.md +2 -3
  109. package/skills/service-omni-command-center-analyze/scripts/analyze.sh +3 -3
  110. package/skills/tableau-next-asset-create/README.md +65 -0
  111. package/skills/tableau-next-asset-create/SKILL.md +409 -0
  112. package/skills/tableau-next-asset-create/references/admin-users.md +149 -0
  113. package/skills/tableau-next-asset-create/references/ai-readiness.md +355 -0
  114. package/skills/tableau-next-asset-create/references/alerts.md +111 -0
  115. package/skills/tableau-next-asset-create/references/build-workflow.md +819 -0
  116. package/skills/tableau-next-asset-create/references/dashboard-authoring.md +302 -0
  117. package/skills/tableau-next-asset-create/references/dashboard-design-principles.md +352 -0
  118. package/skills/tableau-next-asset-create/references/data-transform-gotchas.md +210 -0
  119. package/skills/tableau-next-asset-create/references/data-understanding.md +387 -0
  120. package/skills/tableau-next-asset-create/references/deep-reference-index.md +74 -0
  121. package/skills/tableau-next-asset-create/references/destructive-operations.md +62 -0
  122. package/skills/tableau-next-asset-create/references/edit-dashboard.md +273 -0
  123. package/skills/tableau-next-asset-create/references/edit-visualization.md +529 -0
  124. package/skills/tableau-next-asset-create/references/empty-source-handling.md +104 -0
  125. package/skills/tableau-next-asset-create/references/ingest-and-metric-gotchas.md +638 -0
  126. package/skills/tableau-next-asset-create/references/insight-bundle.md +69 -0
  127. package/skills/tableau-next-asset-create/references/large-flat-file-handling.md +331 -0
  128. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_envelope.json +54 -0
  129. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/_shared-widget-fields.json +122 -0
  130. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/add_page.json +29 -0
  131. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/delete_page.json +27 -0
  132. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/discard_dashboard.json +11 -0
  133. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget.json +30 -0
  134. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/move_widget_to_page.json +30 -0
  135. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/place_widget_on_page.json +30 -0
  136. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_dashboard.json +16 -0
  137. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/remove_widget_from_page.json +26 -0
  138. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/rename_page.json +28 -0
  139. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/save_dashboard.json +18 -0
  140. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/undo.json +11 -0
  141. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_button_widget.json +69 -0
  142. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_container_widget.json +88 -0
  143. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_filter_widget.json +146 -0
  144. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_metric_widget.json +78 -0
  145. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_navigation_widget.json +80 -0
  146. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_parameter_widget.json +160 -0
  147. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_text_widget.json +103 -0
  148. package/skills/tableau-next-asset-create/references/schemas/edit-dashboard/upsert_visualization_widget.json +68 -0
  149. package/skills/tableau-next-asset-create/references/sdm-tool-reference.md +721 -0
  150. package/skills/tableau-next-asset-create/references/semantic-query-and-enrichment.md +355 -0
  151. package/skills/tableau-next-asset-create/references/shared-gates.md +322 -0
  152. package/skills/tableau-next-asset-create/references/sharing-and-promotion.md +306 -0
  153. package/skills/tableau-next-asset-create/references/tasks/ai-readiness-audit.md +51 -0
  154. package/skills/tableau-next-asset-create/references/tasks/analyze-data.md +48 -0
  155. package/skills/tableau-next-asset-create/references/tasks/build-dashboard.md +66 -0
  156. package/skills/tableau-next-asset-create/references/tasks/build-end-to-end.md +73 -0
  157. package/skills/tableau-next-asset-create/references/tasks/create-data-transform.md +51 -0
  158. package/skills/tableau-next-asset-create/references/tasks/create-viz.md +58 -0
  159. package/skills/tableau-next-asset-create/references/tasks/edit-dashboard.md +80 -0
  160. package/skills/tableau-next-asset-create/references/tasks/edit-sdm.md +106 -0
  161. package/skills/tableau-next-asset-create/references/tasks/edit-viz.md +40 -0
  162. package/skills/tableau-next-asset-create/references/tasks/enrich-model.md +68 -0
  163. package/skills/tableau-next-asset-create/references/tasks/ingest-flat-file.md +68 -0
  164. package/skills/tableau-next-asset-create/references/tasks/manage-alert.md +35 -0
  165. package/skills/tableau-next-asset-create/references/tasks/profile-dataset.md +47 -0
  166. package/skills/tableau-next-asset-create/references/tasks/promote-or-reuse.md +46 -0
  167. package/skills/tableau-next-asset-create/references/tasks/provision-user.md +39 -0
  168. package/skills/tableau-next-asset-create/references/tasks/query-model.md +92 -0
  169. package/skills/tableau-next-asset-create/references/tasks/review-verified-questions.md +42 -0
  170. package/skills/tableau-next-asset-create/references/tasks/share-asset.md +37 -0
  171. package/skills/tableau-next-asset-create/references/verified-questions.md +125 -0
  172. package/skills/tableau-next-asset-create/references/viz-authoring.md +992 -0
  173. package/skills/service-de-channel-consent-configure/SKILL.md +0 -230
  174. package/skills/service-itsm-agentic-setup-incident-sla-configure/assets/predefined-incident-policy.json +0 -102
@@ -0,0 +1,80 @@
1
+ # Task: Edit an existing dashboard
2
+
3
+ Modify a dashboard that already exists — add/edit/move/remove a widget, or
4
+ add/rename/delete a page — via the atomic `edit_dashboard` batch tool, and only
5
+ persist the change on explicit request. For building a brand-new dashboard, use
6
+ `build-dashboard.md` instead. Entry point 20 ("add/edit a widget on an existing
7
+ dashboard" — see `build-dashboard.md`'s entry-point list).
8
+
9
+ ## Gates (assert before any tool call) → `../shared-gates.md`
10
+
11
+ Required: **G1** · Conditional: **G3** (◐, only if placing a viz/metric widget
12
+ whose `id`/apiName you have not read back this session) · **G8** (◐, only if the
13
+ edit changes the narrative structure — e.g. adding a new KPI/chart — not a pure
14
+ reposition/rename)
15
+
16
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
17
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
18
+ - **No G2/G7 by default.** Repositioning, renaming, or removing an
19
+ already-placed widget mutates layout, not data — the data-presence and
20
+ query-returns-real-data gates don't re-apply. They DO apply transitively when
21
+ the edit places a **new** viz/metric widget: that widget's underlying query
22
+ must have returned real rows first (same rule as `build-dashboard.md`).
23
+ - **G8** (◐): reposition-only edits don't need a restated narrative; adding a
24
+ widget that changes the story (a new KPI, a new breakdown) does — confirm it
25
+ still fits the KPIs → trends → breakdowns → correlations order.
26
+
27
+ ## Steps
28
+
29
+ The operation-type table, every `upsert_*_widget` shape, the widget-identity
30
+ rule, grid conventions, and draft-vs-persist mechanics are in
31
+ **`../edit-dashboard.md`**.
32
+
33
+ - **Before building a payload, Read the operation's schema file.**
34
+ `../edit-dashboard.md` §2's table names the exact
35
+ `../schemas/edit-dashboard/<operation>.json` for whichever operation(s) you're
36
+ about to send (e.g. `upsert_metric_widget.json`, `move_widget.json`) — it has
37
+ the authoritative required/optional fields, enums, and a worked example. Read
38
+ only the file(s) for this batch, not the whole directory.
39
+ - **Always pass `minorVersion: -1` explicitly** on every `edit_dashboard` call —
40
+ the schema shows it as a default, but it is not auto-applied; omitting it can
41
+ surface `ILLEGAL_QUERY_PARAMETER_VALUE: Illegal value for query parameter
42
+ 'minorVersion': ''`.
43
+ - **Upsert → place, same discipline as viz creation.** An `upsert_*_widget`
44
+ operation only *defines* a widget (create or full replace) — it renders
45
+ nowhere until paired with `place_widget_on_page` (same batch, or a later one
46
+ before you save) unless it's replacing an already-placed widget. Never
47
+ define a new widget without also placing it.
48
+ - **Widget identity.** `widget.name` always identifies the widget inside an
49
+ `upsert_*_widget` call; add `widget.id` only to fully replace an already
50
+ *persisted* widget (never invent this value — read it back first, e.g. via
51
+ `render_dashboard`/`get_dashboard`), and omit it to create a new widget. An
52
+ unsaved draft widget has no `id` — replace it by `widget.name` alone. Page
53
+ ops (`place_widget_on_page`/`remove_widget_from_page`/`move_widget`/
54
+ `move_widget_to_page`) use a third, separate field: `placement.name`. Full
55
+ detail: `../edit-dashboard.md` §3.
56
+ - **`autosave` is now top-level and batch-wide** (a sibling of `operations`,
57
+ not a per-operation field). Leave it unset (default `false`) to stage a
58
+ draft. The batch response IS the preview — show it, then ask before
59
+ persisting. Drafts **accumulate** across successive `edit_dashboard` calls on
60
+ the same dashboard until saved/discarded; the dashboard read tool will NOT
61
+ show a staged draft.
62
+ - **Persist only on explicit confirmation.** `save_dashboard` may now appear
63
+ standalone (commits whatever draft is already staged) or after other
64
+ mutations in the same batch (persists once they succeed) — it's no longer
65
+ required to be the batch's sole operation. Regardless of batch shape, only
66
+ send it after the user confirms **having seen** the draft — even if the
67
+ original request already said "save it" in the same message as the edit.
68
+ - **To revert an unsaved draft:** `undo` (standalone: reverts the last staged
69
+ change; in a mixed batch: cancels every operation in that batch) or
70
+ `discard_dashboard` (standalone: drops the whole staged draft; in a mixed
71
+ batch: ignores every other operation in that batch). `undo` only works while
72
+ a draft is staged — after a save there's nothing to undo (`RESOURCE_NOT_FOUND:
73
+ "No staged draft to undo for dashboard <name>"`).
74
+ - **To fully delete a widget (not just unplace it):** use
75
+ `remove_widget_from_dashboard` — a bare `widgetName`, deletes the definition
76
+ and every placement across every page in one operation, in the same batch as
77
+ any other `edit_dashboard` operations. `remove_widget_from_page` alone only
78
+ removes the page placement, leaving an orphaned widget definition in the
79
+ dashboard's `widgets` map — see `edit-dashboard.md` §6.
80
+ - No existing dashboard to edit? Route to **`build-dashboard.md`** instead.
@@ -0,0 +1,106 @@
1
+ # Task: Edit the semantic model — add a raw object / field / join / logical view
2
+
3
+ Create a model, or add a **raw** data object, dimension, measure, relationship,
4
+ logical view, or parameter to one. (For **calculated** dimensions/measures/metrics, use
5
+ `enrich-model.md`.) Entry points 7, 8, 9, 10.
6
+
7
+ ## Gates (assert before any tool call) → `../shared-gates.md`
8
+
9
+ This guide serves five mutating intents; required gates differ per intent:
10
+
11
+ - **Create new model (entry 7):** Required **G1, G2, G5** · Conditional **G6**
12
+ (◐). Nested explicit fields mean you control apiNames at create; still
13
+ light-confirm with `list_*` before relationships (G3).
14
+ - **Add data object (entry 8):** Required **G1, G2, G3, G5** · Conditional **G4**
15
+ (◐, once ≥2 objects — no islands), **G6** (◐).
16
+ - **Add dimension / measure (entry 9):** Required **G1, G2, G3, G5** ·
17
+ Conditional **G6** (◐). Use this only to add a *single extra field* to an
18
+ already-bound object — not for the initial bind.
19
+ - **Add relationship / join (entry 10):** Required **G1, G2, G3, G4, G7**. A raw
20
+ join creates no metadata, so G5 does not apply.
21
+ - **Add logical view (HardJoin / Union / CustomSQL):** Required **G1, G2, G3, G5**.
22
+ Field apiNames are assigned at first save — read them back with
23
+ `get_semantic_model_logical_view` before joining. `Hierarchy` is **not
24
+ currently supported via MCP**.
25
+
26
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
27
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
28
+ - **G2:** COUNT(*) the source object before adding it — never add a 0-row object.
29
+ - **G3:** read apiNames back with `list_*` before writing any relationship criteria
30
+ or field reference (semantic apiName + `leftFieldType: "TableField"`). For a
31
+ logical view, read assigned names from `get_semantic_model_logical_view`.
32
+ - **G4:** once ≥2 objects exist, no islands — ◐ when adding an object (entry 8),
33
+ **required** when adding a relationship (entry 10).
34
+ - **G5** (create model / add object / add field / add logical view — not raw
35
+ joins): set the required metadata at creation and prefer **nested explicit
36
+ fields** on `create_semantic_model` / `add_semantic_model_data_object`
37
+ (`shouldIncludeAllFields: false`) — full metadata list in `shared-gates.md`
38
+ G5. CustomSQL **requires** explicit fields (`shouldIncludeAllFields` does
39
+ not satisfy validation).
40
+ - **G7** (add-relationship): after adding, confirm the join key matches real rows
41
+ with a JOIN row-count — ~0 rows = broken.
42
+ - **G6** (◐): if a column's role/type isn't understood, profile first
43
+ (`../data-understanding.md`) — but do NOT re-run Step 0 ingest on a pre-existing
44
+ model.
45
+
46
+ ## Steps
47
+
48
+ Tool-by-tool input shapes, suffix rules, the apiName-mutation gotcha, and
49
+ logical-view shapes are in **`../sdm-tool-reference.md`**; the numbered spine
50
+ (create model with nested fields, add objects, add relationships) is
51
+ `../build-workflow.md` Steps 4–6.
52
+
53
+ - **Create model** — `create_semantic_model` + `update_semantic_model` (Step 4).
54
+ Nested `semanticDataObjects[].label` is REQUIRED. Bind fields **in this
55
+ call**: `shouldIncludeAllFields: false` plus explicit
56
+ `semanticDimensions[]` / `semanticMeasurements[]` (fetch fields first;
57
+ include join keys). Relationships, metrics, calcs, parameters, and logical
58
+ views are still post-create `add_semantic_model_*`. **Extend a Model** uses
59
+ the same tool with `baseModels[]` of `{ "apiName": "<existing SDM>" }` in
60
+ the same `dataspace` (typical label `"<Base Label> (Extended)"`; payload in
61
+ **`../sdm-tool-reference.md`**). Prefer **anchor-plus-nested-fields create**,
62
+ then incremental `add_semantic_model_data_object` with the same nested
63
+ arrays. If a table has no FK to the anchor, add the intermediate first,
64
+ then bridge through it. Bulk-create timeout (`postSemanticModelCollection`)
65
+ may still persist the SDM — wait ~30s and `list_semantic_models` before
66
+ retrying (naive retry → Unique constraint violated). Optional sanity check:
67
+ `get_semantic_model` with `includeModelContent=true`.
68
+ - **Add data object** — `add_semantic_model_data_object` (`dataObjectType:"Dmo"`,
69
+ name `*__dlm`) with nested `semanticDimensions[]` /
70
+ `semanticMeasurements[]` (`shouldIncludeAllFields: false`). Omit
71
+ `primaryNameField` at create (G5 known gap).
72
+ - **Add dimension / measure** — `add_semantic_model_dimension` / `_measure`
73
+ only for a *single extra field* on an already-bound object. Do **not** use
74
+ these for the initial bind (that is the nested create / add-data-object
75
+ path above).
76
+ - **Add relationship / join** — `add_semantic_model_relationship`
77
+ (`leftFieldType:"TableField"`, `joinType:"Auto"`, `label` required even though
78
+ schema marks it optional). Validate the join with a real JOIN row-count (G7).
79
+ - **Add / update a parameter** — post-create only (`add_semantic_model_parameter`;
80
+ cannot be created inline on `create_semantic_model`). Updates are PUT, not
81
+ PATCH — re-send `label`/`type`/`dataType`/`defaultValue` even for a
82
+ description-only change. `List` needs `values` and a matching `defaultValue`.
83
+ Shapes: **`../sdm-tool-reference.md`** (Parameters).
84
+ - **Add logical view** — `add_semantic_model_logical_view`. Enumerate existing
85
+ views via `get_semantic_model` (`semanticLogicalViews[]`) first. `label` is
86
+ required. Rules and reference payloads: **`../sdm-tool-reference.md`**
87
+ (Logical views).
88
+ - **HardJoin 3-step:** objects only → GET assigned apiNames → relationship
89
+ with LV `joinType` `Left`/`Right`/`Inner`/`Full` (**not** `Auto`). Prefix
90
+ LV object apiNames `LV_`.
91
+ - **Union:** exactly one `semanticUnions[]` entry. **Do NOT pass
92
+ `"semanticViewTypeEnum": "Union"`**. Mapped-field apiNames are
93
+ **locally-scoped** on that ULV object.
94
+ - **CustomSQL:** `customSQLV2`; exactly one `CustomSQL` data object with
95
+ **explicit** dims/measures.
96
+ - **Update (PATCH):** `update_semantic_model_logical_view` only persists
97
+ `description`, `filterLogic`, and `filters`. Empty body `{}` is rejected.
98
+ GET via `get_semantic_model_logical_view` first before replacing filters.
99
+ **Label is silently ignored** (API accepts it, never persists). SQL or
100
+ view-type changes require delete-and-recreate — do not treat a 2xx PATCH
101
+ as a successful rename or SQL edit.
102
+ To remove a logical view, see **`../sdm-tool-reference.md`** (Deleting) —
103
+ a blocked LV delete is HTTP 500 `DEPENDENCY_EXISTS` (do not retry).
104
+
105
+ Do NOT re-profile from scratch or re-ingest on an already-built model — assume the
106
+ model exists and touch only what the request names.
@@ -0,0 +1,40 @@
1
+ # Task: Edit an existing visualization
2
+
3
+ Modify a visualization that already exists — add/remove/replace a shelf field,
4
+ filter, forecast, sort, mark encoding, mark type, dual axis, reference line, table
5
+ calc, or axis title — and, only on explicit request, save the result. For building a
6
+ brand-new chart, use `create-viz.md` instead.
7
+
8
+ ## Gates (assert before any tool call) → `../shared-gates.md`
9
+
10
+ Required: **G1** · Conditional: **G3** (◐, only if an operation references a field/
11
+ apiName you have not read back this session — e.g. adding a brand-new shelf field)
12
+
13
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
14
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
15
+ - **No G2/G7/G8 by default.** You are mutating an already-created, already-verified
16
+ visualization — this is not a fresh build from a new query, so the data-presence,
17
+ query-returns-real-data, and narrative-design gates that gate `create_visualization`
18
+ do not re-apply here.
19
+
20
+ ## Steps
21
+
22
+ The `editOperations` operation-type reference, filter-operator rules, the
23
+ `{model:}`/`{expression:}` decision rule, and the reference-line `field.function` vs
24
+ `line.function` disambiguation are in **`../edit-visualization.md`**.
25
+
26
+ - Obtain the current `visualizationId` — from `get_visualization`, or from a
27
+ prior `edit_visualization`/`update_visualization` call. Do **not** pass a
28
+ `visualizationMetadata` blob into `edit_visualization` or `update_visualization`.
29
+ - Build the `editOperations` array per `../edit-visualization.md`; JSON-stringify the
30
+ whole array into a single string — never pass a raw array.
31
+ - Call `edit_visualization` with `visualizationId` + that string. Its result
32
+ renders inline automatically — do **not** call `render_visualization` on it.
33
+ - **Never call `update_visualization` automatically.** After `edit_visualization`
34
+ renders the preview, ask the user whether to save; call `update_visualization`
35
+ only on their confirmation *after seeing that preview*, passing **only**
36
+ `visualizationId` (the server persists its working state for that id). This
37
+ applies even if the user's original request already said to save it — the
38
+ edit still renders a preview first, and only a confirmation given after that
39
+ preview authorizes the persist.
40
+ - No existing chart to edit? Route to **`create-viz.md`** instead.
@@ -0,0 +1,68 @@
1
+ # Task: Enrich the model — calculated dimension / measure / metric
2
+
3
+ Add a **calculated** dimension or measure, or create a metric, on a model that
4
+ already exists. This is the guardrail-densest entry point. Entry points 11, 12, 13.
5
+
6
+ ## Gates (assert before any tool call) → `../shared-gates.md`
7
+
8
+ This guide serves three intents; G7 required-ness differs per intent:
9
+
10
+ - **Add calculated dimension (entry 11):** Required **G1, G2, G3, G5, G6** ·
11
+ Conditional **G7** (◐, only if the calc references data you haven't just
12
+ verified with `run_semantic_query`).
13
+ - **Add calculated measure (entry 12):** Required **G1, G2, G3, G5, G6** ·
14
+ Conditional **G7** (◐, same rule as entry 11).
15
+ - **Create metric (entry 13):** Required **G1, G2, G3, G5, G6, G7** — a metric is
16
+ always query-facing, so G7 is unconditional here.
17
+
18
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
19
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
20
+ - **G6:** confirm grain + additivity + that your date is a **business-event date**
21
+ (`../data-understanding.md`) — a metric on a load/system/partition timestamp is
22
+ wrong even if it returns rows. Applies on a pre-existing model; do NOT re-ingest.
23
+ - **G5:** run the per-component coverage `list_*` check FIRST (calc dimension, calc
24
+ measure, and metric each require different `list_*` calls) and set the required
25
+ metric shape — the authoritative sub-rules (`UserAgg`-not-`Auto`, concrete
26
+ `aggregationType`, `identifyingDimension`, count-via-numeric, full-PUT
27
+ `insightsSettings`) are in `shared-gates.md` G5. Don't proceed without it.
28
+ - **G3:** read back exact apiNames via `list_*` before referencing them in a
29
+ formula or `measurementReference`.
30
+ - **G2:** the underlying object has rows (required for all three intents).
31
+ - **G7:** `run_semantic_query` returns real data before you trust the
32
+ calculation — required for a metric (entry 13); for a calc dimension/measure
33
+ (entries 11/12) only re-verify if you haven't already confirmed the query
34
+ path on this data (see header above).
35
+
36
+ ## Steps
37
+
38
+ Worked calc-dimension / calc-measure / metric payloads and the field-shape matrix
39
+ are in **`../semantic-query-and-enrichment.md`**; the extra metric gotchas
40
+ (`Auto` rejection, `identifyingDimension`, count-by-numeric, the row-level-ratio
41
+ `Average` case) are in `../ingest-and-metric-gotchas.md` §B; `../build-workflow.md` Step 8
42
+ is the spine.
43
+
44
+ **Identify the analysis intent first** (trend / comparison / part-to-whole /
45
+ correlation / forecast — see `create-viz.md` / `viz-authoring.md` §3) so
46
+ enrichment produces the fields that intent needs: a business-meaningful date
47
+ anchor for trend/forecast, a slicing dimension for part-to-whole, two measures
48
+ for correlation.
49
+
50
+ - **Calc dimension** — `add_semantic_model_calculated_dimension` (after the
51
+ coverage `list_*`); distinct label + description (homonym dates → two dims).
52
+ - **Calc measure** — `add_semantic_model_calculated_measure`; `UserAgg` when the
53
+ expression aggregates. Inputs are a **JSON object, NOT a stringified JSON
54
+ string**. Do not set `externalLevel` / `externalConnectionApiName` unless
55
+ connecting to an external definition. Updates are **full PUT**: GET via
56
+ `get_semantic_model_calculated_measure`, then send the complete object
57
+ (omitted fields reset to defaults).
58
+ - **Metric** — `add_semantic_model_metric` with the full verified shape (concrete
59
+ `aggregationType`, `identifyingDimension`, count-via-numeric, `sentiment`).
60
+ `identifyingDimension` MAY point at a field on a **joined** object
61
+ (cross-object). Create the metric by default when the request implies a
62
+ tracked number and a meaningful event date exists. Updates are full PUT
63
+ (GET via `get_semantic_model_metric` first; `{description}` → `MasterLabel`
64
+ means send `label`).
65
+
66
+ When asked to create two fields with the same/equivalent formula, treat it as a
67
+ synonym (G5): declare one canonical, decline or ask about the other — don't
68
+ silently create both.
@@ -0,0 +1,68 @@
1
+ # Task: Ingest a file or existing connection → DLO → DMO
2
+
3
+ Ingest local CSV/Excel **or** a table from an existing Data Cloud connection
4
+ into Data Lake Objects and Data Model Objects — the front half that the SDM
5
+ build assumes already exists. Entry point 1. (Entry point 3 — probing a
6
+ large/cryptic file *before* ingesting — is diagnostic and lives in
7
+ `profile-dataset.md` / `../large-flat-file-handling.md`; this guide's G6 bullet
8
+ below just points there.)
9
+
10
+ ## Gates (assert before any tool call) → `../shared-gates.md`
11
+
12
+ Required: **G1, G2, G5-light** · Conditional: **G6** (◐, for a large/cryptic file)
13
+
14
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
15
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
16
+ - **G6** (◐): if the file is large/wide/cryptic, use `infer_object_schema`
17
+ FIRST, decode the column-naming grammar, then verify one known number with
18
+ `run_query` after ingest (`../large-flat-file-handling.md`). Do not slurp the
19
+ whole file into context or add a local parsing step.
20
+ - **G2 (post-ingest):** `run_data_stream` is mandatory; then wait until the DLO
21
+ is Active and the DMO is Ready. Mapping **query** readiness is `run_query`
22
+ against `<dmo>__dlm` (`42P01` keep polling; `COUNT = 0` is READY).
23
+ `get_dlo_to_dmo_mapping_status` `ACTIVE` is metadata only — not that gate
24
+ (`shared-gates.md` G2). For a self-created mapped DMO, do not refuse SDM
25
+ create because `COUNT = 0`; do not proceed while the table is missing.
26
+ - **G5-light:** file-upload DLOs **and** DMOs require `category: "Other"` (never
27
+ `"Engagement"`); DLO→DMO mapping field dev names carry a literal `__c` on both
28
+ sides — copy them from the materialized table, not from `get_data_stream`.
29
+ Full AI-readiness metadata lands later when objects/fields are added.
30
+ - **Schema confirmation:** after `infer_object_schema`, present the fields and
31
+ **wait for the user to explicitly confirm** or adjust types / primary key /
32
+ skipped columns. Do not call `create_data_stream` until they approve or say
33
+ to proceed.
34
+
35
+ ## Steps
36
+
37
+ The fixed, ordered ingestion chain with verified payloads is in
38
+ **`../ingest-and-metric-gotchas.md`**:
39
+
40
+ **File CSV / Excel — §A:**
41
+ `get_upload_connection` → `generate_presigned_credential` (per file; PUT with
42
+ decoded URL + optional `headers`; opaque `parentDirectory` /
43
+ `importDirectory`; re-call if `expiryTime` passed) → Excel: `list_data_connection_objects` for sheets →
44
+ `infer_object_schema` → **confirm schema** → `create_data_stream` (`*__dll`
45
+ DLO, including `mappings` / `refreshConfig` / `advancedAttributes`) →
46
+ **`run_data_stream` + wait until Active** → SCHEMA REALITY CHECK
47
+ (materialized DLO, not `get_data_stream`) + real Primary Key read-back →
48
+ `create_data_model_object` (unsuffixed name — `Orders`, not
49
+ `Orders__dlm`; the platform adds `__dlm`) → **wait until Ready** →
50
+ `create_dlo_to_dmo_mapping` → inspect mapping
51
+ (`get_dlo_to_dmo_mapping_status` for `ERROR`) → **poll `run_query` until
52
+ `<dmo>__dlm` exists** (`COUNT = 0` is READY).
53
+
54
+ **Existing database / lakehouse connection — §C:**
55
+ `list_connections` (exact `connectorType` casing) → optional
56
+ `test_existing_connection` (once; `9cg` id) → `list_data_connection_objects`
57
+ → `infer_object_schema` (table `resourceName`; uppercase `SCHEMA`/`DATABASE`)
58
+ → **confirm schema** → `create_data_stream` with `dataAccessMode:
59
+ "Direct_Access"` and the connection **developer name** → `run_data_stream`
60
+ `interactive: false` → then the same SCHEMA REALITY CHECK → DMO → mapping
61
+ tail as §A.
62
+
63
+ After `run_query` succeeds on the `__dlm` table, continue with `edit-sdm.md`
64
+ (build the model) or `build-end-to-end.md` Step 4. `COUNT = 0` on that
65
+ successful query is READY for these self-created DMOs (G2); `42P01` is not.
66
+ Ingestion gotchas (status waits, SCHEMA REALITY CHECK, `category:"Other"`,
67
+ universal-`__c`, stream payload traps) are in
68
+ `../ingest-and-metric-gotchas.md` §A / §C.
@@ -0,0 +1,35 @@
1
+ # Task: Create / update / list / delete a data alert
2
+
3
+ Persist an ongoing Tableau Next data monitor. One-off "why did this number
4
+ move" questions are `analyze-data.md`, not this guide.
5
+
6
+ ## Gates (assert before any tool call) → `../shared-gates.md`
7
+
8
+ Required: **G1**
9
+
10
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
11
+ - **Tool names are written bare** — invoke each under your client's name for
12
+ that `tableau-next-*` server tool (`shared-gates.md`).
13
+ - **Confirmation (this guide):** first `create_alert` / `update_alert` /
14
+ `delete_alert` call is a preview. Show `alertSummary`, then retry with
15
+ `userConfirmed=true`. `delete_alert` is irreversible.
16
+
17
+ ## When **not** to use these tools
18
+
19
+ - **One-off interpretation** ("why did EMEA sales drop", "compare regions
20
+ last quarter") → `analyze-data.md` / `analyze_data`. Do not pin an SDM
21
+ there either.
22
+ - **A saved chart of current state** → `create-viz.md` / `build-dashboard.md`.
23
+
24
+ ## Steps
25
+
26
+ Transcript-on-follow-up, do-not-pin-SDM, timeout-poll, full replacement on
27
+ update, and never-show-`savedDataAlertId` are in **`../alerts.md`**.
28
+
29
+ 1. **List** — `get_alerts` (caller's alerts only).
30
+ 2. **Create** — `create_alert` with `conversationContext`. Do **not** look
31
+ up or pin `targetEntity*`. Preview, then `userConfirmed=true`.
32
+ 3. **Update** — resolve `savedDataAlertId` via `get_alerts`, then
33
+ `update_alert` with the **complete** desired configuration (omit = drop).
34
+ 4. **Delete** — `get_alerts` then `delete_alert` after preview.
35
+ 5. **Timeout** — poll `get_alerts`; do not immediately re-create.
@@ -0,0 +1,47 @@
1
+ # Task: Profile / discover / verify a dataset (read-only diagnostics)
2
+
3
+ Understand data before modeling it, discover what's available, or triage an empty
4
+ source. All read-only — no mutation. Entry points 2, 3, 4, 5, 6.
5
+
6
+ ## Gates (assert before any tool call) → `../shared-gates.md`
7
+
8
+ This guide serves five read-only intents; required gates differ per intent:
9
+
10
+ - **Profile / understand dataset (entry 2):** Required **G1, G6** · Conditional
11
+ **G2** (◐, when cardinality/additivity depends on a row count).
12
+ - **Infer a large/wide/cryptic flat file's schema (entry 3):** Required **G1,
13
+ G6** — same profiling rule as entry 2, starting with `infer_object_schema` as
14
+ described in `../large-flat-file-handling.md`.
15
+ - **Discover data assets (entry 4):** Required **G1**.
16
+ - **Verify presence / triage empty (entry 5):** Required **G1, G2** — you must
17
+ `COUNT(*)`; presence is the whole question.
18
+ - **Confirm join keys (entry 6):** Required **G1, G2** · Conditional **G3**
19
+ (◐, only if you're about to persist a join with the keys you find).
20
+
21
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
22
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
23
+ - **G6:** profile the five things — grain, field roles, cardinality, additivity,
24
+ date roles (`../data-understanding.md`). This applies over an already-modeled
25
+ dataset too, whenever you don't yet understand what the numbers mean. For a
26
+ large/wide/cryptic flat file, use the infer-first variant (infer fields/types,
27
+ decode the naming grammar, verify one number after ingest —
28
+ `../large-flat-file-handling.md`).
29
+ - **G2** (◐): when the ask is "does this source have data?", run `SELECT COUNT(*)`
30
+ — `count>0` usable, `count=0` empty, `does not exist`/`42P01` unmaterialized (a
31
+ distinct case — `../empty-source-handling.md`).
32
+
33
+ ## Steps (read-only — do NOT mutate)
34
+
35
+ - **Discover sources** — `browse_data_assets` (a label/keyword match is a
36
+ *candidate list*, not the answer; calling convention + gotchas —
37
+ `../sdm-tool-reference.md`).
38
+ - **Verify presence / triage empty** — `SELECT COUNT(*)`; distinguish empty from
39
+ unmaterialized per `../empty-source-handling.md`.
40
+ - **Confirm join keys** — run a real JOIN row-count between two objects; a key
41
+ matching ~0 rows is as broken as no relationship (this is diagnostic here — the
42
+ persisted join lives in `edit-sdm.md`).
43
+ - **Profile** — grain / field roles / cardinality / additivity / date roles
44
+ (`../data-understanding.md`); large/cryptic files → `../large-flat-file-handling.md`.
45
+
46
+ This guide is diagnostic only. When you move on to *persist* structure, route to
47
+ `edit-sdm.md`; to *enrich*, `enrich-model.md`; to *query*, `query-model.md`.
@@ -0,0 +1,46 @@
1
+ # Task: Reuse a prod asset or promote a Personal Org asset
2
+
3
+ **Reuse** copies a production Dashboard, Visualization, DMO, SDM, or CIO
4
+ into a Personal Org workspace. **Promotion** packages a Personal Org asset
5
+ and, after the export is ready, lands datakits in a git repo via a reviewed
6
+ PR. Both use `create_reuse_promotion_request`; only Promotion then uses
7
+ `create_promotion_pull_request`.
8
+
9
+ Not a greenfield create (`build-end-to-end.md` / `create_semantic_model`) and
10
+ not sharing with a user (`share-asset.md`).
11
+
12
+ ## Gates (assert before any tool call) → `../shared-gates.md`
13
+
14
+ Required: **G1**
15
+
16
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
17
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
18
+ - **Confirmation (this guide):** confirm `requestType` (Reuse vs Promotion),
19
+ `assetId`, workspace, label, and `requesterComment` before create. After a
20
+ Promotion export is `Ready`, **ask again** before
21
+ `create_promotion_pull_request`. Ask for the target directory and branch
22
+ name — do not invent them.
23
+
24
+ ## Steps
25
+
26
+ Direction flip, poll fields (`status` vs `packageExportStatus`), list
27
+ filters, HTTP 400, and the client-side convert/`gh` procedure are in
28
+ **`../sharing-and-promotion.md`** (§Promote).
29
+
30
+ 1. Confirm Personal Org context. Create is rejected outside it.
31
+ 2. `create_reuse_promotion_request` with a non-empty `requesterComment`
32
+ (max 254 chars).
33
+ Reuse: prod `assetId` + Personal Org destination workspace. Promotion:
34
+ Personal Org `assetId` + the workspace that contains it.
35
+ 3. Poll **`get_promotion_reuse_request`** with the returned id (not an
36
+ unfiltered list). Reuse: wait for the terminal `completed` (not
37
+ `migrationSucceeded`, a transient intermediate a late poll skips); **STOP**
38
+ on `failed` / `cancelled` / `rejected` (`rejectionComment` when rejected).
39
+ Promotion: poll `packageExportStatus` for lowercase `ready` (10s × 30s
40
+ window); `status` stays `requested` throughout.
41
+ 4. Survey outstanding Reuse work with `list_promotion_reuse_requests` and
42
+ top-level `requestType=reuse` (not a `requestParams` wrapper). For one
43
+ known id, get-by-id.
44
+ 5. Promotion only, after user confirm: `create_promotion_pull_request`, then
45
+ the download / `sf` convert / copy / `gh pr create` recovery path in the
46
+ deep ref. Stop if `sf` is missing.
@@ -0,0 +1,39 @@
1
+ # Task: Provision / list Tableau Next users / check licenses
2
+
3
+ Grant, change, revoke, or deactivate a Tableau Next **role**, list users, or
4
+ check license seats. This is org-admin work, not an asset share.
5
+
6
+ ## Gates (assert before any tool call) → `../shared-gates.md`
7
+
8
+ Required: **G1**
9
+
10
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
11
+ - **Tool names are written bare** — invoke each under your client's name for
12
+ that `tableau-next-*` server tool (`shared-gates.md`).
13
+ - **ADMIN-ONLY.** Unauthorized → report and STOP. Do not fall back to
14
+ `search_users_and_groups` or share tools.
15
+ - **Confirmation (this guide):** never call `upsert_user` on the request
16
+ turn. Preview per `../admin-users.md`, wait for an explicit yes.
17
+
18
+ ## When **not** to use these tools
19
+
20
+ - **Share / revoke access on a dashboard, viz, workspace, or SDM** →
21
+ `share-asset.md` (`search_users_and_groups` + `add_asset_share` /
22
+ `remove_asset_share`). "Give Alice viewer access to this dashboard" is a
23
+ share, not a role grant.
24
+ - **Workspace membership** (`add_workspace_asset`) is not a share and not
25
+ a role provision.
26
+
27
+ ## Steps
28
+
29
+ Preview formats, ADD CONFLICT, rename-not-supported, remove≠DEACTIVATE,
30
+ Personal Org `forceDeactivate`, and license `available=0` / `exhausted`
31
+ are in **`../admin-users.md`**.
32
+
33
+ 1. **List / find users** — `get_users`. Omit `offset` on the first page;
34
+ paginate with `nextOffset`. Filters apply server-side.
35
+ 2. **Check seats** — `get_license_availability` before ADD or a role
36
+ upgrade. If `available` is 0 / `exhausted` is true, warn and stop.
37
+ 3. **Mutate** — only after a confirmed preview: `upsert_user` with the
38
+ admin-chosen `action` (`ADD` / `UPDATE` / `REVOKE` / `DEACTIVATE`).
39
+ ADD CONFLICT on existing email → do not silently retry as UPDATE.
@@ -0,0 +1,92 @@
1
+ # Task: Query an existing model
2
+
3
+ Pull figures from an already-built SDM via `run_semantic_query`: a plain count,
4
+ total, or scalar ("how many / how much / what is total…"), a "give / run me the
5
+ numbers" retrieval, or a structured table. The model does **not** have to be
6
+ named up front — discover it with `list_semantic_models` when it isn't given.
7
+ Prefer this over `analyze_data` whenever the user wants the figures themselves
8
+ rather than an interpreted breakdown, ranking, trend, or comparison.
9
+
10
+ Raw SQL against a DLO/DMO (`run_query`) also enters here when no SDM covers
11
+ the data or the user asked for SQL — still prefer `run_semantic_query` when
12
+ an SDM exists.
13
+
14
+ Interpreted breakdowns, rankings, trends, and comparisons go to
15
+ `analyze-data.md` / `analyze_data`. Scoring candidate SQL against expected
16
+ SQL is `review-verified-questions.md` (`run_regression_evaluator`) — it
17
+ does not query data.
18
+
19
+ ## Gates (assert before any tool call) → `../shared-gates.md`
20
+
21
+ Required: **G1, G2, G3** · Conditional: **G4** (◐, if querying across objects),
22
+ **G6** (◐, if you don't yet understand what the returned numbers mean)
23
+
24
+ - **G1** (router-asserted): a `mcp__tableau-next-*__` tool must be connected.
25
+ - **Tool names are written bare** — invoke each under your client's name for that `tableau-next-*` server tool (`shared-gates.md`).
26
+ - **G2:** the target object has rows (a query over an empty object returns empty).
27
+ - **G3:** reference fields by their exact stored apiName — read back via `list_*`
28
+ if unsure; never invent a suffixed name.
29
+ - **G4** (◐): only query across objects that are actually joined; do not set
30
+ `queryUnrelatedDataObjects:"Exception"` and query across unjoined objects.
31
+ - **G6** (◐): if the additivity/grain of the returned numbers isn't understood,
32
+ profile first (`../data-understanding.md`).
33
+
34
+ ## Steps
35
+
36
+ If the user did not name an SDM, call `list_semantic_models` and pick the
37
+ matching populated model before querying.
38
+
39
+ The proto-shaped `run_semantic_query` body, field-shape matrix, recovery strings,
40
+ aggregation enum, detail-row, and `filter` XOR `flatten_filter` payloads are in
41
+ **`../semantic-query-and-enrichment.md`**.
42
+
43
+ - **Prefer `run_semantic_query` when an SDM exists** for the data. Fall back
44
+ to `run_query` (Data Cloud / Hyper SQL against a DLO `__dll` or DMO `__dlm`)
45
+ when the user asks for raw SQL, no SDM covers the tables, or you are
46
+ checking ingest materialization (`ingest-and-metric-gotchas.md` §A).
47
+ Discover SQL table names from `list_semantic_model_data_objects`
48
+ `dataObjectName` when an SDM is in play — that value already includes the
49
+ suffix and is ground truth. Otherwise use the suffixed DLO/DMO developer
50
+ name (`__dll` DLO, `__dlm` DMO). A bare DMO name (no `__dlm`) fails with
51
+ `42P01` / "table does not exist". Double-quote reserved words and names
52
+ with spaces.
53
+ `run_query` is Hyper SQL (full SELECT / WHERE / GROUP BY / JOIN /
54
+ aggregates / windows). That is a **different** engine from the SparkInternal
55
+ DCSQL subset on `create_data_transform` / `update_data_transform` — do not
56
+ copy those unsupported-op restrictions onto `run_query`, or vice versa.
57
+ `run_query` returns the **first chunk only** — if `returnedRows` looks short
58
+ or `status.completionStatus` is not `Finished`, say so and narrow with WHERE
59
+ / a lower `rowLimit`. Pagination tools (`query_data_status`, `query_data_rows`)
60
+ are not available. Response `data` is an array of **row arrays** (values in
61
+ `metadata` order), not row objects — join column names/types from the
62
+ separate `metadata` array.
63
+ Bind user input with `:name` placeholders and `sqlParameters` (the `name`
64
+ field is `"p1"` for `:p1`, no colon). `name` and `value` are required on every
65
+ parameter; `value` is always a serialized **string**. `type` defaults to
66
+ Varchar — set Integer / BigInt / Double / Boolean / Date / DateTime for
67
+ non-string columns (`type` tells the server how to interpret the string).
68
+ `dataspace` is optional; omitting it targets **default**. In a
69
+ multi-dataspace org that is easy to get wrong — pass the dataspace that
70
+ actually holds the `__dll` / `__dlm` (same name used on create/mapping)
71
+ rather than assuming default.
72
+
73
+ - Pass **ONE** of `structuredSemanticQuery` (recommended) **OR**
74
+ `structuredMetricQuery` — mutually exclusive. Prefer an existing metric
75
+ (`structuredMetricQuery`) / calc measure over reconstructing a `SUM(...)`
76
+ aggregation inline.
77
+ - Write the semantic-query body in **snake_case proto** shape (`table_field`,
78
+ `grouping`, `semantic_aggregation_method`) — REST-gateway camelCase examples
79
+ fail here.
80
+ - Group by the correct date grain (e.g. month), not by a raw timestamp.
81
+ - Query is org-level / SDM-level — it does **NOT** take a `workspaceId`. Any SDM
82
+ visible via `list_semantic_models` is queryable regardless of workspace.
83
+ - Provisioning is gated on `orgHasDataCloudReportingEnabled` /
84
+ `orgHasSemanticQuery`. A permission error is a **provisioning gap**, not a
85
+ caller payload bug.
86
+ - **Display:** render rows as a markdown table for ≤20 rows, else row count +
87
+ first 10 + "… and N more". Order by `placeInOrder`. Do **NOT** echo the raw
88
+ `queryResults` JSON. Surface `errorMessage` verbatim on failure.
89
+
90
+ This is a read/query entry point — it does not model, enrich, or visualize. If the
91
+ answer needs a chart, continue to `create-viz.md` (which re-asserts G7 before
92
+ charting).