@salesforce/afv-skills 1.37.0 → 1.38.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 (247) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-generate/README.md +20 -3
  3. package/skills/agentforce-generate/SKILL.md +253 -440
  4. package/skills/agentforce-generate/assets/agent-spec-template.md +6 -2
  5. package/skills/agentforce-generate/assets/agents/order-service.agent +16 -12
  6. package/skills/agentforce-generate/assets/agents/production-faq.agent +4 -4
  7. package/skills/agentforce-generate/assets/agents/router-first.agent +5 -5
  8. package/skills/agentforce-generate/assets/agents/template-single-subagent.agent +4 -4
  9. package/skills/agentforce-generate/assets/agents/verification-gate.agent +8 -6
  10. package/skills/agentforce-generate/assets/agents/voice-knowledge-grounded.agent +9 -9
  11. package/skills/agentforce-generate/assets/agents/voice-service-agent.agent +7 -7
  12. package/skills/agentforce-generate/assets/patterns/README.md +3 -3
  13. package/skills/agentforce-generate/assets/patterns/action-callbacks.agent +5 -5
  14. package/skills/agentforce-generate/assets/patterns/advanced-input-bindings.agent +6 -8
  15. package/skills/agentforce-generate/assets/patterns/bidirectional-routing.agent +11 -13
  16. package/skills/agentforce-generate/assets/patterns/critical-input-collection.agent +11 -16
  17. package/skills/agentforce-generate/assets/patterns/lifecycle-events.agent +2 -3
  18. package/skills/agentforce-generate/assets/patterns/llm-controlled-actions.agent +6 -7
  19. package/skills/agentforce-generate/assets/patterns/open-gate-routing.agent +3 -3
  20. package/skills/agentforce-generate/assets/patterns/prompt-template-action.agent +14 -19
  21. package/skills/agentforce-generate/assets/patterns/system-instruction-overrides.agent +11 -20
  22. package/skills/agentforce-generate/references/actions-reference.md +2 -2
  23. package/skills/agentforce-generate/references/agent-audit-and-repair.md +135 -0
  24. package/skills/agentforce-generate/references/agent-audit-candidate-verification.md +160 -0
  25. package/skills/agentforce-generate/references/agent-audit-diagnostic-catalog.md +156 -0
  26. package/skills/agentforce-generate/references/agent-audit-diagnostics-actions-state.md +176 -0
  27. package/skills/agentforce-generate/references/agent-audit-diagnostics-architecture-evaluation.md +68 -0
  28. package/skills/agentforce-generate/references/agent-audit-diagnostics-instructions-routing.md +283 -0
  29. package/skills/agentforce-generate/references/agent-audit-evaluation-loop.md +191 -0
  30. package/skills/agentforce-generate/references/agent-audit-repair-report.md +143 -0
  31. package/skills/agentforce-generate/references/agent-audit-scope-path-review.md +180 -0
  32. package/skills/agentforce-generate/references/agent-design-and-spec-creation.md +105 -59
  33. package/skills/agentforce-generate/references/agent-script-core-language.md +144 -61
  34. package/skills/agentforce-generate/references/agent-subagent-map-diagrams.md +33 -23
  35. package/skills/agentforce-generate/references/agent-validation-and-debugging.md +37 -11
  36. package/skills/agentforce-generate/references/agentscript-toolchain.md +112 -0
  37. package/skills/agentforce-generate/references/architecture-patterns.md +81 -18
  38. package/skills/agentforce-generate/references/common-control-flow-pitfalls.md +255 -0
  39. package/skills/agentforce-generate/references/control-flow-actions-sequencing.md +198 -0
  40. package/skills/agentforce-generate/references/control-flow-lifecycle-side-effects.md +87 -0
  41. package/skills/agentforce-generate/references/examples.md +22 -22
  42. package/skills/agentforce-generate/references/instruction-resolution.md +123 -83
  43. package/skills/agentforce-generate/references/known-issues.md +1 -2
  44. package/skills/agentforce-generate/references/optimization-pattern-1-data-flow.md +4 -0
  45. package/skills/agentforce-generate/references/optimization-pattern-2-deterministic-logic.md +33 -0
  46. package/skills/agentforce-generate/references/optimization-pattern-3-reference-syntax.md +32 -3
  47. package/skills/agentforce-generate/references/optimization-pattern-4-escalation.md +2 -2
  48. package/skills/agentforce-generate/references/patterns-by-requirement.md +3 -1
  49. package/skills/agentforce-generate/references/posture-and-determinism.md +103 -22
  50. package/skills/agentforce-generate/references/reference-map.md +19 -3
  51. package/skills/agentforce-generate/references/scoring-rubric.md +1 -1
  52. package/skills/agentforce-generate/references/voice-latency-heuristics.md +4 -0
  53. package/skills/agentforce-generate/references/voice-modality-reference.md +4 -4
  54. package/skills/agentforce-generate/references/zen-of-agentscript.md +139 -23
  55. package/skills/agentforce-generate/scripts/agentscript-sdk-loader.mjs +133 -0
  56. package/skills/agentforce-generate/scripts/index-agent.mjs +141 -0
  57. package/skills/agentforce-generate/scripts/setup-agentscript-sdk.mjs +337 -0
  58. package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +1 -1
  59. package/skills/automation-sandbox-post-copy-configure/SKILL.md +433 -0
  60. package/skills/automation-sandbox-post-copy-configure/assets/api_request_templates.json +89 -0
  61. package/skills/automation-sandbox-post-copy-configure/examples/sample_config_input.json +40 -0
  62. package/skills/automation-sandbox-post-copy-configure/examples/sample_execution_summary.md +79 -0
  63. package/skills/automation-sandbox-post-copy-configure/references/api_endpoints.md +273 -0
  64. package/skills/automation-sandbox-post-copy-configure/references/authentication.md +94 -0
  65. package/skills/automation-sandbox-post-copy-configure/references/execution_phasing.md +93 -0
  66. package/skills/automation-sandbox-post-copy-configure/references/rules_gotchas.md +35 -0
  67. package/skills/automation-sandbox-post-copy-configure/scripts/classify-patch-result.mjs +88 -0
  68. package/skills/automation-sandbox-post-copy-configure/scripts/map-metadata-key.mjs +98 -0
  69. package/skills/automation-sandbox-post-copy-configure/scripts/plan-phases.mjs +98 -0
  70. package/skills/automation-sandbox-post-copy-configure/scripts/resolve-target-org.mjs +56 -0
  71. package/skills/design-systems-slds-validate/SKILL.md +14 -13
  72. package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +1 -1
  73. package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +1 -1
  74. package/skills/dx-org-devhub-configure/SKILL.md +268 -0
  75. package/skills/dx-org-devhub-configure/examples/status-output.md +39 -0
  76. package/skills/dx-org-devhub-configure/scripts/devhub.sh +650 -0
  77. package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +116 -0
  78. package/skills/dx-org-manage/SKILL.md +135 -42
  79. package/skills/dx-org-manage/assets/derive-alias.sh +95 -0
  80. package/skills/dx-org-manage/assets/scratch-def.seed.json +6 -0
  81. package/skills/dx-org-manage/examples/README.md +1 -1
  82. package/skills/dx-org-manage/examples/scratch-orgs/delete_output.json +8 -0
  83. package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +23 -0
  84. package/skills/dx-org-manage/examples/scratch-orgs/list_output.json +58 -0
  85. package/skills/dx-org-manage/examples/scratch-orgs/resume_output.json +38 -0
  86. package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +1 -1
  87. package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +1 -1
  88. package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +41 -0
  89. package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +1 -1
  90. package/skills/dx-org-manage/examples/snapshots/error_output.json +3 -3
  91. package/skills/dx-org-manage/references/creating-scratch-org.md +2 -2
  92. package/skills/dx-org-manage/references/creating-snapshot.md +1 -2
  93. package/skills/dx-org-manage/references/definition_file_options.md +24 -0
  94. package/skills/dx-org-manage/references/edition_types.md +10 -8
  95. package/skills/dx-org-manage/references/opening-org.md +11 -12
  96. package/skills/dx-org-manage/references/scratch-org-create.md +303 -0
  97. package/skills/dx-org-manage/references/scratch-org-operations.md +135 -0
  98. package/skills/experience-aura-lwc-migrate/SKILL.md +120 -0
  99. package/skills/experience-aura-lwc-migrate/references/aura-api-expert.md +170 -0
  100. package/skills/experience-aura-lwc-migrate/references/aura-data-expert.md +172 -0
  101. package/skills/experience-aura-lwc-migrate/references/aura-migration-guidelines.md +299 -0
  102. package/skills/experience-aura-lwc-migrate/references/aura-prd-framework.md +79 -0
  103. package/skills/experience-aura-lwc-migrate/references/aura-redundant-code-expert.md +24 -0
  104. package/skills/experience-aura-lwc-migrate/references/aura-reference-expert.md +140 -0
  105. package/skills/experience-aura-lwc-migrate/references/aura-resolver-expert.md +115 -0
  106. package/skills/experience-aura-lwc-migrate/references/aura-slots-expert.md +67 -0
  107. package/skills/experience-aura-lwc-migrate/references/aura-style-expert.md +62 -0
  108. package/skills/experience-aura-lwc-migrate/references/aura-to-lwc-completeness-checklist.md +188 -0
  109. package/skills/experience-aura-lwc-migrate/references/aura-values-expert.md +67 -0
  110. package/skills/experience-content-media-search/SKILL.md +17 -12
  111. package/skills/experience-content-media-stock-image-search/SKILL.md +192 -0
  112. package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +102 -0
  113. package/skills/experience-lds-best-practices-apply/SKILL.md +245 -0
  114. package/skills/experience-lds-best-practices-apply/references/adapter-apis.md +1640 -0
  115. package/skills/experience-lds-best-practices-apply/references/lds-data-consistency.md +126 -0
  116. package/skills/experience-lds-best-practices-apply/references/lds-expert.md +429 -0
  117. package/skills/experience-lds-best-practices-apply/references/lds-referential-integrity.md +322 -0
  118. package/skills/experience-lds-best-practices-apply/references/wire-adapter-types.md +1511 -0
  119. package/skills/experience-lds-graphql-generate/SKILL.md +222 -0
  120. package/skills/experience-lds-graphql-generate/references/generation-guide.md +236 -0
  121. package/skills/experience-lds-graphql-generate/references/generation-mutation.md +277 -0
  122. package/skills/experience-lds-graphql-generate/references/generation-query.md +237 -0
  123. package/skills/experience-lds-graphql-generate/scripts/fetch-lds-graphql-schema.sh +230 -0
  124. package/skills/experience-lds-graphql-generate/scripts/test-lds-graphql-query.sh +128 -0
  125. package/skills/experience-lwc-accessibility-validate/SKILL.md +112 -0
  126. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-1-1-non-text-content.md +88 -0
  127. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-i-lists.md +52 -0
  128. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-ii-tables.md +106 -0
  129. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iii-form-labels.md +78 -0
  130. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iv-regions.md +26 -0
  131. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-v-groups.md +66 -0
  132. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-5-identify-input.md +70 -0
  133. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-4-3-contrast.md +115 -0
  134. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-1-1-keyboard.md +47 -0
  135. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-4-link-purpose.md +39 -0
  136. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-6-headings-labels.md +50 -0
  137. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-1-pointer-gestures.md +54 -0
  138. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-2-pointer-cancellation.md +49 -0
  139. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-3-label-in-name.md +77 -0
  140. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-7-dragging-movement.md +45 -0
  141. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-1-on-focus.md +55 -0
  142. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-2-on-input.md +51 -0
  143. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-1-error-identification.md +84 -0
  144. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-2-labels-instructions.md +50 -0
  145. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-3-error-suggestion.md +64 -0
  146. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-i-name.md +105 -0
  147. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-ii-role.md +99 -0
  148. package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-iii-value.md +97 -0
  149. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-1-1-non-text-content.md +83 -0
  150. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-1-use-of-color.md +62 -0
  151. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-10-resize-reflow.md +18 -0
  152. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-11-non-text-contrast.md +43 -0
  153. package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-3-contrast.md +25 -0
  154. package/skills/experience-lwc-accessibility-validate/scripts/contrast-ratio.py +153 -0
  155. package/skills/experience-lwc-design-generate/SKILL.md +261 -0
  156. package/skills/experience-lwc-design-generate/references/figma-to-prd-blueprint.md +66 -0
  157. package/skills/experience-lwc-design-generate/references/prd-analysis-template.md +17 -0
  158. package/skills/experience-lwc-design-generate/scripts/check-component-name.sh +75 -0
  159. package/skills/experience-lwc-design-generate/scripts/detect-project-tools.sh +97 -0
  160. package/skills/experience-lwc-runtime-observe/SKILL.md +244 -0
  161. package/skills/experience-lwc-runtime-observe/examples/component-preview-and-dom.md +41 -0
  162. package/skills/experience-lwc-runtime-observe/scripts/extract-dom.sh +79 -0
  163. package/skills/experience-lwc-runtime-observe/scripts/open-frontdoor.sh +46 -0
  164. package/skills/experience-lwc-runtime-observe/scripts/verify-toolchain.sh +48 -0
  165. package/skills/experience-lwc-security-validate/SKILL.md +151 -0
  166. package/skills/experience-lwc-security-validate/examples/review-report.md +6 -0
  167. package/skills/experience-lwc-security-validate/examples/score-report.sarif.json +32 -0
  168. package/skills/experience-lwc-security-validate/references/lws-security-expert.md +986 -0
  169. package/skills/experience-lwc-security-validate/references/security-analysis.md +611 -0
  170. package/skills/experience-lwc-security-validate/scripts/check-lwc-import.sh +166 -0
  171. package/skills/experience-lwc-security-validate/scripts/validate-sarif.sh +131 -0
  172. package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +454 -0
  173. package/skills/experience-ui-bundle-2gp-deploy/assets/CustomApplication.app-meta.xml +12 -0
  174. package/skills/experience-ui-bundle-2gp-deploy/assets/PermissionSet.permissionset-meta.xml +9 -0
  175. package/skills/experience-ui-bundle-2gp-deploy/scripts/find-bundle-package-dir.sh +53 -0
  176. package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +104 -26
  177. package/skills/experience-ui-bundle-agentforce-client-generate/references/constraints.md +35 -24
  178. package/skills/experience-ui-bundle-agentforce-client-generate/references/examples.md +92 -1
  179. package/skills/experience-ui-bundle-agentforce-client-generate/references/style-tokens.md +2 -0
  180. package/skills/experience-ui-bundle-agentforce-client-generate/references/troubleshooting.md +14 -1
  181. package/skills/experience-ui-bundle-agentforce-client-generate/scripts/detect-framework.sh +67 -0
  182. package/skills/experience-ui-bundle-deploy/SKILL.md +83 -14
  183. package/skills/experience-ui-bundle-deploy/assets/Communities.settings-meta.xml +19 -0
  184. package/skills/experience-ui-bundle-deploy/assets/org-setup.config.template.json +5 -0
  185. package/skills/experience-ui-bundle-deploy/assets/social-login-auth-providers.apex +158 -0
  186. package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +13 -1
  187. package/skills/experience-ui-bundle-deploy/references/social-login.md +179 -0
  188. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +14 -0
  189. package/skills/experience-ui-bundle-mfa-configure/SKILL.md +6 -5
  190. package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +15 -7
  191. package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +41 -5
  192. package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +10 -22
  193. package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +4 -19
  194. package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +5 -0
  195. package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +33 -150
  196. package/skills/mobile-platform-native-capabilities-integrate/references/nfc.md +35 -0
  197. package/skills/platform-apex-generate/SKILL.md +8 -7
  198. package/skills/platform-apex-test-generate/SKILL.md +3 -1
  199. package/skills/platform-apex-test-run/SKILL.md +9 -8
  200. package/skills/platform-lightning-type-widget-coordinate/SKILL.md +1 -1
  201. package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +1 -1
  202. package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +1 -1
  203. package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +3 -3
  204. package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +43 -67
  205. package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +1 -2
  206. package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +2 -3
  207. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-list-source-prompt.md +163 -0
  208. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-single-source-prompt.md +198 -0
  209. package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +0 -1
  210. package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +17 -11
  211. package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +48 -15
  212. package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +73 -10
  213. package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +48 -8
  214. package/skills/platform-policy-rule-generate/SKILL.md +22 -12
  215. package/skills/platform-policy-rule-generate/references/deploy-errors.md +1 -1
  216. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +8 -29
  217. package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
  218. package/skills/platform-sharing-owd-configure/SKILL.md +20 -8
  219. package/skills/platform-sharing-owd-configure/references/access_levels.md +14 -1
  220. package/skills/platform-sharing-rules-generate/SKILL.md +67 -35
  221. package/skills/platform-sharing-rules-generate/examples/create-cases.md +16 -17
  222. package/skills/platform-sharing-rules-generate/examples/delete-cases.md +34 -79
  223. package/skills/platform-sharing-rules-generate/examples/edit-cases.md +13 -26
  224. package/skills/platform-sharing-rules-generate/scripts/count-remaining-rules.sh +33 -0
  225. package/skills/platform-widget-generate/SKILL.md +3 -5
  226. package/skills/platform-widget-generate/examples/conditional.json +18 -13
  227. package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
  228. package/skills/platform-widget-generate/examples/single-object.json +2 -2
  229. package/skills/platform-widget-generate/references/schema-from-lightning-type.md +27 -6
  230. package/skills/platform-widget-generate/references/widget-bundle-layout.md +4 -3
  231. package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +287 -0
  232. package/skills/service-itsm-agentic-setup-cmdb-access-assign/references/mcp-invocation.md +260 -0
  233. package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +252 -0
  234. package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/references/mcp-invocation.md +204 -0
  235. package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +259 -0
  236. package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +188 -0
  237. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +197 -0
  238. package/skills/service-itsm-agentic-setup-cmdb-coordinate/examples/output-templates.md +77 -0
  239. package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +316 -0
  240. package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/references/mcp-invocation.md +221 -0
  241. package/skills/service-itsm-incident-priority-configure/SKILL.md +168 -0
  242. package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +200 -0
  243. package/skills/service-itsm-incident-priority-configure/examples/render-matrix.md +54 -0
  244. package/skills/service-itsm-incident-priority-configure/examples/seed-full-matrix.md +52 -0
  245. package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +264 -0
  246. package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +0 -191
  247. package/skills/platform-policy-rule-generate/references/fixtures-index.md +0 -29
@@ -0,0 +1,204 @@
1
+ # MCP Invocation Reference — CMDB Bundle Deploy (Layer 4)
2
+
3
+ Every operation dispatches through the **Salesforce-hosted `headless-360`** MCP server, which exposes
4
+ four meta-tools:
5
+
6
+ - `mcp__headless-360__discover(query)` — semantic search over the indexed operation catalog
7
+ - `mcp__headless-360__describe(id)` — pull the schema and canonical route for one operation
8
+ - `mcp__headless-360__dispatch_readonly({url, method, queryParams?, body?})` — GET / read-only HTTP
9
+ - `mcp__headless-360__dispatch({url, method, body?, queryParams?})` — POST / PATCH / DELETE HTTP
10
+
11
+ **Dispatch takes raw HTTP**, not `{operation_id, arguments}`. Give it the full `url`
12
+ (`/services/data/v67.0/...`), `method`, optional `body`, and optional `queryParams` (camelCase — the
13
+ tool rejects `query_params`) — the server
14
+ signs the request with the JWT bound to the current MCP session and forwards it to the org. The skill
15
+ never handles credentials or an org alias — everything is derived from the session.
16
+
17
+ **A `discover` miss does NOT mean the route is absent.** The `/connect/cmdb/...` routes this skill
18
+ uses are documented core Connect APIs but are not always ranked first (or indexed) in the discovery
19
+ corpus — `describe` on the canonical operation still returns the schema, and `dispatch*` on the exact
20
+ path still works. Only if the GET/POST itself returns 404 should you treat the route as unavailable on
21
+ this org.
22
+
23
+ ## Response envelope
24
+
25
+ The CMDB Connect API, `/sobjects/…` REST endpoints, and `/query` are **standard REST** — the
26
+ `dispatch*` tool returns the REST response singly wrapped:
27
+
28
+ ```json
29
+ { "status_code": 200, "body": { "success": true, "latestVersion": "v3.0", "installedVersion": "" } }
30
+ ```
31
+
32
+ Read fields from `body`. (Only `/headless/invoke/…` Aura-controller routes are doubly wrapped as
33
+ `body.body`; this skill uses none.) Status codes: `200/201` success; `400` bundle/version doesn't exist
34
+ (or bad body); `403 FUNCTIONALITY_NOT_ENABLED` the CMDB gate is closed — either the org feature is not
35
+ enabled, or the running user has no CMDB access (Step 1 disambiguates); `404` the endpoint/impl is not
36
+ present on this org; `500` a downstream dependency issue.
37
+
38
+ All three CMDB endpoints below are implemented core Connect APIs in module
39
+ `shared-service-itom-connect-api` and are gated by `orgHasCMDBEnabled`. Minimum API version is
40
+ **67.0** — `headless-360` currently only routes `v67.0+`.
41
+
42
+ ---
43
+
44
+ ## Discovery — run first
45
+
46
+ ```text
47
+ mcp__headless-360__discover(query="cmdb bundle installation")
48
+ ```
49
+
50
+ `discover` returns matching operation ids. Pipe the install operation id into `describe` to pull its
51
+ input schema and canonical HTTP route:
52
+
53
+ ```text
54
+ mcp__headless-360__describe(id="<bundleInstallation operation id from discover>")
55
+ ```
56
+
57
+ If `discover` returns nothing at all after rewording the query, the org's `headless-360` corpus does
58
+ not index this surface — dispatch the exact `/connect/cmdb/...` paths below directly; only treat the
59
+ route as unavailable if the dispatch itself 404s.
60
+
61
+ ---
62
+
63
+ ## Step 1 — Enablement gate + catalog: bundleListView (read)
64
+
65
+ ```json
66
+ mcp__headless-360__dispatch_readonly({
67
+ "url": "/services/data/v67.0/connect/cmdb/bundleListView",
68
+ "method": "GET"
69
+ })
70
+ ```
71
+
72
+ - `200` → CMDB is enabled and the running user has access. `body` includes availability + installation
73
+ status per bundle.
74
+ - `403 FUNCTIONALITY_NOT_ENABLED` → ambiguous; this read enforces both the org gate and the user's own
75
+ CMDB access. Disambiguate via the feature status:
76
+ ```json
77
+ mcp__headless-360__dispatch_readonly({
78
+ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/status",
79
+ "method": "GET"
80
+ })
81
+ ```
82
+ - `status != ENABLED` → CMDB feature not enabled. STOP; route to
83
+ `service-itsm-agentic-setup-cmdb-configure`.
84
+ - `status == ENABLED` → feature is on; the user lacks CMDB permission sets. STOP; route to
85
+ `service-itsm-agentic-setup-cmdb-access-assign` (read set at minimum; Type Manager for bundle
86
+ management), then retry.
87
+
88
+ Identify the base bundle (CMDB Foundation) and note its `currentInstalledVersion`.
89
+
90
+ ---
91
+
92
+ ## Step 2 — Resolve the exact base version: bundles/details (read)
93
+
94
+ ```json
95
+ mcp__headless-360__dispatch_readonly({
96
+ "url": "/services/data/v67.0/connect/cmdb/bundles/details",
97
+ "method": "GET",
98
+ "queryParams": { "bundleIdentifier": "base" }
99
+ })
100
+ ```
101
+
102
+ Response fields include: `name`, `latestVersion`, `installedVersion`, `installedDate`,
103
+ `publishedDate`, `dependsOnBaseVersion`, `bundleDescription`, `listOfVersions`.
104
+
105
+ - **Pass the version string verbatim.** `bundles/details` reports the version exactly as the registry
106
+ stores it (e.g. `latestVersion: "v3.0"`). The `bundleInstallation` endpoint matches the requested
107
+ version by **exact string equality** against that registry — it does no normalization — so send the
108
+ catalog's `latestVersion` through unchanged. Do NOT strip, add, or reformat any characters (including
109
+ a leading `v`); altering the string makes it fail the equality check.
110
+ - **You may only install the latest version.** The endpoint rejects any non-latest version
111
+ (`"Target version <x> is not the latest available version"`) and cannot install or roll back to an
112
+ older version — always resolve `latestVersion` and install exactly that.
113
+ - If `installedVersion == latestVersion`, the base bundle is already up to date — stop.
114
+
115
+ `versionNumber` is an optional query param to inspect a specific version; omit it to get the latest.
116
+
117
+ > **If `bundles/details` returns `403 FUNCTIONALITY_NOT_ENABLED`** while `bundleListView` (Step 1)
118
+ > returned `200`: the org gate is fine, but the running user lacks the bundle-management permission.
119
+ > `bundles/details` requires the **`ItSrvcCnfgItmTypManagerPermissionSet`** (Type Manager) set — the
120
+ > read / owner / type-read sets are not sufficient. Have Type Manager assigned via
121
+ > `service-itsm-agentic-setup-cmdb-access-assign`, then retry. As a fallback, `bundleListView` already
122
+ > returns the base bundle's `currentInstalledVersion` and `latestVersion`, so resolve the version from
123
+ > Step 1's response if Type Manager cannot be assigned.
124
+
125
+ ---
126
+
127
+ ## Step 3 — Install the base bundle: bundleInstallation (write)
128
+
129
+ Confirm the input schema first:
130
+
131
+ ```text
132
+ mcp__headless-360__discover(query="cmdb bundle installation")
133
+ mcp__headless-360__describe(id="<bundleInstallation operation id>")
134
+ ```
135
+
136
+ Then install:
137
+
138
+ ```json
139
+ mcp__headless-360__dispatch({
140
+ "url": "/services/data/v67.0/connect/cmdb/bundleInstallation",
141
+ "method": "POST",
142
+ "body": { "bundleIdentifier": "base", "version": "<Step 2's latestVersion, verbatim>" }
143
+ })
144
+ ```
145
+
146
+ Both `bundleIdentifier` and `version` are **required**. Response:
147
+ `{ "success": true, "message": "...", "error": null }`. `success: true` means installation was
148
+ **initiated** (may complete asynchronously).
149
+
150
+ ---
151
+
152
+ ## Step 4 — Verify (read)
153
+
154
+ ```json
155
+ mcp__headless-360__dispatch_readonly({
156
+ "url": "/services/data/v67.0/connect/cmdb/bundles/details",
157
+ "method": "GET",
158
+ "queryParams": { "bundleIdentifier": "base" }
159
+ })
160
+ ```
161
+
162
+ Confirm `installedVersion` equals the version you installed. If installation is async and it has not
163
+ updated yet, report in-progress and tell the user to re-check.
164
+
165
+ ---
166
+
167
+ ## Idempotency
168
+
169
+ - All reads (Steps 1, 2, 4) are safe to repeat.
170
+ - Before installing, compare `installedVersion` to `latestVersion` — skip if already up to date.
171
+ - Re-installing the same version is unnecessary; always resolve + compare first.
172
+
173
+ ---
174
+
175
+ ## Dead ends — do NOT do these
176
+
177
+ - **Do NOT:** hard-code, guess, or reformat a version string — always read `latestVersion` from the
178
+ catalog and post it verbatim (including any leading `v`, e.g. `"v3.0"`). The endpoint matches by
179
+ exact string equality against the registry; stripping or altering the string breaks the match.
180
+ - **Do NOT:** attempt to install a non-latest version — the endpoint only accepts the latest
181
+ (`"Target version <x> is not the latest available version"`) and cannot roll back.
182
+ - **Do NOT:** install an optional add-on bundle — this skill is scoped to `base` (CMDB Foundation)
183
+ only.
184
+ - **Do NOT:** treat a `403` on `bundleListView` as "feature off" without checking the feature status —
185
+ it may instead be the running user lacking CMDB access.
186
+ - **Do NOT:** report the install as done on `success: true` alone — installation can be async; verify
187
+ via `bundles/details`.
188
+ - **Do NOT:** pass `dispatch` the `{operation_id, arguments}` shape — it takes raw HTTP
189
+ (`{url, method, body?, queryParams?}`).
190
+
191
+ ---
192
+
193
+ ## Error table
194
+
195
+ | Status / message | Meaning | Resolution |
196
+ |------------------|---------|------------|
197
+ | `403 FUNCTIONALITY_NOT_ENABLED` on `bundleListView`, feature `status != ENABLED` | CMDB feature not enabled for the org | Enable the CMDB feature first (`service-itsm-agentic-setup-cmdb-configure`), then return |
198
+ | `403 FUNCTIONALITY_NOT_ENABLED` on `bundleListView`, feature `status == ENABLED` | Feature on; running user lacks CMDB access | Grant the user CMDB access (`service-itsm-agentic-setup-cmdb-access-assign`), then retry — do NOT run configure |
199
+ | `403 FUNCTIONALITY_NOT_ENABLED` on `bundles/details`, `bundleListView` was `200` | User lacks Type Manager (`ItSrvcCnfgItmTypManagerPermissionSet`); org gate is fine | Assign Type Manager via the access-assign skill, or read the version from `bundleListView` instead |
200
+ | `400` bundle/version doesn't exist on install | Wrong `version` string | Re-read `bundles/details`; post `latestVersion` verbatim (do not strip or reformat) |
201
+ | `Target version <x> is not the latest available version` on install | Attempted to install a non-latest version | Re-read `bundles/details`, resolve `latestVersion`, and install exactly that — older versions/rollback are not supported |
202
+ | `success: true`, version unchanged | Async install in progress | Re-check `bundles/details` shortly |
203
+ | `500` on install (verbatim latest version) | Downstream/backend issue on the org, not a bad request | Retry; if persistent, capture the support `ErrorId` and escalate to Salesforce support |
204
+ | `dispatch*` auth error | The headless-360 MCP session isn't authenticated or the token expired | Re-authenticate the headless-360 MCP connection; confirm the session points at the intended org |
@@ -0,0 +1,259 @@
1
+ ---
2
+ name: service-itsm-agentic-setup-cmdb-configure
3
+ description: "Enable the CMDB (Configuration Management Database) feature in Service Cloud ITSM against a production or sandbox org: verify the CMDB org SKU, provision the ITOM tenant, and enable the service-cloud-itsm-cmdb-integration feature that lifts the CMDB access gate. Use when the user asks to enable CMDB, turn on the Configuration Management Database, provision the ITOM tenant, enable the CMDB feature, or fix a CMDB 403 FUNCTIONALITY_NOT_ENABLED error. Triggers on: enable CMDB feature, provision ITOM tenant, turn on CMDB, CMDB not enabled, CMDB 403 error, service-cloud-itsm-cmdb-integration. DO NOT TRIGGER when: the user only wants to assign CMDB permission sets to users, only install a CMDB content bundle, or work with CMDB records directly."
4
+ metadata:
5
+ version: "1.0"
6
+ minApiVersion: "67.0"
7
+ relatedSkills:
8
+ - "service-itsm-agentic-setup-cmdb-access-assign"
9
+ - "service-itsm-agentic-setup-cmdb-bundle-deploy"
10
+ mcpTools:
11
+ headless-360:
12
+ tools: ["describe", "discover", "dispatch", "dispatch_readonly"]
13
+ semver: ">=1.0.0"
14
+ accessCheck:
15
+ - type: "orgPerm"
16
+ value: "ITSrvcsCnfgMgmnt"
17
+ allowed-tools: |
18
+ Read AskUserQuestion
19
+ mcp__headless-360__discover
20
+ mcp__headless-360__describe
21
+ mcp__headless-360__dispatch
22
+ mcp__headless-360__dispatch_readonly
23
+ ---
24
+
25
+ # Enable the CMDB Feature (Service Cloud ITSM)
26
+
27
+ Takes an org from "CMDB off" to "CMDB feature enabled" by walking the first three layers of the
28
+ CMDB prerequisite stack in order. Every call runs through the **Salesforce-hosted Headless-360 MCP
29
+ server** (server key `headless-360`) via its four meta-tools (`discover`, `describe`,
30
+ `dispatch_readonly`, `dispatch`). The org is derived from the OAuth JWT bound to the current MCP
31
+ session — the skill never handles an org id, alias, or credentials — so this works identically
32
+ against **production** and sandbox with no per-user MCP install.
33
+
34
+ This skill covers **Layers 0–2**. User access (Layer 3) and content bundles (Layer 4) are separate
35
+ skills — see the end of this file.
36
+
37
+ ## The gate this skill lifts
38
+
39
+ Every CMDB Connect API checks:
40
+
41
+ ```text
42
+ orgHasCMDBEnabled = orgHasCMDBPermission (org perm ITSrvcsCnfgMgmnt) && OrgPreferences.CMDBEnabled
43
+ ```
44
+
45
+ Until `orgHasCMDBEnabled` is true, CMDB APIs return `403 FUNCTIONALITY_NOT_ENABLED`. `CMDBEnabled`
46
+ is NOT a directly settable preference — it is flipped as a side effect of enabling the feature in
47
+ Layer 2. This skill's job is to make that gate return true.
48
+
49
+ > **Necessary but not always sufficient for a given user.** Lifting this org gate does not by itself
50
+ > let a *specific* user read CMDB data. Some CMDB reads (e.g. `bundleListView`) also enforce
51
+ > **user-level** CMDB access and return the same `403 FUNCTIONALITY_NOT_ENABLED` ("not enabled for
52
+ > this user") when the running user holds no CMDB permission sets — even though the feature is
53
+ > correctly ENABLED. That is Layer 3 (`service-itsm-agentic-setup-cmdb-access-assign`), not a failure
54
+ > of this skill. Confirm this skill's success via the feature `status == ENABLED`, never via a CMDB
55
+ > data read.
56
+
57
+ ## Scope
58
+
59
+ - **In scope**: verifying the CMDB org permission (Layer 0), triggering + polling ITOM tenant
60
+ provisioning (Layer 1), pre-checking + enabling + verifying the CMDB feature (Layer 2).
61
+ - **Out of scope**: permission-set assignment (Layer 3 — `service-itsm-agentic-setup-cmdb-access-assign`),
62
+ bundle installation (Layer 4 — `service-itsm-agentic-setup-cmdb-bundle-deploy`), CMDB record CRUD,
63
+ Discovery / Service Graph Connector, identification rules.
64
+
65
+ ## Mechanism
66
+
67
+ All operations dispatch through **headless-360** MCP tools. Reads go through
68
+ `mcp__headless-360__dispatch_readonly`, writes through `mcp__headless-360__dispatch` — both take raw
69
+ HTTP: `{"url": "<path>", "method": "GET|POST", "body"?: {...}, "queryParams"?: {...}}` — **not**
70
+ `{operation_id, arguments}`. See `references/mcp-invocation.md` for the exact `url` / `method` /
71
+ `body` of every call. The four tools:
72
+
73
+ - `mcp__headless-360__discover` — semantic search over the indexed operation catalog. The Setup/Connect
74
+ routes this skill uses are not always ranked first (or indexed), so a miss does **not** mean the
75
+ route is absent — dispatch the exact path directly (see `references/mcp-invocation.md`).
76
+ - `mcp__headless-360__describe` — pull the full input schema and canonical route before any POST.
77
+ - `mcp__headless-360__dispatch_readonly` — the dispatcher for every read (GET).
78
+ - `mcp__headless-360__dispatch` — the dispatcher for every write (POST/PATCH).
79
+
80
+ The skill never handles credentials — the org is bound to the current OAuth session. If a `dispatch*`
81
+ call returns an auth error, tell the user to re-authenticate the headless-360 MCP connection (and
82
+ confirm the session points at the intended org), then stop.
83
+
84
+ ---
85
+
86
+ ## Clarifying questions
87
+
88
+ Ask only what you cannot infer from conversation:
89
+
90
+ - **Which org?** Confirm the target org and state plainly that **this org will be modified**
91
+ (tenant provisioning and feature enable are writes). For production, get explicit confirmation.
92
+
93
+ Do not re-ask for anything the user already provided; pre-populate and note "(from conversation)".
94
+
95
+ ---
96
+
97
+ ## Workflow
98
+
99
+ All steps are sequential and gated — **do not advance past a failed layer.** Always read before you
100
+ write: run the read-only check before every mutation.
101
+
102
+ ### Layer 0 — Verify the CMDB org SKU (read-only, hard gate)
103
+
104
+ CMDB requires the org permission `ITSrvcsCnfgMgmnt`, granted only by edition / license / org
105
+ template. **No API can set it.** The most reliable, universally-available way to verify the org
106
+ carries the CMDB SKU is to probe for the CMDB permission-set license — it exists **only** in orgs
107
+ provisioned with that license:
108
+
109
+ ```text
110
+ dispatch_readonly({ "url": "/services/data/v63.0/query", "method": "GET", "queryParams": { "q": "SELECT Id FROM PermissionSetLicense WHERE DeveloperName = 'ItSrvcCnfgItmReadPsl'" } })
111
+ → totalSize == 1 (licensed) | totalSize == 0 (not licensed)
112
+ ```
113
+
114
+ - **totalSize == 1** → org is CMDB-licensed; proceed to Layer 1.
115
+ - **totalSize == 0** → STOP. Tell the user in plain language (no developer names or API references
116
+ in the message they see):
117
+ > This org isn't licensed for CMDB. CMDB availability is determined by the org's edition or
118
+ > license and can't be turned on through setup — it has to be included when the org is
119
+ > provisioned. Please have the org set up with CMDB (or use one that already has it), then run
120
+ > this again.
121
+
122
+ The core Connect API `GET /services/data/v63.0/setup/org/permissions/ITSrvcsCnfgMgmnt`
123
+ (`{"isPermissionEnabled": true|false}`) is an alternative, but it **404s on some org types
124
+ (including orgfarm test orgs)**, so prefer the PSL probe above. See
125
+ `references/mcp-invocation.md` for the details. If no probe resolves, report that the org perm could
126
+ not be verified and ask the user to confirm the org has CMDB licensed before continuing.
127
+
128
+ ### Layer 1 — Provision the ITOM tenant
129
+
130
+ CMDB runs on an ITOM tenant that must reach status `PROVISIONED` (asynchronous).
131
+
132
+ 1. **Check current status** (read):
133
+ ```text
134
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/tenantProvisioningStatus", "method": "GET" })
135
+ ```
136
+ - If `status` is already `PROVISIONED` → skip to Layer 2.
137
+ 2. **Trigger provisioning** (write) — only if not already provisioned/in-progress. Confirm with the
138
+ user first:
139
+ ```text
140
+ dispatch({ "url": "/services/data/v67.0/connect/tenantProvisioningStatus", "method": "POST" })
141
+ ```
142
+ 3. **Poll** the GET until `status == PROVISIONED`. This is async and can take several minutes. Poll
143
+ **every 30 seconds for up to 10 minutes** (≈20 attempts). Tell the user provisioning is in
144
+ progress on each poll. Exit the loop as soon as:
145
+ - `status == PROVISIONED` → success, advance to Layer 2.
146
+ - `status == FAILED` → stop immediately. Do NOT retry via the API — surface the failure to the
147
+ user in plain language with three things:
148
+ 1. **The failure reason, decoded to human-readable text.** Read it from the response body (the
149
+ FAILED payload carries a detail field such as `error` / `failureReason` / `message` —
150
+ unescape any HTML entities like `&lt;`/`&gt;` and strip markup). If the response carries no
151
+ detail, say the tenant provisioning failed without a returned reason.
152
+ 2. **A link to the org's tenant provisioning Setup page**, built from the target org's instance
153
+ URL: `<org instance URL>/lightning/setup/CMDBProvisionalSettings/home`.
154
+ 3. **Ask the user to open that page and try provisioning manually**, then re-run this skill once
155
+ the tenant shows `PROVISIONED`. Only if the manual retry also fails does it need Salesforce
156
+ support.
157
+ - the 10-minute window elapses → stop, report the last-seen status, and let the user decide
158
+ whether to keep waiting (re-run) or investigate. Never spin past the 10-minute bound.
159
+
160
+ ### Layer 2 — Enable the CMDB feature (this lifts the 403 gate)
161
+
162
+ The feature api name is `service-cloud-itsm-cmdb-integration`.
163
+
164
+ 1. **Pre-check status** (read):
165
+ ```text
166
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/status", "method": "GET" })
167
+ ```
168
+ - `status == ENABLED` → already done; skip to verification.
169
+ - `status == NOT_ENABLED` with `enableBlockedReasons: []` → clear to enable.
170
+ - `enableBlockedReasons` non-empty → STOP and relay each reason to the user in plain language
171
+ (these are prerequisites the org still needs — do not attempt the enable).
172
+ 2. **Confirm with the user**, then **enable** (write):
173
+ ```text
174
+ dispatch({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/enable", "method": "POST", "body": {} })
175
+ → {"success": true}
176
+ ```
177
+ 3. **Verify** (read) — do NOT trust the POST response alone:
178
+ ```text
179
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/status", "method": "GET" })
180
+ → expect status == ENABLED
181
+ ```
182
+ **`status == ENABLED` is the definitive — and only — confirmation this skill needs.** Layer 2
183
+ succeeds or fails on this check alone; it does **not** perform any CMDB data read to confirm the
184
+ gate. A CMDB data read (e.g. `bundleListView`) also depends on the *running user's* own CMDB
185
+ access, so it cannot cleanly confirm the org-level enable — see the note under "The gate this
186
+ skill lifts". Once the feature shows `ENABLED`, Layer 2 is done.
187
+
188
+ ---
189
+
190
+ ## Rules / Constraints
191
+
192
+ | Constraint | Rationale |
193
+ |-----------|-----------|
194
+ | Verify Layer 0 before anything else | If `ITSrvcsCnfgMgmnt` is off, no later step can succeed — fail fast with a clear message |
195
+ | Never try to set `ITSrvcsCnfgMgmnt` via API | There is no setter; it is license/edition/template only |
196
+ | Never set `CMDBEnabled` directly (e.g. via `updateDefaultOrgPrefs`) | It is not in any settable-pref allowlist; the server rejects it with 500. It flips only as a side effect of the Layer 2 feature enable |
197
+ | Read before every write; verify after every write | Tenant + feature are async/stateful; the POST response can lag the real state |
198
+ | Confirm the target org and each write with the user | These are real, hard-to-reverse changes on a live org |
199
+ | Do not advance past a failed or blocked layer | Later layers depend on earlier ones and will 403 |
200
+ | Poll tenant provisioning every 30s for up to 10 min (≈20 attempts) | It is async; never spin past the 10-min bound — exit on PROVISIONED/FAILED, else report status and let the user decide |
201
+ | On `FAILED`, never retry via API — decode the reason, give the Setup URL, ask for a manual retry | The API trigger has already failed; the user can retry from the CMDB provisioning Setup page, which surfaces the real error and any manual remediation |
202
+ | Never expose internal jargon to the user | Keep record IDs, org IDs, HTTP status codes (403/500/…), API error codes (`FUNCTIONALITY_NOT_ENABLED`, …), endpoint names (`bundleListView`, `tenantProvisioningStatus`), developer names (`ITSrvcsCnfgMgmnt`, `CMDBEnabled`), and tooling internals (`dispatch`, `headless-360`) out of user-facing output. Translate to plain language; use human-readable names and statuses |
203
+
204
+ ---
205
+
206
+ ## Verification checklist
207
+
208
+ - [ ] Layer 0: `ITSrvcsCnfgMgmnt` confirmed `true` (or stopped with a clear license message)?
209
+ - [ ] Layer 1: tenant `status == PROVISIONED`?
210
+ - [ ] Layer 2: pre-check showed `enableBlockedReasons: []` before enabling?
211
+ - [ ] Layer 2: enable returned `success: true`?
212
+ - [ ] Layer 2: verification GET shows `status == ENABLED`? **(this is the sole success criterion — no CMDB data read is used to confirm)**
213
+ - [ ] Confirmed the target org and each write with the user first?
214
+
215
+ ---
216
+
217
+ ## Output expectations
218
+
219
+ ```text
220
+ CMDB Feature Enable — Complete (via service-itsm-agentic-setup-cmdb-configure)
221
+
222
+ Target org: <org>
223
+
224
+ CMDB license .................. Present
225
+ ITOM tenant ................... Provisioned
226
+ CMDB feature .................. Enabled
227
+
228
+ CMDB is now enabled on this org. Next steps:
229
+ • Assign user access → service-itsm-agentic-setup-cmdb-access-assign
230
+ • Install base bundle → service-itsm-agentic-setup-cmdb-bundle-deploy
231
+ ```
232
+
233
+ Keep internal jargon out of user-facing output (no record IDs, HTTP status codes, error codes,
234
+ endpoint or developer names). If any step fails, stop and tell the user — in plain language — which
235
+ part of setup didn't succeed and what it means for them, then point to the relevant fix. Translate
236
+ any raw error (e.g. a 403 or `FUNCTIONALITY_NOT_ENABLED`) into what it means ("CMDB isn't enabled
237
+ yet"), rather than echoing the code.
238
+
239
+ ---
240
+
241
+ ## Common failures (surface these in plain language)
242
+
243
+ | Symptom | Likely cause | What to tell the user |
244
+ |---------|--------------|-----------------------|
245
+ | Layer 0 returns `false` | Org lacks the CMDB SKU | License/edition prerequisite — no API can grant it; provision the org with CMDB |
246
+ | `403 FUNCTIONALITY_NOT_ENABLED` on CMDB reads **while feature `status != ENABLED`** | Feature not yet enabled (Layer 2 incomplete) | Finish Layer 2; the gate lifts only after the feature is ENABLED |
247
+ | `403 FUNCTIONALITY_NOT_ENABLED` on `bundleListView` **while feature `status == ENABLED`** | Feature IS enabled; the running user lacks CMDB permission sets (`bundleListView` also enforces user-level access) | Not a Layer 2 failure — this is Layer 3; run `service-itsm-agentic-setup-cmdb-access-assign` to grant the user CMDB access |
248
+ | Feature enable blocked (`enableBlockedReasons` non-empty) | Missing dependency the org still needs | Relay each reason; resolve those first, then retry |
249
+ | Tenant stuck `NOT_PROVISIONED` / long-running | Provisioning is async | It can take minutes; keep polling or retry the trigger |
250
+ | Tenant `FAILED` | Provisioning job failed Salesforce-side | Share the decoded failure reason + the org's `/lightning/setup/CMDBProvisionalSettings/home` link and ask the user to retry provisioning manually there; escalate to Salesforce support only if the manual retry also fails |
251
+ | `dispatch*` auth error | headless-360 MCP session not authenticated / token expired | Re-authenticate the headless-360 MCP connection and confirm the session points at the intended org |
252
+
253
+ ---
254
+
255
+ ## Reference file index
256
+
257
+ | File | When to read |
258
+ |------|--------------|
259
+ | `references/mcp-invocation.md` | Exact `dispatch*` url/method/body for every Layer 0–2 call, response envelopes, and error table |
@@ -0,0 +1,188 @@
1
+ # MCP Invocation Reference — CMDB Feature Enable (Layers 0–2)
2
+
3
+ Every operation dispatches through the **Salesforce-hosted `headless-360`** MCP server, which exposes
4
+ four meta-tools:
5
+
6
+ - `mcp__headless-360__discover(query)` — semantic search over the indexed operation catalog
7
+ - `mcp__headless-360__describe(id)` — pull the schema and canonical route for one operation
8
+ - `mcp__headless-360__dispatch_readonly({url, method, queryParams?, body?})` — GET / read-only HTTP
9
+ - `mcp__headless-360__dispatch({url, method, body?, queryParams?})` — POST / PATCH / DELETE HTTP
10
+
11
+ **Dispatch takes raw HTTP**, not `{operation_id, arguments}`. Give it the full `url`
12
+ (`/services/data/v67.0/...`), `method`, optional `body`, and optional `queryParams` (camelCase — the
13
+ tool rejects `query_params`) — the server signs the request with the JWT bound to the current MCP
14
+ session and forwards it to the org. The skill never handles credentials or an org alias — everything
15
+ is derived from the session.
16
+
17
+ **A `discover` miss does NOT mean the route is absent.** The Setup / Connect API routes this skill
18
+ uses (`/connect/setup/discovery/feature/.../status`, `/connect/tenantProvisioningStatus`, the
19
+ `/setup/org/permissions/...` and PSL-query paths) are documented core Connect APIs but are **not
20
+ always ranked first (or indexed)** in the discovery corpus — `discover` may return nothing, or only
21
+ tangential specs, for them. That is not a signal they don't exist. Dispatch on the exact path
22
+ directly; only if the GET/POST itself returns 404 should you treat the route as unavailable on this
23
+ org.
24
+
25
+ ## Response envelope
26
+
27
+ The `dispatch*` tool returns the HTTP status plus the parsed body, e.g.:
28
+
29
+ ```json
30
+ { "status_code": 200, "body": { "isPermissionEnabled": true } }
31
+ ```
32
+
33
+ Read the relevant field from `body`. Status codes: `200/201` success; `400` bad body (re-check
34
+ schema via `describe`); `403 FUNCTIONALITY_NOT_ENABLED` the CMDB gate is still closed (finish
35
+ Layer 2); `404` the endpoint/impl is not present on this org; `500` a downstream dependency issue.
36
+
37
+ ---
38
+
39
+ ## Layer 0 — Verify the CMDB org SKU (read-only, hard gate)
40
+
41
+ **Preferred: probe for the CMDB permission-set license (works on every org type, including
42
+ orgfarm/sandbox).** The PSL `ItSrvcCnfgItmReadPsl` exists in an org **only if that org carries the
43
+ CMDB SKU** — it is provisioned by the same license/edition that grants `ITSrvcsCnfgMgmnt`. Querying
44
+ for it is a reliable, universally-available Layer 0 signal (and it is the exact check the
45
+ `service-itsm-agentic-setup-cmdb-access-assign` skill already relies on):
46
+
47
+ ```text
48
+ dispatch_readonly({
49
+ "url": "/services/data/v63.0/query",
50
+ "method": "GET",
51
+ "queryParams": { "q": "SELECT Id, DeveloperName, MasterLabel FROM PermissionSetLicense WHERE DeveloperName = 'ItSrvcCnfgItmReadPsl'" }
52
+ })
53
+ ```
54
+
55
+ - `totalSize == 1` → org is CMDB-licensed; proceed to Layer 1.
56
+ - `totalSize == 0` → STOP. This is a license/edition prerequisite. No API can grant the CMDB SKU.
57
+
58
+ **Fallback: the core org-permission Connect API** (only where it is present — it **404s on some
59
+ org types, including orgfarm test orgs**, so it is not the primary check):
60
+
61
+ ```text
62
+ dispatch_readonly({
63
+ "url": "/services/data/v63.0/setup/org/permissions/ITSrvcsCnfgMgmnt",
64
+ "method": "GET"
65
+ })
66
+ ```
67
+
68
+ Response: `{"isPermissionEnabled": true|false}`. `true` → Layer 1; `false`/404 → rely on the preferred
69
+ PSL probe above. If no probe resolves, report that the org perm could not be verified and ask the
70
+ user to confirm CMDB is licensed before proceeding.
71
+
72
+ > A useful cross-check regardless of which probe you use: a `GET` on the Layer 2 feature-status
73
+ > endpoint that returns `200` (rather than `403 FUNCTIONALITY_NOT_ENABLED`) is itself evidence the
74
+ > org carries the CMDB surface.
75
+
76
+ ---
77
+
78
+ ## Layer 1 — Provision the ITOM tenant
79
+
80
+ ### Check current provisioning status (read)
81
+
82
+ ```text
83
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/tenantProvisioningStatus", "method": "GET" })
84
+ ```
85
+
86
+ Response includes `status` (e.g. `NOT_PROVISIONED`, `IN_PROGRESS`, `PROVISIONED`, `FAILED`),
87
+ `triggeredAt`, `callbackReceivedAt`. If `status == PROVISIONED`, skip to Layer 2.
88
+
89
+ ### Trigger provisioning (write — confirm with the user first)
90
+
91
+ ```text
92
+ dispatch({ "url": "/services/data/v67.0/connect/tenantProvisioningStatus", "method": "POST" })
93
+ ```
94
+
95
+ No request body. Response echoes the status object. Provisioning is **asynchronous** — the callback
96
+ arrives later.
97
+
98
+ ### Poll until PROVISIONED
99
+
100
+ Re-issue the GET above **every 30 seconds for up to 10 minutes** (≈20 attempts). Exit the loop on:
101
+
102
+ - `status == PROVISIONED` → success; advance to Layer 2.
103
+ - `status == FAILED` → stop. Do NOT retry via the API. Surface to the user, in plain language:
104
+ 1. **The decoded failure reason** — read the detail field from the FAILED response body (e.g.
105
+ `error` / `failureReason` / `message`), unescape HTML entities (`&lt;` → `<`, `&gt;` → `>`,
106
+ `&quot;` → `"`, `&amp;` → `&`) and strip any `<a>`/markup so the text is readable. If no detail
107
+ is present, say the tenant provisioning failed without a returned reason.
108
+ 2. **The org's tenant provisioning Setup page URL**: `<org instance URL>/lightning/setup/CMDBProvisionalSettings/home`
109
+ (this is the same page the Layer 2 `enableBlockedReasons` `CMDB_NOT_PROVISIONED` message links to).
110
+ 3. **Ask the user to provision manually from that page**, then re-run this skill once the tenant
111
+ reads `PROVISIONED`. Escalate to Salesforce support only if the manual retry also fails.
112
+ - 10-minute window elapsed → stop, report the last-seen status, let the user decide whether to
113
+ keep waiting or investigate.
114
+
115
+ Never spin past the 10-minute bound. Report progress to the user on each poll.
116
+
117
+ ---
118
+
119
+ ## Layer 2 — Enable the CMDB feature
120
+
121
+ Feature api name: `service-cloud-itsm-cmdb-integration`.
122
+
123
+ ### Pre-check feature status (read)
124
+
125
+ ```text
126
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/status", "method": "GET" })
127
+ ```
128
+
129
+ Response: `{ apiName, status, enableBlockedReasons: [...], disableBlockedReasons: [...],
130
+ dependencyStatuses: [...], blockedByApexLock }`.
131
+
132
+ - `status == ENABLED` → already enabled; skip to verify.
133
+ - `status == NOT_ENABLED` and `enableBlockedReasons` is empty → clear to enable.
134
+ - `enableBlockedReasons` non-empty → STOP; relay each reason. Do not attempt the enable.
135
+
136
+ ### Enable the feature (write — confirm with the user first)
137
+
138
+ ```text
139
+ dispatch({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/enable", "method": "POST", "body": {} })
140
+ ```
141
+
142
+ Response: `{"success": true}`. The optional query param `solutionApiName` is not needed — omit it.
143
+
144
+ ### Verify (read — do not trust the POST response alone)
145
+
146
+ ```text
147
+ dispatch_readonly({ "url": "/services/data/v67.0/connect/setup/discovery/feature/service-cloud-itsm-cmdb-integration/status", "method": "GET" })
148
+ ```
149
+
150
+ Expect `status == ENABLED`. This is the definitive — and only — confirmation the skill needs.
151
+ Do NOT perform a CMDB data read (e.g. `bundleListView`) to confirm the gate: that read also
152
+ enforces the *running user's* CMDB access, so it can 403 even when the feature is correctly
153
+ ENABLED (that is Layer 3, `service-itsm-agentic-setup-cmdb-access-assign`, not a failure here).
154
+
155
+ ---
156
+
157
+ ## Idempotency
158
+
159
+ - Layer 0 is read-only — safe to repeat.
160
+ - Layer 1: if already `PROVISIONED`, do not re-trigger; the GET is safe to repeat.
161
+ - Layer 2: if `status == ENABLED`, do not re-POST; enabling an already-enabled feature is
162
+ unnecessary. Always pre-check.
163
+
164
+ ---
165
+
166
+ ## Dead ends — do NOT do these
167
+
168
+ - **Do NOT:** use `updateDefaultOrgPrefs` / `ItServiceSetupController` with pref `CMDBEnabled` —
169
+ rejected with `500 Unknown preference name`. `CMDBEnabled` is not a settable pref; it flips only
170
+ as a side effect of the Layer 2 feature enable.
171
+ - **Do NOT:** treat `tenantProvisioningStatus` as the feature toggle — provisioning is necessary
172
+ infra (Layer 1) but does NOT set `CMDBEnabled`. An org can be `PROVISIONED` and still 403 until
173
+ Layer 2.
174
+ - **Do NOT:** try to grant `ITSrvcsCnfgMgmnt` via any API — no setter exists.
175
+
176
+ ---
177
+
178
+ ## Error table
179
+
180
+ | Status | Meaning | Resolution |
181
+ |--------|---------|------------|
182
+ | 403 `FUNCTIONALITY_NOT_ENABLED` | CMDB gate still closed | Finish Layer 2; verify `status == ENABLED` |
183
+ | 404 on `/setup/org/permissions/...` | Endpoint not on this org | Rely on the preferred PSL-query probe (Layer 0) |
184
+ | 404 on `/connect/...` CMDB paths | Impl/dispatcher not present on this org | Confirm the org type; CMDB core APIs require a real (non-scratch-stub) org |
185
+ | 400 on feature enable | Wrong body/shape | Body is `{}`; re-confirm the path via `describe` |
186
+ | Tenant `status == FAILED` | Provisioning job failed Salesforce-side | Do NOT retry via API. Decode the reason from the body, give the user `<org instance URL>/lightning/setup/CMDBProvisionalSettings/home`, and ask them to provision manually; support only if that also fails |
187
+ | 500 | Downstream dependency missing | Retry; if persistent, needs Salesforce support |
188
+ | Auth error | headless-360 MCP session not authenticated / token expired | Re-authenticate the headless-360 MCP connection; confirm the session points at the intended org |