@umbraco-automate/mcp 17.6.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.
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/dist/collections.js +4545 -0
- package/dist/collections.js.map +1 -0
- package/dist/index.js +4755 -0
- package/dist/index.js.map +1 -0
- package/dist/tool-types.d.ts +2088 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/load-env.ts","../package.json","../src/umbraco-api/api/client.ts","../src/umbraco-api/api/generated/umbracoAutomateManagementApi.ts","../src/umbraco-api/tools/umbraco-server/get/get-server-info.ts","../src/umbraco-api/tools/umbraco-server/index.ts","../src/umbraco-api/api/generated/umbracoAutomateManagementApi.zod.ts","../src/umbraco-api/tools/approvals/get/list-pending-approvals.ts","../src/umbraco-api/tools/approvals/post/decide-approval-step.ts","../src/umbraco-api/tools/approvals/index.ts","../src/umbraco-api/tools/automations/get/list-automations.ts","../src/umbraco-api/tools/automations/get/get-automation.ts","../src/umbraco-api/tools/automations/get/get-automation-ancestors.ts","../src/umbraco-api/tools/automations/get/export-automation.ts","../src/umbraco-api/tools/automations/get/list-automation-runs.ts","../src/config/umbraco-base-url.ts","../src/umbraco-api/tools/automations/_shared/automate-version.ts","../src/umbraco-api/tools/automations/get/get-automation-webhook-url.ts","../src/umbraco-api/tools/automations/get/get-automation-group.ts","../src/umbraco-api/tools/automations/post/create-automation.ts","../src/umbraco-api/tools/automations/post/publish-automation.ts","../src/umbraco-api/tools/automations/post/unpublish-automation.ts","../src/umbraco-api/tools/automations/post/re-enable-automation.ts","../src/umbraco-api/tools/automations/post/trigger-automation.ts","../src/umbraco-api/tools/automations/post/import-automation.ts","../src/umbraco-api/tools/automations/post/validate-automation-import.ts","../src/umbraco-api/tools/automations/_shared/step-outputs.ts","../src/umbraco-api/tools/automations/_shared/canvas-layout.ts","../src/umbraco-api/tools/automations/_shared/automation-graph.ts","../src/umbraco-api/tools/automations/_shared/step-settings.ts","../src/umbraco-api/tools/automations/_shared/settings-keys.ts","../src/umbraco-api/tools/automations/post/add-automation-step.ts","../src/umbraco-api/tools/automations/post/connect-automation-steps.ts","../src/umbraco-api/tools/automations/put/update-automation.ts","../src/umbraco-api/tools/automations/put/import-automation-into-existing.ts","../src/umbraco-api/tools/automations/put/update-automation-step.ts","../src/umbraco-api/tools/automations/put/set-automation-trigger.ts","../src/umbraco-api/tools/automations/delete/delete-automation.ts","../src/umbraco-api/tools/automations/delete/remove-automation-step.ts","../src/umbraco-api/tools/automations/delete/disconnect-automation-steps.ts","../src/umbraco-api/tools/automations/index.ts","../src/umbraco-api/tools/catalogue/get/list-actions.ts","../src/umbraco-api/tools/catalogue/get/list-connection-types.ts","../src/umbraco-api/tools/catalogue/get/list-control-flows.ts","../src/umbraco-api/tools/catalogue/get/list-notification-channels.ts","../src/umbraco-api/tools/catalogue/get/list-step-types.ts","../src/umbraco-api/tools/catalogue/get/list-triggers.ts","../src/umbraco-api/tools/catalogue/get/list-webhook-authenticators.ts","../src/umbraco-api/tools/catalogue/post/resolve-step-type-output-schema.ts","../src/umbraco-api/tools/catalogue/index.ts","../src/umbraco-api/tools/connections/get/list-connections.ts","../src/umbraco-api/tools/connections/get/get-connection.ts","../src/umbraco-api/tools/connections/post/create-connection.ts","../src/umbraco-api/tools/connections/post/test-connection.ts","../src/umbraco-api/tools/connections/put/update-connection.ts","../src/umbraco-api/tools/connections/delete/delete-connection.ts","../src/umbraco-api/tools/connections/index.ts","../src/umbraco-api/tools/metrics/get/get-metrics.ts","../src/umbraco-api/tools/metrics/get/get-metrics-by-automation.ts","../src/umbraco-api/tools/metrics/index.ts","../src/umbraco-api/tools/runs/get/list-runs.ts","../src/umbraco-api/tools/runs/get/get-run-by-id.ts","../src/umbraco-api/tools/runs/post/replay-run.ts","../src/umbraco-api/tools/runs/post/resume-run.ts","../src/umbraco-api/tools/runs/post/suspend-run.ts","../src/umbraco-api/tools/runs/post/terminate-run.ts","../src/umbraco-api/tools/runs/index.ts","../src/umbraco-api/tools/version-history/get/list-version-history-supported-types.ts","../src/umbraco-api/tools/version-history/get/list-version-history.ts","../src/umbraco-api/tools/version-history/get/get-version-history-entry.ts","../src/umbraco-api/tools/version-history/get/compare-version-history.ts","../src/umbraco-api/tools/version-history/post/rollback-version-history.ts","../src/umbraco-api/tools/version-history/index.ts","../src/umbraco-api/tools/workspaces/get/list-workspaces.ts","../src/umbraco-api/tools/workspaces/get/get-workspace.ts","../src/umbraco-api/tools/workspaces/get/list-workspace-groups.ts","../src/umbraco-api/tools/workspaces/get/get-workspace-group.ts","../src/umbraco-api/tools/workspaces/post/create-workspace.ts","../src/umbraco-api/tools/workspaces/post/create-workspace-group.ts","../src/umbraco-api/tools/workspaces/put/update-workspace.ts","../src/umbraco-api/tools/workspaces/put/update-workspace-group.ts","../src/umbraco-api/tools/workspaces/delete/delete-workspace.ts","../src/umbraco-api/tools/workspaces/delete/delete-workspace-group.ts","../src/umbraco-api/tools/workspaces/index.ts","../src/umbraco-api/tools/lenient-output-schemas.ts","../src/config/mcp-servers.ts","../src/umbraco-api/mcp-client.ts","../src/config/slice-registry.ts","../src/config/mode-registry.ts","../src/config/server-config.ts","../src/config/umbraco-target.generated.ts","../src/index.ts"],"names":["config","UmbracoManagementClient","CAPTURE_RAW_HTTP_RESPONSE","withStandardDecorators","collection","inputSchema","executeGetApiCall","outputSchema","z","executeGetItemsApiCall","baseUrl","createToolResult","path","getApiClient","executeVoidApiCall","APPROVAL_ALIAS","CONTAINER_ALIASES","SWITCH_ALIAS","width","c","boxes","centre","UmbracoApiError","ToolValidationError","TRIGGER_STEP_ID","unknown","errorBehaviors","createToolResultError","__filename","__dirname","SERVER_INFORMATION_PATH"],"mappings":";;;;;;;;;;;AAiBA,MAAA,CAAO,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA;;;ACjBtB,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAqFb,CAAA;ACxDO,IAAM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,GAAY,IAAI,oBAAA,EAAqB;AAC3C,EAAA,MAAM,MAAA,CAAO,QAAQ,SAAS,CAAA;AAC9B,EAAA,OAAA,CAAQ,MAAM,CAAA,wBAAA,EAA2B,mBAAmB,CAAA,cAAA,EAAiB,WAAA,CAAY,MAAM,CAAA,cAAA,CAAgB,CAAA;AACjH;AAGA,OAAA,CAAQ,EAAA,CAAG,UAAU,YAAY;AAC/B,EAAA,MAAM,iBAAiB,aAAA,EAAc;AACrC,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA;AAED,OAAA,CAAQ,EAAA,CAAG,WAAW,YAAY;AAChC,EAAA,MAAM,iBAAiB,aAAA,EAAc;AACrC,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA;AAED,IAAA,EAAK,CAAE,KAAA,CAAM,CAAC,KAAA,KAAU;AACtB,EAAA,OAAA,CAAQ,KAAA,CAAM,+BAA+B,KAAK,CAAA;AAClD,EAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA","file":"index.js","sourcesContent":["/**\n * Loads .env quietly.\n *\n * dotenv 17 prints a banner to stdout when it loads (e.g.\n * \"◇ injected env (0) from .env\"). This server's stdout carries MCP protocol\n * traffic on stdio, and the CLI's introspection commands (--describe-tool,\n * --debug-config) emit machine-readable JSON, so anything extra on stdout\n * corrupts them.\n *\n * `import \"dotenv/config\"` cannot be passed options — it only reads\n * DOTENV_CONFIG_QUIET from the environment, which can't be set before its own\n * import. Importing this module instead keeps the same load ordering (ESM\n * evaluates imported modules before the importing module's body) while\n * silencing the banner.\n */\nimport { config } from \"dotenv\";\n\nconfig({ quiet: true });\n","{\n \"name\": \"@umbraco-automate/mcp\",\n \"version\": \"17.6.0\",\n \"type\": \"module\",\n \"description\": \"MCP server for automate\",\n \"main\": \"dist/index.js\",\n \"exports\": {\n \".\": \"./dist/index.js\",\n \"./collections\": \"./dist/collections.js\",\n \"./tool-types\": {\n \"types\": \"./dist/tool-types.d.ts\"\n }\n },\n \"bin\": {\n \"automate-mcp-server\": \"./dist/index.js\"\n },\n \"scripts\": {\n \"clean\": \"rimraf dist\",\n \"build\": \"tsup --config tsup.config.ts\",\n \"postbuild\": \"umbraco-mcp-generate-types\",\n \"compile\": \"tsc --noEmit\",\n \"watch\": \"tsup --config tsup.config.ts --watch\",\n \"generate\": \"orval --config orval.config.ts\",\n \"start:umbraco\": \"bash scripts/start-umbraco.sh\",\n \"create-api-user\": \"node scripts/create-api-user.mjs\",\n \"inspect\": \"npx @modelcontextprotocol/inspector node dist/index.js\",\n \"test\": \"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand\",\n \"test:rerun-failures\": \"node scripts/rerun-failures.mjs\",\n \"test:changed\": \"node scripts/test-changed.mjs\",\n \"test:evals\": \"npm run build && node scripts/run-evals-isolated.mjs\",\n \"test:all\": \"npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPatterns=__tests__ --runInBand --forceExit && node scripts/run-evals-isolated.mjs\",\n \"test:e2e\": \"npx playwright test --config tests/hosted-e2e/playwright.config.ts\",\n \"dev:worker\": \"npx wrangler dev\",\n \"deploy:worker\": \"npx wrangler deploy\"\n },\n \"engines\": {\n \"node\": \"^22.23.4 || ^24.22.1 || >=26.12.1\"\n },\n \"files\": [\n \"dist\"\n ],\n \"keywords\": [\n \"Umbraco\",\n \"MCP\",\n \"Model Context Protocol\"\n ],\n \"author\": \"\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@cloudflare/workers-oauth-provider\": \"^0.8.1\",\n \"@modelcontextprotocol/sdk\": \"^1.32.1\",\n \"@umbraco-cms/mcp-hosted\": \"1.0.0-beta.48\",\n \"@umbraco-cms/mcp-server-sdk\": \"1.0.0-beta.48\",\n \"agents\": \"^0.6.0\",\n \"dotenv\": \"^17.4.2\",\n \"yargs\": \"^18.0.0\",\n \"zod\": \"^4.4.3\"\n },\n \"devDependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"^0.3.191\",\n \"@cloudflare/workers-types\": \"^5.20260908.1\",\n \"@jest/types\": \"^29.6.3\",\n \"@playwright/test\": \"^1.61.1\",\n \"@types/jest\": \"^30.0.0\",\n \"@types/node\": \"^26.1.2\",\n \"@types/yargs\": \"^17.0.33\",\n \"jest\": \"^30.4.2\",\n \"orval\": \"^8.19.0\",\n \"rimraf\": \"^6.1.3\",\n \"ts-jest\": \"^29.4.11\",\n \"ts-node\": \"^10.9.2\",\n \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.8.3\",\n \"undici\": \"^8.9.0\",\n \"wrangler\": \"^4.104.0\"\n },\n \"allowScripts\": {\n \"@parcel/watcher@2.6.0\": true,\n \"core-js-pure@3.50.0\": true,\n \"esbuild@0.28.2\": true,\n \"esbuild@0.27.7\": true,\n \"esbuild@0.28.1\": true,\n \"msw@2.15.0\": true,\n \"unrs-resolver@1.12.2\": true,\n \"workerd@1.20260907.1\": true,\n \"fsevents@2.3.3\": true\n }\n}\n","/**\n * API Client Configuration\n *\n * This file sets up the HTTP client used by generated API code (the Orval\n * `mutator` configured in orval.config.ts - every generated method in\n * src/umbraco-api/api/generated/*.ts calls `customInstance` directly).\n *\n * Delegates to the SDK's UmbracoManagementClient for all real API calls.\n * Integration and eval tests both run against the real Umbraco instance\n * (see .env / tests/evals/helpers/e2e-setup.ts) rather than a mocked one.\n */\n\nimport {\n UmbracoManagementClient,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\n\ninterface RequestConfig {\n method?: string;\n url?: string;\n data?: unknown;\n params?: Record<string, unknown>;\n headers?: Record<string, string>;\n [key: string]: unknown;\n}\n\n/**\n * Custom fetch-based instance for API calls. Used by Orval-generated code.\n * Delegates to the SDK's UmbracoManagementClient, which handles auth and\n * the real HTTP request/response cycle.\n */\nexport const customInstance = async <T>(\n config: RequestConfig,\n options?: RequestConfig\n): Promise<HttpResponse<T> | T> => {\n const mergedConfig = { ...config, ...options };\n return UmbracoManagementClient<T>(mergedConfig as any, mergedConfig as any);\n};\n\nexport default customInstance;\n\n/**\n * Pass this as the options parameter to capture the full HTTP response\n * instead of just the response data.\n */\nexport const CAPTURE_RAW_HTTP_RESPONSE = { returnFullResponse: true };\n","/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Umbraco Automate Management API\n * Describes the Umbraco Automate Management API available for managing automations, triggers, actions, and runs when authenticated as a backoffice user.\n * OpenAPI spec version: Latest\n */\nimport { customInstance } from '../client.js';\n/**\n * @nullable\n */\nexport type ActionItemResponseModelOutputSchema = {[key: string]: unknown | null} | null;\n\nexport type EditableModelValueKindModel = typeof EditableModelValueKindModel[keyof typeof EditableModelValueKindModel];\n\n\nexport const EditableModelValueKindModel = {\n String: 'String',\n Scalar: 'Scalar',\n Collection: 'Collection',\n} as const;\n\nexport interface EditableModelFieldVisibilityModel {\n key: string;\n values: string[];\n}\n\nexport interface EditableModelFieldDescriptorModel {\n /** @minLength 1 */\n key: string;\n label: string;\n /** @nullable */\n description?: string | null;\n valueKind: EditableModelValueKindModel;\n /** @nullable */\n editorUiAlias?: string | null;\n /** @nullable */\n editorConfig?: string | null;\n defaultValue?: unknown | null;\n sortOrder: number;\n isSensitive: boolean;\n isRequired: boolean;\n /** @nullable */\n group?: string | null;\n supportsBindings: boolean;\n visibleWhen?: EditableModelFieldVisibilityModel | null;\n}\n\nexport interface EditableModelSchemaModel {\n fields: EditableModelFieldDescriptorModel[];\n}\n\nexport interface StepOutcomeResponseModel {\n /** @minLength 1 */\n key: string;\n /** @minLength 1 */\n label: string;\n isDefault: boolean;\n /** @nullable */\n description?: string | null;\n}\n\nexport interface ActionItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n group?: string | null;\n /** @nullable */\n icon?: string | null;\n /** @nullable */\n connectionTypeAlias?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n /** @nullable */\n outputSchema?: ActionItemResponseModelOutputSchema;\n hasDynamicOutputSchema: boolean;\n outcomes: StepOutcomeResponseModel[];\n hasDynamicOutcomes: boolean;\n /** @minLength 1 */\n type: string;\n}\n\nexport type ActionLogLevelModel = typeof ActionLogLevelModel[keyof typeof ActionLogLevelModel];\n\n\nexport const ActionLogLevelModel = {\n Debug: 'Debug',\n Info: 'Info',\n Warning: 'Warning',\n Error: 'Error',\n} as const;\n\nexport type ApprovalOutcomeModel = typeof ApprovalOutcomeModel[keyof typeof ApprovalOutcomeModel];\n\n\nexport const ApprovalOutcomeModel = {\n Approved: 'Approved',\n Rejected: 'Rejected',\n} as const;\n\nexport interface ApprovalDecisionRequestModel {\n outcome: ApprovalOutcomeModel;\n /** @nullable */\n comment?: string | null;\n}\n\nexport interface AutomationAncestorResponseModel {\n id: string;\n /** @minLength 1 */\n entityType: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n parentId?: string | null;\n /** @nullable */\n parentEntityType?: string | null;\n hasChildren: boolean;\n isFolder: boolean;\n}\n\nexport type TriggerConfigurationModelSettings = {[key: string]: unknown | null};\n\nexport interface TriggerConfigurationModel {\n triggerAlias: string;\n settings: TriggerConfigurationModelSettings;\n}\n\nexport interface StepPositionModel {\n x: number;\n y: number;\n}\n\nexport type StepErrorBehaviorModel = typeof StepErrorBehaviorModel[keyof typeof StepErrorBehaviorModel];\n\n\nexport const StepErrorBehaviorModel = {\n Retry: 'Retry',\n Suspend: 'Suspend',\n Terminate: 'Terminate',\n Compensate: 'Compensate',\n} as const;\n\nexport type ExportStepModelSettings = {[key: string]: unknown | null};\n\nexport type ExportStepModelInputMappings = {[key: string]: string};\n\nexport interface ExportStepModel {\n id: string;\n actionAlias: string;\n name: string;\n /** @nullable */\n alias?: string | null;\n /** @nullable */\n connectionAlias?: string | null;\n settings: ExportStepModelSettings;\n inputMappings: ExportStepModelInputMappings;\n position: StepPositionModel;\n errorBehavior: StepErrorBehaviorModel;\n /** @nullable */\n retryInterval?: string | null;\n /** @nullable */\n maxRetries?: number | null;\n}\n\nexport type ConditionOperatorModel = typeof ConditionOperatorModel[keyof typeof ConditionOperatorModel];\n\n\nexport const ConditionOperatorModel = {\n Equals: 'Equals',\n NotEquals: 'NotEquals',\n Contains: 'Contains',\n NotContains: 'NotContains',\n StartsWith: 'StartsWith',\n EndsWith: 'EndsWith',\n GreaterThan: 'GreaterThan',\n LessThan: 'LessThan',\n GreaterThanOrEquals: 'GreaterThanOrEquals',\n LessThanOrEquals: 'LessThanOrEquals',\n IsEmpty: 'IsEmpty',\n IsNotEmpty: 'IsNotEmpty',\n} as const;\n\nexport interface ConditionModel {\n leftOperand: string;\n operator: ConditionOperatorModel;\n rightOperand: string;\n}\n\nexport interface ConditionGroupModel {\n conditions: ConditionModel[];\n}\n\nexport interface ConditionSetModel {\n groups: ConditionGroupModel[];\n}\n\nexport interface StepConnectionModel {\n sourceStepId: string;\n /** @nullable */\n sourceHandle?: string | null;\n targetStepId: string;\n /** @nullable */\n targetHandle?: string | null;\n /** @nullable */\n outcome?: string | null;\n filter?: ConditionSetModel | null;\n}\n\nexport type NotifyOnModel = typeof NotifyOnModel[keyof typeof NotifyOnModel];\n\n\nexport const NotifyOnModel = {\n Never: 'Never',\n Failed: 'Failed',\n Suspended: 'Suspended',\n FailedOrSuspended: 'FailedOrSuspended',\n Completed: 'Completed',\n Recovered: 'Recovered',\n Disabled: 'Disabled',\n Warning: 'Warning',\n ReEnabled: 'ReEnabled',\n Resumed: 'Resumed',\n Rejected: 'Rejected',\n} as const;\n\nexport type ChannelConfigurationModelSettings = {[key: string]: unknown | null};\n\nexport interface ChannelConfigurationModel {\n channelAlias: string;\n settings: ChannelConfigurationModelSettings;\n isEnabled: boolean;\n notifyOn: NotifyOnModel;\n}\n\nexport interface AutomationNotificationSettingsModel {\n channels: ChannelConfigurationModel[];\n}\n\nexport interface AutomationExportDefinitionModel {\n id: string;\n alias: string;\n name: string;\n /** @nullable */\n description?: string | null;\n trigger?: TriggerConfigurationModel | null;\n steps: ExportStepModel[];\n connections: StepConnectionModel[];\n /** @nullable */\n canvasState?: string | null;\n notificationSettings?: AutomationNotificationSettingsModel | null;\n}\n\nexport interface ExportSourceModel {\n product: string;\n version: string;\n}\n\nexport interface ConnectionReferenceModel {\n alias: string;\n type: string;\n name: string;\n}\n\nexport interface AutomationExportModel {\n formatVersion: string;\n exportedAt: string;\n exportedFrom: ExportSourceModel;\n automation: AutomationExportDefinitionModel;\n connectionReferences: ConnectionReferenceModel[];\n}\n\nexport type AutomationHealthModel = typeof AutomationHealthModel[keyof typeof AutomationHealthModel];\n\n\nexport const AutomationHealthModel = {\n Healthy: 'Healthy',\n Degraded: 'Degraded',\n Disabled: 'Disabled',\n} as const;\n\nexport interface AutomationImportResultModel {\n success: boolean;\n /** @nullable */\n automationId?: string | null;\n /** @nullable */\n automationAlias?: string | null;\n errors: string[];\n warnings: string[];\n}\n\nexport type AutomationStatusModel = typeof AutomationStatusModel[keyof typeof AutomationStatusModel];\n\n\nexport const AutomationStatusModel = {\n Draft: 'Draft',\n Published: 'Published',\n Unpublished: 'Unpublished',\n} as const;\n\nexport interface AutomationItemResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n workspaceId: string;\n /** @nullable */\n groupId?: string | null;\n status: AutomationStatusModel;\n /** @nullable */\n triggerAlias?: string | null;\n version: number;\n /** @nullable */\n publishedVersion?: number | null;\n dateCreated: string;\n dateModified: string;\n health: AutomationHealthModel;\n}\n\nexport type StepConfigurationModelSettings = {[key: string]: unknown | null};\n\nexport type StepConfigurationModelInputMappings = {[key: string]: string};\n\nexport interface StepConfigurationModel {\n id: string;\n actionAlias: string;\n name: string;\n /** @nullable */\n alias?: string | null;\n /** @nullable */\n connectionId?: string | null;\n settings: StepConfigurationModelSettings;\n inputMappings: StepConfigurationModelInputMappings;\n position: StepPositionModel;\n errorBehavior: StepErrorBehaviorModel;\n /** @nullable */\n retryInterval?: string | null;\n /** @nullable */\n maxRetries?: number | null;\n}\n\nexport interface AutomationResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n status: AutomationStatusModel;\n /** @nullable */\n publishedVersion?: number | null;\n workspaceId: string;\n /** @nullable */\n groupId?: string | null;\n trigger?: TriggerConfigurationModel | null;\n steps: StepConfigurationModel[];\n connections: StepConnectionModel[];\n /** @nullable */\n canvasState?: string | null;\n version: number;\n dateCreated: string;\n dateModified: string;\n notificationSettings?: AutomationNotificationSettingsModel | null;\n health: AutomationHealthModel;\n /** @nullable */\n warningIssuedUtc?: string | null;\n /** @nullable */\n disabledUtc?: string | null;\n}\n\nexport interface AutomationRunCountModel {\n automationId: string;\n automationName: string;\n totalRuns: number;\n successCount: number;\n failCount: number;\n}\n\nexport type AutomationRunStatusModel = typeof AutomationRunStatusModel[keyof typeof AutomationRunStatusModel];\n\n\nexport const AutomationRunStatusModel = {\n Pending: 'Pending',\n Running: 'Running',\n Completed: 'Completed',\n Failed: 'Failed',\n Suspended: 'Suspended',\n Cancelled: 'Cancelled',\n Rejected: 'Rejected',\n} as const;\n\nexport interface AutomationRunListItemResponseModel {\n id: string;\n automationId: string;\n /** @minLength 1 */\n automationName: string;\n automationVersion: number;\n status: AutomationRunStatusModel;\n /** @nullable */\n startedUtc?: string | null;\n /** @nullable */\n completedUtc?: string | null;\n /** @minLength 1 */\n initiatedBy: string;\n /** @nullable */\n correlationId?: string | null;\n /** @nullable */\n error?: string | null;\n}\n\nexport type StepRunStatusModel = typeof StepRunStatusModel[keyof typeof StepRunStatusModel];\n\n\nexport const StepRunStatusModel = {\n Pending: 'Pending',\n Running: 'Running',\n Completed: 'Completed',\n Failed: 'Failed',\n Skipped: 'Skipped',\n WaitingForInput: 'WaitingForInput',\n Sleeping: 'Sleeping',\n Rejected: 'Rejected',\n Cancelled: 'Cancelled',\n} as const;\n\nexport interface StepRunLogEntryResponseModel {\n timestampUtc: string;\n level: ActionLogLevelModel;\n /** @minLength 1 */\n message: string;\n}\n\nexport interface StepRunResponseModel {\n id: string;\n stepId: string;\n /** @minLength 1 */\n actionAlias: string;\n status: StepRunStatusModel;\n /** @nullable */\n startedUtc?: string | null;\n /** @nullable */\n completedUtc?: string | null;\n /** @nullable */\n error?: string | null;\n retryCount: number;\n /** @nullable */\n durationMs?: number | null;\n /** @nullable */\n branchOutcome?: string | null;\n /** @nullable */\n iterationIndex?: number | null;\n /** @nullable */\n iterationTotal?: number | null;\n logEntries: StepRunLogEntryResponseModel[];\n}\n\nexport interface AutomationRunResponseModel {\n id: string;\n automationId: string;\n automationVersion: number;\n status: AutomationRunStatusModel;\n /** @nullable */\n startedUtc?: string | null;\n /** @nullable */\n completedUtc?: string | null;\n /** @minLength 1 */\n initiatedBy: string;\n /** @nullable */\n correlationId?: string | null;\n /** @nullable */\n error?: string | null;\n /** @nullable */\n triggerAlias?: string | null;\n stepRuns: StepRunResponseModel[];\n}\n\nexport interface ConnectionItemResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @minLength 1 */\n type: string;\n version: number;\n dateCreated: string;\n dateModified: string;\n}\n\nexport type ConnectionResponseModelSettings = {[key: string]: unknown | null};\n\nexport interface ConnectionResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @minLength 1 */\n type: string;\n settings: ConnectionResponseModelSettings;\n version: number;\n dateCreated: string;\n dateModified: string;\n}\n\nexport interface ConnectionTypeItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n group?: string | null;\n /** @nullable */\n icon?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n}\n\nexport type ConnectionValidationStatusModel = typeof ConnectionValidationStatusModel[keyof typeof ConnectionValidationStatusModel];\n\n\nexport const ConnectionValidationStatusModel = {\n Success: 'Success',\n Warning: 'Warning',\n Failure: 'Failure',\n} as const;\n\nexport interface ConnectionValidationResponseModel {\n status: ConnectionValidationStatusModel;\n /** @nullable */\n message?: string | null;\n details: string[];\n}\n\n/**\n * @nullable\n */\nexport type ControlFlowItemResponseModelOutputSchema = {[key: string]: unknown | null} | null;\n\nexport interface ControlFlowItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n group?: string | null;\n /** @nullable */\n icon?: string | null;\n /** @nullable */\n connectionTypeAlias?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n /** @nullable */\n outputSchema?: ControlFlowItemResponseModelOutputSchema;\n hasDynamicOutputSchema: boolean;\n outcomes: StepOutcomeResponseModel[];\n hasDynamicOutcomes: boolean;\n /** @minLength 1 */\n type: string;\n}\n\nexport interface CreateAutomationRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n workspaceId: string;\n /** @nullable */\n groupId?: string | null;\n trigger?: TriggerConfigurationModel | null;\n steps: StepConfigurationModel[];\n connections: StepConnectionModel[];\n /** @nullable */\n canvasState?: string | null;\n notificationSettings?: AutomationNotificationSettingsModel | null;\n}\n\nexport type CreateConnectionRequestModelSettings = {[key: string]: unknown | null};\n\nexport interface CreateConnectionRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @minLength 1 */\n type: string;\n settings: CreateConnectionRequestModelSettings;\n}\n\nexport interface CreateWorkspaceGroupRequestModel {\n /** @minLength 1 */\n name: string;\n /** @nullable */\n parentId?: string | null;\n}\n\nexport interface CreateWorkspaceRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n serviceAccountKey: string;\n userGroups: string[];\n allowedConnections: string[];\n}\n\nexport interface ValueChangeModel {\n /** @minLength 1 */\n path: string;\n /** @nullable */\n oldValue?: string | null;\n /** @nullable */\n newValue?: string | null;\n}\n\nexport interface EntityVersionComparisonResponseModel {\n fromVersion: number;\n toVersion: number;\n changes: ValueChangeModel[];\n}\n\nexport interface EntityVersionResponseModel {\n id: string;\n entityId: string;\n version: number;\n dateCreated: string;\n /** @nullable */\n createdByUserId?: string | null;\n /** @nullable */\n changeDescription?: string | null;\n isPublished: boolean;\n}\n\nexport interface EntityVersionHistoryResponseModel {\n currentVersion: number;\n totalVersions: number;\n /** @nullable */\n publishedVersion?: number | null;\n versions: EntityVersionResponseModel[];\n}\n\nexport interface ImportAutomationRequestModel {\n workspaceId: string;\n exportModel: AutomationExportModel;\n}\n\nexport interface NotificationChannelItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n icon?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n}\n\nexport interface PagedAutomationItemResponseModel {\n total: number;\n items: AutomationItemResponseModel[];\n}\n\nexport interface PagedAutomationRunListItemResponseModel {\n total: number;\n items: AutomationRunListItemResponseModel[];\n}\n\nexport interface PagedAutomationRunResponseModel {\n total: number;\n items: AutomationRunResponseModel[];\n}\n\nexport interface PagedConnectionItemResponseModel {\n total: number;\n items: ConnectionItemResponseModel[];\n}\n\nexport interface WorkspaceItemResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n serviceAccountKey: string;\n version: number;\n dateCreated: string;\n dateModified: string;\n}\n\nexport interface PagedWorkspaceItemResponseModel {\n total: number;\n items: WorkspaceItemResponseModel[];\n}\n\nexport interface PendingApprovalResponseModel {\n runId: string;\n stepId: string;\n automationId: string;\n automationName: string;\n /** @nullable */\n prompt?: string | null;\n /** @nullable */\n requestedUtc?: string | null;\n}\n\nexport interface ProblemDetails {\n /** @nullable */\n type?: string | null;\n /** @nullable */\n title?: string | null;\n /** @nullable */\n status?: number | null;\n /** @nullable */\n detail?: string | null;\n /** @nullable */\n instance?: string | null;\n [key: string]: unknown;\n}\n\nexport type ResolveOutcomesRequestModelSettings = {[key: string]: unknown | null};\n\nexport interface ResolveOutcomesRequestModel {\n settings: ResolveOutcomesRequestModelSettings;\n}\n\nexport type ResolveOutputSchemaRequestModelSettings = {[key: string]: unknown | null};\n\nexport interface ResolveOutputSchemaRequestModel {\n settings: ResolveOutputSchemaRequestModelSettings;\n}\n\nexport type RunSummaryModelByStatus = {\n Pending: number;\n Running: number;\n Completed: number;\n Failed: number;\n Suspended: number;\n Cancelled: number;\n Rejected: number;\n};\n\nexport interface RunSummaryModel {\n totalRuns: number;\n byStatus: RunSummaryModelByStatus;\n successRate: number;\n}\n\nexport interface RunTriggerDataResponseModel {\n /** @nullable */\n triggerData?: string | null;\n triggerDataTruncated: boolean;\n}\n\nexport interface StepRunDataResponseModel {\n /** @nullable */\n input?: string | null;\n inputTruncated: boolean;\n /** @nullable */\n output?: string | null;\n outputTruncated: boolean;\n}\n\n/**\n * @nullable\n */\nexport type StepTypeItemResponseModelOutputSchema = {[key: string]: unknown | null} | null;\n\nexport interface StepTypeItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n group?: string | null;\n /** @nullable */\n icon?: string | null;\n /** @nullable */\n connectionTypeAlias?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n /** @nullable */\n outputSchema?: StepTypeItemResponseModelOutputSchema;\n hasDynamicOutputSchema: boolean;\n outcomes: StepOutcomeResponseModel[];\n hasDynamicOutcomes: boolean;\n /** @minLength 1 */\n type: string;\n}\n\n/**\n * @nullable\n */\nexport type TriggerItemResponseModelOutputSchema = {[key: string]: unknown | null} | null;\n\nexport interface TriggerItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n group?: string | null;\n /** @nullable */\n icon?: string | null;\n /** @nullable */\n connectionTypeAlias?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n /** @nullable */\n outputSchema?: TriggerItemResponseModelOutputSchema;\n hasDynamicOutputSchema: boolean;\n outcomes: StepOutcomeResponseModel[];\n hasDynamicOutcomes: boolean;\n /** @minLength 1 */\n type: string;\n supportsManualRun: boolean;\n}\n\nexport interface UpdateAutomationRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n /** @nullable */\n groupId?: string | null;\n trigger?: TriggerConfigurationModel | null;\n steps: StepConfigurationModel[];\n connections: StepConnectionModel[];\n /** @nullable */\n canvasState?: string | null;\n notificationSettings?: AutomationNotificationSettingsModel | null;\n /**\n * @minimum 1\n * @maximum 2147483647\n */\n version: number;\n}\n\nexport type UpdateConnectionRequestModelSettings = {[key: string]: unknown | null};\n\nexport interface UpdateConnectionRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @minLength 1 */\n type: string;\n settings: UpdateConnectionRequestModelSettings;\n /**\n * @minimum 1\n * @maximum 2147483647\n */\n version: number;\n}\n\nexport interface UpdateWorkspaceGroupRequestModel {\n /** @minLength 1 */\n name: string;\n /** @nullable */\n parentId?: string | null;\n}\n\nexport interface UpdateWorkspaceRequestModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n serviceAccountKey: string;\n userGroups: string[];\n allowedConnections: string[];\n /**\n * @minimum 1\n * @maximum 2147483647\n */\n version: number;\n}\n\nexport interface WebhookAuthenticatorItemResponseModel {\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n description?: string | null;\n settingsSchema?: EditableModelSchemaModel | null;\n}\n\nexport interface WebhookUrlResponseModel {\n /** @minLength 1 */\n url: string;\n}\n\nexport interface WorkspaceGroupResponseModel {\n id: string;\n /** @minLength 1 */\n name: string;\n /** @nullable */\n parentId?: string | null;\n workspaceId: string;\n dateCreated: string;\n}\n\nexport interface WorkspaceResponseModel {\n id: string;\n /** @minLength 1 */\n alias: string;\n /** @minLength 1 */\n name: string;\n serviceAccountKey: string;\n userGroups: string[];\n allowedConnections: string[];\n version: number;\n dateCreated: string;\n dateModified: string;\n}\n\nexport type GetAutomationsParams = {\nfilter?: string;\ngroupId?: string;\nworkspaceId?: string;\nskip?: number;\ntake?: number;\n};\n\nexport type GetAutomationsByIdExportParams = {\ninclude?: string;\n};\n\nexport type GetAutomationsByIdRunsParams = {\nskip?: number;\ntake?: number;\n};\n\nexport type GetCatalogueActionsParams = {\nworkspaceId?: string;\n};\n\nexport type GetCatalogueStepTypesParams = {\ntype?: string;\n};\n\nexport type PostCatalogueStepTypesByAliasOutputSchema200 = {[key: string]: unknown};\n\nexport type GetCatalogueTriggersParams = {\nworkspaceId?: string;\n};\n\nexport type GetConnectionsParams = {\nfilter?: string;\nskip?: number;\ntake?: number;\n};\n\nexport type GetMetricsParams = {\nworkspaceId?: string;\nfrom?: string;\nto?: string;\n};\n\nexport type GetMetricsByAutomationParams = {\nworkspaceId?: string;\nfrom?: string;\nto?: string;\ntake?: number;\n};\n\nexport type GetRunsParams = {\nskip?: number;\ntake?: number;\n};\n\nexport type GetVersionHistoryByEntityTypeByEntityIdParams = {\nskip?: number;\ntake?: number;\n};\n\nexport type GetWorkspacesParams = {\nfilter?: string;\nskip?: number;\ntake?: number;\n};\n\nexport type GetWorkspacesByIdGroupsParams = {\nparentGroupId?: string;\n};\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n\n export const getUmbracoAutomateManagementAPI = () => {\nconst postApprovalsByRunIdStepsByStepIdDecision = (\n runId: string,\n stepId: string,\n approvalDecisionRequestModel?: ApprovalDecisionRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/approvals/${runId}/steps/${stepId}/decision`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: approvalDecisionRequestModel\n },\n options);\n }\n\nconst getApprovalsPending = (\n\n options?: SecondParameter<typeof customInstance<PendingApprovalResponseModel[]>>,) => {\n return customInstance<PendingApprovalResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/approvals/pending`, method: 'GET'\n },\n options);\n }\n\nconst postAutomations = (\n createAutomationRequestModel?: CreateAutomationRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: createAutomationRequestModel\n },\n options);\n }\n\nconst getAutomations = (\n params?: GetAutomationsParams,\n options?: SecondParameter<typeof customInstance<PagedAutomationItemResponseModel>>,) => {\n return customInstance<PagedAutomationItemResponseModel>(\n {url: `/umbraco/automate/management/api/v1/automations`, method: 'GET',\n params\n },\n options);\n }\n\nconst deleteAutomationsById = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}`, method: 'DELETE'\n },\n options);\n }\n\nconst getAutomationsById = (\n id: string,\n options?: SecondParameter<typeof customInstance<AutomationResponseModel>>,) => {\n return customInstance<AutomationResponseModel>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}`, method: 'GET'\n },\n options);\n }\n\nconst putAutomationsById = (\n id: string,\n updateAutomationRequestModel?: UpdateAutomationRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: updateAutomationRequestModel\n },\n options);\n }\n\nconst getAutomationsByIdAncestors = (\n id: string,\n options?: SecondParameter<typeof customInstance<AutomationAncestorResponseModel[]>>,) => {\n return customInstance<AutomationAncestorResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/ancestors`, method: 'GET'\n },\n options);\n }\n\nconst getAutomationsByIdExport = (\n id: string,\n params?: GetAutomationsByIdExportParams,\n options?: SecondParameter<typeof customInstance<AutomationExportModel>>,) => {\n return customInstance<AutomationExportModel>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/export`, method: 'GET',\n params\n },\n options);\n }\n\nconst putAutomationsByIdImport = (\n id: string,\n automationExportModel?: AutomationExportModel,\n options?: SecondParameter<typeof customInstance<AutomationImportResultModel>>,) => {\n return customInstance<AutomationImportResultModel>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/import`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: automationExportModel\n },\n options);\n }\n\nconst postAutomationsByIdPublish = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/publish`, method: 'POST'\n },\n options);\n }\n\nconst postAutomationsByIdReEnable = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/re-enable`, method: 'POST'\n },\n options);\n }\n\nconst getAutomationsByIdRuns = (\n id: string,\n params?: GetAutomationsByIdRunsParams,\n options?: SecondParameter<typeof customInstance<PagedAutomationRunResponseModel>>,) => {\n return customInstance<PagedAutomationRunResponseModel>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/runs`, method: 'GET',\n params\n },\n options);\n }\n\nconst postAutomationsByIdTrigger = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/trigger`, method: 'POST'\n },\n options);\n }\n\nconst postAutomationsByIdUnpublish = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/unpublish`, method: 'POST'\n },\n options);\n }\n\nconst getAutomationsByIdWebhookUrl = (\n id: string,\n options?: SecondParameter<typeof customInstance<WebhookUrlResponseModel>>,) => {\n return customInstance<WebhookUrlResponseModel>(\n {url: `/umbraco/automate/management/api/v1/automations/${id}/webhook-url`, method: 'GET'\n },\n options);\n }\n\nconst getAutomationsGroupsByGroupId = (\n groupId: string,\n options?: SecondParameter<typeof customInstance<WorkspaceGroupResponseModel>>,) => {\n return customInstance<WorkspaceGroupResponseModel>(\n {url: `/umbraco/automate/management/api/v1/automations/groups/${groupId}`, method: 'GET'\n },\n options);\n }\n\nconst postAutomationsImport = (\n importAutomationRequestModel?: ImportAutomationRequestModel,\n options?: SecondParameter<typeof customInstance<AutomationImportResultModel>>,) => {\n return customInstance<AutomationImportResultModel>(\n {url: `/umbraco/automate/management/api/v1/automations/import`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: importAutomationRequestModel\n },\n options);\n }\n\nconst postAutomationsImportValidate = (\n importAutomationRequestModel?: ImportAutomationRequestModel,\n options?: SecondParameter<typeof customInstance<AutomationImportResultModel>>,) => {\n return customInstance<AutomationImportResultModel>(\n {url: `/umbraco/automate/management/api/v1/automations/import/validate`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: importAutomationRequestModel\n },\n options);\n }\n\nconst getCatalogueActions = (\n params?: GetCatalogueActionsParams,\n options?: SecondParameter<typeof customInstance<ActionItemResponseModel[]>>,) => {\n return customInstance<ActionItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/actions`, method: 'GET',\n params\n },\n options);\n }\n\nconst getCatalogueConnectionTypes = (\n\n options?: SecondParameter<typeof customInstance<ConnectionTypeItemResponseModel[]>>,) => {\n return customInstance<ConnectionTypeItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/connection-types`, method: 'GET'\n },\n options);\n }\n\nconst getCatalogueControlFlows = (\n\n options?: SecondParameter<typeof customInstance<ControlFlowItemResponseModel[]>>,) => {\n return customInstance<ControlFlowItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/control-flows`, method: 'GET'\n },\n options);\n }\n\nconst getCatalogueNotificationChannels = (\n\n options?: SecondParameter<typeof customInstance<NotificationChannelItemResponseModel[]>>,) => {\n return customInstance<NotificationChannelItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/notification-channels`, method: 'GET'\n },\n options);\n }\n\nconst getCatalogueStepTypes = (\n params?: GetCatalogueStepTypesParams,\n options?: SecondParameter<typeof customInstance<StepTypeItemResponseModel[]>>,) => {\n return customInstance<StepTypeItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/step-types`, method: 'GET',\n params\n },\n options);\n }\n\nconst postCatalogueStepTypesByAliasOutcomes = (\n alias: string,\n resolveOutcomesRequestModel?: ResolveOutcomesRequestModel,\n options?: SecondParameter<typeof customInstance<StepOutcomeResponseModel[]>>,) => {\n return customInstance<StepOutcomeResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/step-types/${alias}/outcomes`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: resolveOutcomesRequestModel\n },\n options);\n }\n\nconst postCatalogueStepTypesByAliasOutputSchema = (\n alias: string,\n resolveOutputSchemaRequestModel?: ResolveOutputSchemaRequestModel,\n options?: SecondParameter<typeof customInstance<PostCatalogueStepTypesByAliasOutputSchema200>>,) => {\n return customInstance<PostCatalogueStepTypesByAliasOutputSchema200>(\n {url: `/umbraco/automate/management/api/v1/catalogue/step-types/${alias}/output-schema`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: resolveOutputSchemaRequestModel\n },\n options);\n }\n\nconst getCatalogueTriggers = (\n params?: GetCatalogueTriggersParams,\n options?: SecondParameter<typeof customInstance<TriggerItemResponseModel[]>>,) => {\n return customInstance<TriggerItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/triggers`, method: 'GET',\n params\n },\n options);\n }\n\nconst getCatalogueWebhookAuthenticators = (\n\n options?: SecondParameter<typeof customInstance<WebhookAuthenticatorItemResponseModel[]>>,) => {\n return customInstance<WebhookAuthenticatorItemResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/catalogue/webhook-authenticators`, method: 'GET'\n },\n options);\n }\n\nconst postConnections = (\n createConnectionRequestModel?: CreateConnectionRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/connections`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: createConnectionRequestModel\n },\n options);\n }\n\nconst getConnections = (\n params?: GetConnectionsParams,\n options?: SecondParameter<typeof customInstance<PagedConnectionItemResponseModel>>,) => {\n return customInstance<PagedConnectionItemResponseModel>(\n {url: `/umbraco/automate/management/api/v1/connections`, method: 'GET',\n params\n },\n options);\n }\n\nconst deleteConnectionsById = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/connections/${id}`, method: 'DELETE'\n },\n options);\n }\n\nconst getConnectionsById = (\n id: string,\n options?: SecondParameter<typeof customInstance<ConnectionResponseModel>>,) => {\n return customInstance<ConnectionResponseModel>(\n {url: `/umbraco/automate/management/api/v1/connections/${id}`, method: 'GET'\n },\n options);\n }\n\nconst putConnectionsById = (\n id: string,\n updateConnectionRequestModel?: UpdateConnectionRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/connections/${id}`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: updateConnectionRequestModel\n },\n options);\n }\n\nconst postConnectionsByIdTest = (\n id: string,\n options?: SecondParameter<typeof customInstance<ConnectionValidationResponseModel>>,) => {\n return customInstance<ConnectionValidationResponseModel>(\n {url: `/umbraco/automate/management/api/v1/connections/${id}/test`, method: 'POST'\n },\n options);\n }\n\nconst getMetrics = (\n params?: GetMetricsParams,\n options?: SecondParameter<typeof customInstance<RunSummaryModel>>,) => {\n return customInstance<RunSummaryModel>(\n {url: `/umbraco/automate/management/api/v1/metrics`, method: 'GET',\n params\n },\n options);\n }\n\nconst getMetricsByAutomation = (\n params?: GetMetricsByAutomationParams,\n options?: SecondParameter<typeof customInstance<AutomationRunCountModel[]>>,) => {\n return customInstance<AutomationRunCountModel[]>(\n {url: `/umbraco/automate/management/api/v1/metrics/by-automation`, method: 'GET',\n params\n },\n options);\n }\n\nconst getRuns = (\n params?: GetRunsParams,\n options?: SecondParameter<typeof customInstance<PagedAutomationRunListItemResponseModel>>,) => {\n return customInstance<PagedAutomationRunListItemResponseModel>(\n {url: `/umbraco/automate/management/api/v1/runs`, method: 'GET',\n params\n },\n options);\n }\n\nconst getRunsById = (\n id: string,\n options?: SecondParameter<typeof customInstance<AutomationRunResponseModel>>,) => {\n return customInstance<AutomationRunResponseModel>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}`, method: 'GET'\n },\n options);\n }\n\nconst postRunsByIdReplay = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/replay`, method: 'POST'\n },\n options);\n }\n\nconst postRunsByIdResume = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/resume`, method: 'POST'\n },\n options);\n }\n\nconst getRunsByIdStepRunsByStepRunIdData = (\n id: string,\n stepRunId: string,\n options?: SecondParameter<typeof customInstance<StepRunDataResponseModel>>,) => {\n return customInstance<StepRunDataResponseModel>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/step-runs/${stepRunId}/data`, method: 'GET'\n },\n options);\n }\n\nconst postRunsByIdSuspend = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/suspend`, method: 'POST'\n },\n options);\n }\n\nconst postRunsByIdTerminate = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/terminate`, method: 'POST'\n },\n options);\n }\n\nconst getRunsByIdTriggerData = (\n id: string,\n options?: SecondParameter<typeof customInstance<RunTriggerDataResponseModel>>,) => {\n return customInstance<RunTriggerDataResponseModel>(\n {url: `/umbraco/automate/management/api/v1/runs/${id}/trigger-data`, method: 'GET'\n },\n options);\n }\n\nconst getVersionHistoryByEntityTypeByEntityId = (\n entityType: string,\n entityId: string,\n params?: GetVersionHistoryByEntityTypeByEntityIdParams,\n options?: SecondParameter<typeof customInstance<EntityVersionHistoryResponseModel>>,) => {\n return customInstance<EntityVersionHistoryResponseModel>(\n {url: `/umbraco/automate/management/api/v1/version-history/${entityType}/${entityId}`, method: 'GET',\n params\n },\n options);\n }\n\nconst getVersionHistoryByEntityTypeByEntityIdByEntityVersion = (\n entityType: string,\n entityId: string,\n entityVersion: number,\n options?: SecondParameter<typeof customInstance<EntityVersionResponseModel>>,) => {\n return customInstance<EntityVersionResponseModel>(\n {url: `/umbraco/automate/management/api/v1/version-history/${entityType}/${entityId}/${entityVersion}`, method: 'GET'\n },\n options);\n }\n\nconst postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollback = (\n entityType: string,\n entityId: string,\n entityVersion: number,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/version-history/${entityType}/${entityId}/${entityVersion}/rollback`, method: 'POST'\n },\n options);\n }\n\nconst getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersion = (\n entityType: string,\n entityId: string,\n fromEntityVersion: number,\n toEntityVersion: number,\n options?: SecondParameter<typeof customInstance<EntityVersionComparisonResponseModel>>,) => {\n return customInstance<EntityVersionComparisonResponseModel>(\n {url: `/umbraco/automate/management/api/v1/version-history/${entityType}/${entityId}/${fromEntityVersion}/compare/${toEntityVersion}`, method: 'GET'\n },\n options);\n }\n\nconst getVersionHistorySupportedTypes = (\n\n options?: SecondParameter<typeof customInstance<string[]>>,) => {\n return customInstance<string[]>(\n {url: `/umbraco/automate/management/api/v1/version-history/supported-types`, method: 'GET'\n },\n options);\n }\n\nconst postWorkspaces = (\n createWorkspaceRequestModel?: CreateWorkspaceRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: createWorkspaceRequestModel\n },\n options);\n }\n\nconst getWorkspaces = (\n params?: GetWorkspacesParams,\n options?: SecondParameter<typeof customInstance<PagedWorkspaceItemResponseModel>>,) => {\n return customInstance<PagedWorkspaceItemResponseModel>(\n {url: `/umbraco/automate/management/api/v1/workspaces`, method: 'GET',\n params\n },\n options);\n }\n\nconst deleteWorkspacesById = (\n id: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}`, method: 'DELETE'\n },\n options);\n }\n\nconst getWorkspacesById = (\n id: string,\n options?: SecondParameter<typeof customInstance<WorkspaceResponseModel>>,) => {\n return customInstance<WorkspaceResponseModel>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}`, method: 'GET'\n },\n options);\n }\n\nconst putWorkspacesById = (\n id: string,\n updateWorkspaceRequestModel?: UpdateWorkspaceRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: updateWorkspaceRequestModel\n },\n options);\n }\n\nconst postWorkspacesByIdGroups = (\n id: string,\n createWorkspaceGroupRequestModel?: CreateWorkspaceGroupRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}/groups`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: createWorkspaceGroupRequestModel\n },\n options);\n }\n\nconst getWorkspacesByIdGroups = (\n id: string,\n params?: GetWorkspacesByIdGroupsParams,\n options?: SecondParameter<typeof customInstance<WorkspaceGroupResponseModel[]>>,) => {\n return customInstance<WorkspaceGroupResponseModel[]>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}/groups`, method: 'GET',\n params\n },\n options);\n }\n\nconst deleteWorkspacesByIdGroupsByGroupId = (\n id: string,\n groupId: string,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}/groups/${groupId}`, method: 'DELETE'\n },\n options);\n }\n\nconst getWorkspacesByIdGroupsByGroupId = (\n id: string,\n groupId: string,\n options?: SecondParameter<typeof customInstance<WorkspaceGroupResponseModel>>,) => {\n return customInstance<WorkspaceGroupResponseModel>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}/groups/${groupId}`, method: 'GET'\n },\n options);\n }\n\nconst putWorkspacesByIdGroupsByGroupId = (\n id: string,\n groupId: string,\n updateWorkspaceGroupRequestModel?: UpdateWorkspaceGroupRequestModel,\n options?: SecondParameter<typeof customInstance<void>>,) => {\n return customInstance<void>(\n {url: `/umbraco/automate/management/api/v1/workspaces/${id}/groups/${groupId}`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: updateWorkspaceGroupRequestModel\n },\n options);\n }\n\nreturn {postApprovalsByRunIdStepsByStepIdDecision,getApprovalsPending,postAutomations,getAutomations,deleteAutomationsById,getAutomationsById,putAutomationsById,getAutomationsByIdAncestors,getAutomationsByIdExport,putAutomationsByIdImport,postAutomationsByIdPublish,postAutomationsByIdReEnable,getAutomationsByIdRuns,postAutomationsByIdTrigger,postAutomationsByIdUnpublish,getAutomationsByIdWebhookUrl,getAutomationsGroupsByGroupId,postAutomationsImport,postAutomationsImportValidate,getCatalogueActions,getCatalogueConnectionTypes,getCatalogueControlFlows,getCatalogueNotificationChannels,getCatalogueStepTypes,postCatalogueStepTypesByAliasOutcomes,postCatalogueStepTypesByAliasOutputSchema,getCatalogueTriggers,getCatalogueWebhookAuthenticators,postConnections,getConnections,deleteConnectionsById,getConnectionsById,putConnectionsById,postConnectionsByIdTest,getMetrics,getMetricsByAutomation,getRuns,getRunsById,postRunsByIdReplay,postRunsByIdResume,getRunsByIdStepRunsByStepRunIdData,postRunsByIdSuspend,postRunsByIdTerminate,getRunsByIdTriggerData,getVersionHistoryByEntityTypeByEntityId,getVersionHistoryByEntityTypeByEntityIdByEntityVersion,postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollback,getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersion,getVersionHistorySupportedTypes,postWorkspaces,getWorkspaces,deleteWorkspacesById,getWorkspacesById,putWorkspacesById,postWorkspacesByIdGroups,getWorkspacesByIdGroups,deleteWorkspacesByIdGroupsByGroupId,getWorkspacesByIdGroupsByGroupId,putWorkspacesByIdGroupsByGroupId}};\nexport type PostApprovalsByRunIdStepsByStepIdDecisionResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postApprovalsByRunIdStepsByStepIdDecision']>>>\nexport type GetApprovalsPendingResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getApprovalsPending']>>>\nexport type PostAutomationsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomations']>>>\nexport type GetAutomationsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomations']>>>\nexport type DeleteAutomationsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['deleteAutomationsById']>>>\nexport type GetAutomationsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsById']>>>\nexport type PutAutomationsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['putAutomationsById']>>>\nexport type GetAutomationsByIdAncestorsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsByIdAncestors']>>>\nexport type GetAutomationsByIdExportResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsByIdExport']>>>\nexport type PutAutomationsByIdImportResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['putAutomationsByIdImport']>>>\nexport type PostAutomationsByIdPublishResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsByIdPublish']>>>\nexport type PostAutomationsByIdReEnableResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsByIdReEnable']>>>\nexport type GetAutomationsByIdRunsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsByIdRuns']>>>\nexport type PostAutomationsByIdTriggerResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsByIdTrigger']>>>\nexport type PostAutomationsByIdUnpublishResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsByIdUnpublish']>>>\nexport type GetAutomationsByIdWebhookUrlResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsByIdWebhookUrl']>>>\nexport type GetAutomationsGroupsByGroupIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getAutomationsGroupsByGroupId']>>>\nexport type PostAutomationsImportResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsImport']>>>\nexport type PostAutomationsImportValidateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postAutomationsImportValidate']>>>\nexport type GetCatalogueActionsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueActions']>>>\nexport type GetCatalogueConnectionTypesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueConnectionTypes']>>>\nexport type GetCatalogueControlFlowsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueControlFlows']>>>\nexport type GetCatalogueNotificationChannelsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueNotificationChannels']>>>\nexport type GetCatalogueStepTypesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueStepTypes']>>>\nexport type PostCatalogueStepTypesByAliasOutcomesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postCatalogueStepTypesByAliasOutcomes']>>>\nexport type PostCatalogueStepTypesByAliasOutputSchemaResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postCatalogueStepTypesByAliasOutputSchema']>>>\nexport type GetCatalogueTriggersResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueTriggers']>>>\nexport type GetCatalogueWebhookAuthenticatorsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getCatalogueWebhookAuthenticators']>>>\nexport type PostConnectionsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postConnections']>>>\nexport type GetConnectionsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getConnections']>>>\nexport type DeleteConnectionsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['deleteConnectionsById']>>>\nexport type GetConnectionsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getConnectionsById']>>>\nexport type PutConnectionsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['putConnectionsById']>>>\nexport type PostConnectionsByIdTestResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postConnectionsByIdTest']>>>\nexport type GetMetricsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getMetrics']>>>\nexport type GetMetricsByAutomationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getMetricsByAutomation']>>>\nexport type GetRunsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getRuns']>>>\nexport type GetRunsByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getRunsById']>>>\nexport type PostRunsByIdReplayResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postRunsByIdReplay']>>>\nexport type PostRunsByIdResumeResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postRunsByIdResume']>>>\nexport type GetRunsByIdStepRunsByStepRunIdDataResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getRunsByIdStepRunsByStepRunIdData']>>>\nexport type PostRunsByIdSuspendResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postRunsByIdSuspend']>>>\nexport type PostRunsByIdTerminateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postRunsByIdTerminate']>>>\nexport type GetRunsByIdTriggerDataResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getRunsByIdTriggerData']>>>\nexport type GetVersionHistoryByEntityTypeByEntityIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getVersionHistoryByEntityTypeByEntityId']>>>\nexport type GetVersionHistoryByEntityTypeByEntityIdByEntityVersionResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getVersionHistoryByEntityTypeByEntityIdByEntityVersion']>>>\nexport type PostVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollback']>>>\nexport type GetVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersion']>>>\nexport type GetVersionHistorySupportedTypesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getVersionHistorySupportedTypes']>>>\nexport type PostWorkspacesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postWorkspaces']>>>\nexport type GetWorkspacesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getWorkspaces']>>>\nexport type DeleteWorkspacesByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['deleteWorkspacesById']>>>\nexport type GetWorkspacesByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getWorkspacesById']>>>\nexport type PutWorkspacesByIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['putWorkspacesById']>>>\nexport type PostWorkspacesByIdGroupsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['postWorkspacesByIdGroups']>>>\nexport type GetWorkspacesByIdGroupsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getWorkspacesByIdGroups']>>>\nexport type DeleteWorkspacesByIdGroupsByGroupIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['deleteWorkspacesByIdGroupsByGroupId']>>>\nexport type GetWorkspacesByIdGroupsByGroupIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['getWorkspacesByIdGroupsByGroupId']>>>\nexport type PutWorkspacesByIdGroupsByGroupIdResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getUmbracoAutomateManagementAPI>['putWorkspacesByIdGroupsByGroupId']>>>\n","/**\n * Get Server Information Tool\n *\n * Calls the real Umbraco Management API to fetch server version and runtime info.\n * Uses the custom transport layer (fetch with Bearer token) that's set up by\n * the hosted MCP server during per-request initialization.\n *\n * This tool proves the full authentication chain works:\n * OAuth flow → Umbraco token → Management API call → response.\n */\n\nimport {\n withStandardDecorators,\n createToolResult,\n UmbracoManagementClient,\n CAPTURE_RAW_HTTP_RESPONSE,\n SERVER_INFORMATION_PATH,\n type ToolDefinition,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\n\ninterface ServerInfo {\n version: string;\n assemblyVersion: string;\n}\n\nconst getServerInfoTool: ToolDefinition = {\n name: \"get-server-info\",\n description:\n \"Gets Umbraco server information including version and runtime details.\",\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async () => {\n // Call the real Umbraco Management API endpoint.\n // UmbracoManagementClient routes through the custom transport (fetch with\n // the user's Bearer token) that was configured during server init.\n // CAPTURE_RAW_HTTP_RESPONSE returns HttpResponse<T> at runtime,\n // but the generic signature returns T — cast to access .data.\n const response = await UmbracoManagementClient<ServerInfo>(\n { url: SERVER_INFORMATION_PATH, method: \"GET\" },\n CAPTURE_RAW_HTTP_RESPONSE,\n ) as unknown as HttpResponse<ServerInfo>;\n\n return createToolResult(response.data);\n },\n};\n\nexport default withStandardDecorators(getServerInfoTool);\n","/**\n * Umbraco Server Tool Collection\n *\n * Tools that call real Umbraco Management API endpoints.\n * Used to verify the full authentication chain works end-to-end.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport getServerInfoTool from \"./get/get-server-info.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"umbraco-server\",\n displayName: \"Umbraco Server\",\n description: \"Server information and status from the Umbraco Management API\",\n },\n tools: () => [getServerInfoTool],\n};\n\nexport default collection;\n","/**\n * Generated by orval 🍺\n * Do not edit manually.\n * Umbraco Automate Management API\n * Describes the Umbraco Automate Management API available for managing automations, triggers, actions, and runs when authenticated as a backoffice user.\n * OpenAPI spec version: Latest\n */\nimport * as zod from 'zod';\n\nexport const postApprovalsByRunIdStepsByStepIdDecisionParams = zod.object({\n \"runId\": zod.guid(),\n \"stepId\": zod.guid()\n})\n\nexport const postApprovalsByRunIdStepsByStepIdDecisionBody = zod.object({\n \"outcome\": zod.enum(['Approved', 'Rejected']),\n \"comment\": zod.string().nullish()\n})\n\nexport const postApprovalsByRunIdStepsByStepIdDecisionResponse = zod.unknown()\n\n\nexport const getApprovalsPendingResponseItem = zod.object({\n \"runId\": zod.guid(),\n \"stepId\": zod.guid(),\n \"automationId\": zod.guid(),\n \"automationName\": zod.string(),\n \"prompt\": zod.string().nullish(),\n \"requestedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish()\n})\nexport const getApprovalsPendingResponse = zod.array(getApprovalsPendingResponseItem)\n\n\n\n\n\n\nexport const postAutomationsBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"workspaceId\": zod.guid(),\n \"groupId\": zod.guid().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionId\": zod.guid().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish()\n})\n\nexport const postAutomationsResponse = zod.void()\n\n\nexport const getAutomationsQuerySkipDefault = 0;\nexport const getAutomationsQueryTakeDefault = 100;\n\nexport const getAutomationsQueryParams = zod.object({\n \"filter\": zod.string().optional(),\n \"groupId\": zod.guid().optional(),\n \"workspaceId\": zod.guid().optional(),\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getAutomationsQueryTakeDefault)\n})\n\n\n\n\n\nexport const getAutomationsResponse = zod.object({\n \"total\": zod.int(),\n \"items\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"workspaceId\": zod.guid(),\n \"groupId\": zod.guid().nullish(),\n \"status\": zod.enum(['Draft', 'Published', 'Unpublished']),\n \"triggerAlias\": zod.string().nullish(),\n \"version\": zod.int(),\n \"publishedVersion\": zod.int().nullish(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"health\": zod.enum(['Healthy', 'Degraded', 'Disabled'])\n}))\n})\n\n\nexport const deleteAutomationsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const deleteAutomationsByIdResponse = zod.unknown()\n\n\nexport const getAutomationsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\n\nexport const getAutomationsByIdResponse = zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"status\": zod.enum(['Draft', 'Published', 'Unpublished']),\n \"publishedVersion\": zod.int().nullish(),\n \"workspaceId\": zod.guid(),\n \"groupId\": zod.guid().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionId\": zod.guid().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish(),\n \"health\": zod.enum(['Healthy', 'Degraded', 'Disabled']),\n \"warningIssuedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"disabledUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish()\n})\n\n\nexport const putAutomationsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\nexport const putAutomationsByIdBodyOneVersionMax = 2147483647;\n\n\n\nexport const putAutomationsByIdBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"groupId\": zod.guid().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionId\": zod.guid().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish(),\n \"version\": zod.int().min(1).max(putAutomationsByIdBodyOneVersionMax)\n})\n\nexport const putAutomationsByIdResponse = zod.unknown()\n\n\nexport const getAutomationsByIdAncestorsParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\n\nexport const getAutomationsByIdAncestorsResponseItem = zod.object({\n \"id\": zod.guid(),\n \"entityType\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish(),\n \"parentEntityType\": zod.string().nullish(),\n \"hasChildren\": zod.boolean(),\n \"isFolder\": zod.boolean()\n})\nexport const getAutomationsByIdAncestorsResponse = zod.array(getAutomationsByIdAncestorsResponseItem)\n\n\nexport const getAutomationsByIdExportParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const getAutomationsByIdExportQueryParams = zod.object({\n \"include\": zod.string().optional()\n})\n\nexport const getAutomationsByIdExportResponse = zod.object({\n \"formatVersion\": zod.string(),\n \"exportedAt\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"exportedFrom\": zod.object({\n \"product\": zod.string(),\n \"version\": zod.string()\n}),\n \"automation\": zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string(),\n \"name\": zod.string(),\n \"description\": zod.string().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionAlias\": zod.string().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish()\n}),\n \"connectionReferences\": zod.array(zod.object({\n \"alias\": zod.string(),\n \"type\": zod.string(),\n \"name\": zod.string()\n}))\n})\n\n\nexport const putAutomationsByIdImportParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const putAutomationsByIdImportBody = zod.object({\n \"formatVersion\": zod.string(),\n \"exportedAt\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"exportedFrom\": zod.object({\n \"product\": zod.string(),\n \"version\": zod.string()\n}),\n \"automation\": zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string(),\n \"name\": zod.string(),\n \"description\": zod.string().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionAlias\": zod.string().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish()\n}),\n \"connectionReferences\": zod.array(zod.object({\n \"alias\": zod.string(),\n \"type\": zod.string(),\n \"name\": zod.string()\n}))\n})\n\nexport const putAutomationsByIdImportResponse = zod.object({\n \"success\": zod.boolean(),\n \"automationId\": zod.guid().nullish(),\n \"automationAlias\": zod.string().nullish(),\n \"errors\": zod.array(zod.string()),\n \"warnings\": zod.array(zod.string())\n})\n\n\nexport const postAutomationsByIdPublishParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postAutomationsByIdPublishResponse = zod.unknown()\n\n\nexport const postAutomationsByIdReEnableParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postAutomationsByIdReEnableResponse = zod.unknown()\n\n\nexport const getAutomationsByIdRunsParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const getAutomationsByIdRunsQuerySkipDefault = 0;\nexport const getAutomationsByIdRunsQueryTakeDefault = 100;\n\nexport const getAutomationsByIdRunsQueryParams = zod.object({\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getAutomationsByIdRunsQueryTakeDefault)\n})\n\n\n\n\n\n\nexport const getAutomationsByIdRunsResponse = zod.object({\n \"total\": zod.int(),\n \"items\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"automationId\": zod.guid(),\n \"automationVersion\": zod.int(),\n \"status\": zod.enum(['Pending', 'Running', 'Completed', 'Failed', 'Suspended', 'Cancelled', 'Rejected']),\n \"startedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"completedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"initiatedBy\": zod.string().min(1),\n \"correlationId\": zod.string().nullish(),\n \"error\": zod.string().nullish(),\n \"triggerAlias\": zod.string().nullish(),\n \"stepRuns\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"stepId\": zod.guid(),\n \"actionAlias\": zod.string().min(1),\n \"status\": zod.enum(['Pending', 'Running', 'Completed', 'Failed', 'Skipped', 'WaitingForInput', 'Sleeping', 'Rejected', 'Cancelled']),\n \"startedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"completedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"error\": zod.string().nullish(),\n \"retryCount\": zod.int(),\n \"durationMs\": zod.number().nullish(),\n \"branchOutcome\": zod.string().nullish(),\n \"iterationIndex\": zod.int().nullish(),\n \"iterationTotal\": zod.int().nullish(),\n \"logEntries\": zod.array(zod.object({\n \"timestampUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"level\": zod.enum(['Debug', 'Info', 'Warning', 'Error']),\n \"message\": zod.string().min(1)\n}))\n}))\n}))\n})\n\n\nexport const postAutomationsByIdTriggerParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postAutomationsByIdTriggerResponse = zod.void()\n\n\nexport const postAutomationsByIdUnpublishParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postAutomationsByIdUnpublishResponse = zod.unknown()\n\n\nexport const getAutomationsByIdWebhookUrlParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\nexport const getAutomationsByIdWebhookUrlResponse = zod.object({\n \"url\": zod.string().min(1)\n})\n\n\nexport const getAutomationsGroupsByGroupIdParams = zod.object({\n \"groupId\": zod.guid()\n})\n\n\n\n\nexport const getAutomationsGroupsByGroupIdResponse = zod.object({\n \"id\": zod.guid(),\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish(),\n \"workspaceId\": zod.guid(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true})\n})\n\n\nexport const postAutomationsImportBody = zod.object({\n \"workspaceId\": zod.guid(),\n \"exportModel\": zod.object({\n \"formatVersion\": zod.string(),\n \"exportedAt\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"exportedFrom\": zod.object({\n \"product\": zod.string(),\n \"version\": zod.string()\n}),\n \"automation\": zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string(),\n \"name\": zod.string(),\n \"description\": zod.string().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionAlias\": zod.string().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish()\n}),\n \"connectionReferences\": zod.array(zod.object({\n \"alias\": zod.string(),\n \"type\": zod.string(),\n \"name\": zod.string()\n}))\n})\n})\n\nexport const postAutomationsImportResponse = zod.object({\n \"success\": zod.boolean(),\n \"automationId\": zod.guid().nullish(),\n \"automationAlias\": zod.string().nullish(),\n \"errors\": zod.array(zod.string()),\n \"warnings\": zod.array(zod.string())\n})\n\n\nexport const postAutomationsImportValidateBody = zod.object({\n \"workspaceId\": zod.guid(),\n \"exportModel\": zod.object({\n \"formatVersion\": zod.string(),\n \"exportedAt\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"exportedFrom\": zod.object({\n \"product\": zod.string(),\n \"version\": zod.string()\n}),\n \"automation\": zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string(),\n \"name\": zod.string(),\n \"description\": zod.string().nullish(),\n \"trigger\": zod.object({\n \"triggerAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n}).nullish(),\n \"steps\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"actionAlias\": zod.string(),\n \"name\": zod.string(),\n \"alias\": zod.string().nullish(),\n \"connectionAlias\": zod.string().nullish(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"inputMappings\": zod.record(zod.string(), zod.string()),\n \"position\": zod.object({\n \"x\": zod.number(),\n \"y\": zod.number()\n}),\n \"errorBehavior\": zod.enum(['Retry', 'Suspend', 'Terminate', 'Compensate']),\n \"retryInterval\": zod.string().nullish(),\n \"maxRetries\": zod.int().nullish()\n})),\n \"connections\": zod.array(zod.object({\n \"sourceStepId\": zod.guid(),\n \"sourceHandle\": zod.string().nullish(),\n \"targetStepId\": zod.guid(),\n \"targetHandle\": zod.string().nullish(),\n \"outcome\": zod.string().nullish(),\n \"filter\": zod.object({\n \"groups\": zod.array(zod.object({\n \"conditions\": zod.array(zod.object({\n \"leftOperand\": zod.string(),\n \"operator\": zod.enum(['Equals', 'NotEquals', 'Contains', 'NotContains', 'StartsWith', 'EndsWith', 'GreaterThan', 'LessThan', 'GreaterThanOrEquals', 'LessThanOrEquals', 'IsEmpty', 'IsNotEmpty']),\n \"rightOperand\": zod.string()\n}))\n}))\n}).nullish()\n})),\n \"canvasState\": zod.string().nullish(),\n \"notificationSettings\": zod.object({\n \"channels\": zod.array(zod.object({\n \"channelAlias\": zod.string(),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"isEnabled\": zod.boolean(),\n \"notifyOn\": zod.enum(['Never', 'Failed', 'Suspended', 'FailedOrSuspended', 'Completed', 'Recovered', 'Disabled', 'Warning', 'ReEnabled', 'Resumed', 'Rejected'])\n}))\n}).nullish()\n}),\n \"connectionReferences\": zod.array(zod.object({\n \"alias\": zod.string(),\n \"type\": zod.string(),\n \"name\": zod.string()\n}))\n})\n})\n\nexport const postAutomationsImportValidateResponse = zod.object({\n \"success\": zod.boolean(),\n \"automationId\": zod.guid().nullish(),\n \"automationAlias\": zod.string().nullish(),\n \"errors\": zod.array(zod.string()),\n \"warnings\": zod.array(zod.string())\n})\n\n\nexport const getCatalogueActionsQueryParams = zod.object({\n \"workspaceId\": zod.guid().optional()\n})\n\n\n\n\n\n\n\n\n\nexport const getCatalogueActionsResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"group\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"connectionTypeAlias\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish(),\n \"outputSchema\": zod.record(zod.string(), zod.unknown().nullable()).nullish(),\n \"hasDynamicOutputSchema\": zod.boolean(),\n \"outcomes\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string().min(1),\n \"isDefault\": zod.boolean(),\n \"description\": zod.string().nullish()\n})),\n \"hasDynamicOutcomes\": zod.boolean(),\n \"type\": zod.string().min(1)\n})\nexport const getCatalogueActionsResponse = zod.array(getCatalogueActionsResponseItem)\n\n\n\n\n\n\n\nexport const getCatalogueConnectionTypesResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"group\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish()\n})\nexport const getCatalogueConnectionTypesResponse = zod.array(getCatalogueConnectionTypesResponseItem)\n\n\n\n\n\n\n\n\n\n\nexport const getCatalogueControlFlowsResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"group\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"connectionTypeAlias\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish(),\n \"outputSchema\": zod.record(zod.string(), zod.unknown().nullable()).nullish(),\n \"hasDynamicOutputSchema\": zod.boolean(),\n \"outcomes\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string().min(1),\n \"isDefault\": zod.boolean(),\n \"description\": zod.string().nullish()\n})),\n \"hasDynamicOutcomes\": zod.boolean(),\n \"type\": zod.string().min(1)\n})\nexport const getCatalogueControlFlowsResponse = zod.array(getCatalogueControlFlowsResponseItem)\n\n\n\n\n\n\n\nexport const getCatalogueNotificationChannelsResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish()\n})\nexport const getCatalogueNotificationChannelsResponse = zod.array(getCatalogueNotificationChannelsResponseItem)\n\n\nexport const getCatalogueStepTypesQueryParams = zod.object({\n \"type\": zod.string().optional()\n})\n\n\n\n\n\n\n\n\n\nexport const getCatalogueStepTypesResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"group\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"connectionTypeAlias\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish(),\n \"outputSchema\": zod.record(zod.string(), zod.unknown().nullable()).nullish(),\n \"hasDynamicOutputSchema\": zod.boolean(),\n \"outcomes\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string().min(1),\n \"isDefault\": zod.boolean(),\n \"description\": zod.string().nullish()\n})),\n \"hasDynamicOutcomes\": zod.boolean(),\n \"type\": zod.string().min(1)\n})\nexport const getCatalogueStepTypesResponse = zod.array(getCatalogueStepTypesResponseItem)\n\n\nexport const postCatalogueStepTypesByAliasOutcomesParams = zod.object({\n \"alias\": zod.string()\n})\n\nexport const postCatalogueStepTypesByAliasOutcomesBody = zod.object({\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n})\n\n\n\n\n\nexport const postCatalogueStepTypesByAliasOutcomesResponseItem = zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string().min(1),\n \"isDefault\": zod.boolean(),\n \"description\": zod.string().nullish()\n})\nexport const postCatalogueStepTypesByAliasOutcomesResponse = zod.array(postCatalogueStepTypesByAliasOutcomesResponseItem)\n\n\nexport const postCatalogueStepTypesByAliasOutputSchemaParams = zod.object({\n \"alias\": zod.string()\n})\n\nexport const postCatalogueStepTypesByAliasOutputSchemaBody = zod.object({\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n})\n\nexport const postCatalogueStepTypesByAliasOutputSchemaResponse = zod.record(zod.string(), zod.unknown())\n\n\nexport const getCatalogueTriggersQueryParams = zod.object({\n \"workspaceId\": zod.guid().optional()\n})\n\n\n\n\n\n\n\n\n\nexport const getCatalogueTriggersResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"group\": zod.string().nullish(),\n \"icon\": zod.string().nullish(),\n \"connectionTypeAlias\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish(),\n \"outputSchema\": zod.record(zod.string(), zod.unknown().nullable()).nullish(),\n \"hasDynamicOutputSchema\": zod.boolean(),\n \"outcomes\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string().min(1),\n \"isDefault\": zod.boolean(),\n \"description\": zod.string().nullish()\n})),\n \"hasDynamicOutcomes\": zod.boolean(),\n \"type\": zod.string().min(1),\n \"supportsManualRun\": zod.boolean()\n})\nexport const getCatalogueTriggersResponse = zod.array(getCatalogueTriggersResponseItem)\n\n\n\n\n\n\n\nexport const getCatalogueWebhookAuthenticatorsResponseItem = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"description\": zod.string().nullish(),\n \"settingsSchema\": zod.object({\n \"fields\": zod.array(zod.object({\n \"key\": zod.string().min(1),\n \"label\": zod.string(),\n \"description\": zod.string().nullish(),\n \"valueKind\": zod.enum(['String', 'Scalar', 'Collection']),\n \"editorUiAlias\": zod.string().nullish(),\n \"editorConfig\": zod.string().nullish(),\n \"defaultValue\": zod.unknown().nullish(),\n \"sortOrder\": zod.int(),\n \"isSensitive\": zod.boolean(),\n \"isRequired\": zod.boolean(),\n \"group\": zod.string().nullish(),\n \"supportsBindings\": zod.boolean(),\n \"visibleWhen\": zod.object({\n \"key\": zod.string(),\n \"values\": zod.array(zod.string())\n}).nullish()\n}))\n}).nullish()\n})\nexport const getCatalogueWebhookAuthenticatorsResponse = zod.array(getCatalogueWebhookAuthenticatorsResponseItem)\n\n\n\n\n\n\n\nexport const postConnectionsBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"type\": zod.string().min(1),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable())\n})\n\nexport const postConnectionsResponse = zod.void()\n\n\nexport const getConnectionsQuerySkipDefault = 0;\nexport const getConnectionsQueryTakeDefault = 100;\n\nexport const getConnectionsQueryParams = zod.object({\n \"filter\": zod.string().optional(),\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getConnectionsQueryTakeDefault)\n})\n\n\n\n\n\n\nexport const getConnectionsResponse = zod.object({\n \"total\": zod.int(),\n \"items\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"type\": zod.string().min(1),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true})\n}))\n})\n\n\nexport const deleteConnectionsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const deleteConnectionsByIdResponse = zod.unknown()\n\n\nexport const getConnectionsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\n\n\nexport const getConnectionsByIdResponse = zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"type\": zod.string().min(1),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true})\n})\n\n\nexport const putConnectionsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\nexport const putConnectionsByIdBodyOneVersionMax = 2147483647;\n\n\n\nexport const putConnectionsByIdBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"type\": zod.string().min(1),\n \"settings\": zod.record(zod.string(), zod.unknown().nullable()),\n \"version\": zod.int().min(1).max(putConnectionsByIdBodyOneVersionMax)\n})\n\nexport const putConnectionsByIdResponse = zod.unknown()\n\n\nexport const postConnectionsByIdTestParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postConnectionsByIdTestResponse = zod.object({\n \"status\": zod.enum(['Success', 'Warning', 'Failure']),\n \"message\": zod.string().nullish(),\n \"details\": zod.array(zod.string())\n})\n\n\nexport const getMetricsQueryParams = zod.object({\n \"workspaceId\": zod.guid().optional(),\n \"from\": zod.iso.datetime({\"local\":true,\"offset\":true}).optional(),\n \"to\": zod.iso.datetime({\"local\":true,\"offset\":true}).optional()\n})\n\nexport const getMetricsResponse = zod.object({\n \"totalRuns\": zod.int(),\n \"byStatus\": zod.object({\n \"Pending\": zod.int(),\n \"Running\": zod.int(),\n \"Completed\": zod.int(),\n \"Failed\": zod.int(),\n \"Suspended\": zod.int(),\n \"Cancelled\": zod.int(),\n \"Rejected\": zod.int()\n}),\n \"successRate\": zod.number()\n})\n\n\nexport const getMetricsByAutomationQueryTakeDefault = 10;\n\nexport const getMetricsByAutomationQueryParams = zod.object({\n \"workspaceId\": zod.guid().optional(),\n \"from\": zod.iso.datetime({\"local\":true,\"offset\":true}).optional(),\n \"to\": zod.iso.datetime({\"local\":true,\"offset\":true}).optional(),\n \"take\": zod.coerce.number().int().default(getMetricsByAutomationQueryTakeDefault)\n})\n\nexport const getMetricsByAutomationResponseItem = zod.object({\n \"automationId\": zod.guid(),\n \"automationName\": zod.string(),\n \"totalRuns\": zod.int(),\n \"successCount\": zod.int(),\n \"failCount\": zod.int()\n})\nexport const getMetricsByAutomationResponse = zod.array(getMetricsByAutomationResponseItem)\n\n\nexport const getRunsQuerySkipDefault = 0;\nexport const getRunsQueryTakeDefault = 100;\n\nexport const getRunsQueryParams = zod.object({\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getRunsQueryTakeDefault)\n})\n\n\n\n\n\nexport const getRunsResponse = zod.object({\n \"total\": zod.int(),\n \"items\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"automationId\": zod.guid(),\n \"automationName\": zod.string().min(1),\n \"automationVersion\": zod.int(),\n \"status\": zod.enum(['Pending', 'Running', 'Completed', 'Failed', 'Suspended', 'Cancelled', 'Rejected']),\n \"startedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"completedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"initiatedBy\": zod.string().min(1),\n \"correlationId\": zod.string().nullish(),\n \"error\": zod.string().nullish()\n}))\n})\n\n\nexport const getRunsByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\n\n\nexport const getRunsByIdResponse = zod.object({\n \"id\": zod.guid(),\n \"automationId\": zod.guid(),\n \"automationVersion\": zod.int(),\n \"status\": zod.enum(['Pending', 'Running', 'Completed', 'Failed', 'Suspended', 'Cancelled', 'Rejected']),\n \"startedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"completedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"initiatedBy\": zod.string().min(1),\n \"correlationId\": zod.string().nullish(),\n \"error\": zod.string().nullish(),\n \"triggerAlias\": zod.string().nullish(),\n \"stepRuns\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"stepId\": zod.guid(),\n \"actionAlias\": zod.string().min(1),\n \"status\": zod.enum(['Pending', 'Running', 'Completed', 'Failed', 'Skipped', 'WaitingForInput', 'Sleeping', 'Rejected', 'Cancelled']),\n \"startedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"completedUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}).nullish(),\n \"error\": zod.string().nullish(),\n \"retryCount\": zod.int(),\n \"durationMs\": zod.number().nullish(),\n \"branchOutcome\": zod.string().nullish(),\n \"iterationIndex\": zod.int().nullish(),\n \"iterationTotal\": zod.int().nullish(),\n \"logEntries\": zod.array(zod.object({\n \"timestampUtc\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"level\": zod.enum(['Debug', 'Info', 'Warning', 'Error']),\n \"message\": zod.string().min(1)\n}))\n}))\n})\n\n\nexport const postRunsByIdReplayParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postRunsByIdReplayResponse = zod.void()\n\n\nexport const postRunsByIdResumeParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postRunsByIdResumeResponse = zod.void()\n\n\nexport const getRunsByIdStepRunsByStepRunIdDataParams = zod.object({\n \"id\": zod.guid(),\n \"stepRunId\": zod.guid()\n})\n\nexport const getRunsByIdStepRunsByStepRunIdDataResponse = zod.object({\n \"input\": zod.string().nullish(),\n \"inputTruncated\": zod.boolean(),\n \"output\": zod.string().nullish(),\n \"outputTruncated\": zod.boolean()\n})\n\n\nexport const postRunsByIdSuspendParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postRunsByIdSuspendResponse = zod.void()\n\n\nexport const postRunsByIdTerminateParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const postRunsByIdTerminateResponse = zod.void()\n\n\nexport const getRunsByIdTriggerDataParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const getRunsByIdTriggerDataResponse = zod.object({\n \"triggerData\": zod.string().nullish(),\n \"triggerDataTruncated\": zod.boolean()\n})\n\n\nexport const getVersionHistoryByEntityTypeByEntityIdParams = zod.object({\n \"entityType\": zod.string(),\n \"entityId\": zod.guid()\n})\n\nexport const getVersionHistoryByEntityTypeByEntityIdQuerySkipDefault = 0;\nexport const getVersionHistoryByEntityTypeByEntityIdQueryTakeDefault = 10;\n\nexport const getVersionHistoryByEntityTypeByEntityIdQueryParams = zod.object({\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getVersionHistoryByEntityTypeByEntityIdQueryTakeDefault)\n})\n\nexport const getVersionHistoryByEntityTypeByEntityIdResponse = zod.object({\n \"currentVersion\": zod.int(),\n \"totalVersions\": zod.int(),\n \"publishedVersion\": zod.int().nullish(),\n \"versions\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"entityId\": zod.guid(),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"createdByUserId\": zod.guid().nullish(),\n \"changeDescription\": zod.string().nullish(),\n \"isPublished\": zod.boolean()\n}))\n})\n\n\nexport const getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams = zod.object({\n \"entityType\": zod.string(),\n \"entityId\": zod.guid(),\n \"entityVersion\": zod.int()\n})\n\nexport const getVersionHistoryByEntityTypeByEntityIdByEntityVersionResponse = zod.object({\n \"id\": zod.guid(),\n \"entityId\": zod.guid(),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"createdByUserId\": zod.guid().nullish(),\n \"changeDescription\": zod.string().nullish(),\n \"isPublished\": zod.boolean()\n})\n\n\nexport const postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams = zod.object({\n \"entityType\": zod.string(),\n \"entityId\": zod.guid(),\n \"entityVersion\": zod.int()\n})\n\nexport const postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackResponse = zod.void()\n\n\nexport const getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams = zod.object({\n \"entityType\": zod.string(),\n \"entityId\": zod.guid(),\n \"fromEntityVersion\": zod.int(),\n \"toEntityVersion\": zod.int()\n})\n\n\n\n\nexport const getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionResponse = zod.object({\n \"fromVersion\": zod.int(),\n \"toVersion\": zod.int(),\n \"changes\": zod.array(zod.object({\n \"path\": zod.string().min(1),\n \"oldValue\": zod.string().nullish(),\n \"newValue\": zod.string().nullish()\n}))\n})\n\n\nexport const getVersionHistorySupportedTypesResponseItem = zod.string()\nexport const getVersionHistorySupportedTypesResponse = zod.array(getVersionHistorySupportedTypesResponseItem)\n\n\n\n\n\n\nexport const postWorkspacesBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"serviceAccountKey\": zod.guid(),\n \"userGroups\": zod.array(zod.guid()),\n \"allowedConnections\": zod.array(zod.guid())\n})\n\nexport const postWorkspacesResponse = zod.void()\n\n\nexport const getWorkspacesQuerySkipDefault = 0;\nexport const getWorkspacesQueryTakeDefault = 100;\n\nexport const getWorkspacesQueryParams = zod.object({\n \"filter\": zod.string().optional(),\n \"skip\": zod.coerce.number().int().optional(),\n \"take\": zod.coerce.number().int().default(getWorkspacesQueryTakeDefault)\n})\n\n\n\n\n\nexport const getWorkspacesResponse = zod.object({\n \"total\": zod.int(),\n \"items\": zod.array(zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"serviceAccountKey\": zod.guid(),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true})\n}))\n})\n\n\nexport const deleteWorkspacesByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const deleteWorkspacesByIdResponse = zod.unknown()\n\n\nexport const getWorkspacesByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\n\nexport const getWorkspacesByIdResponse = zod.object({\n \"id\": zod.guid(),\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"serviceAccountKey\": zod.guid(),\n \"userGroups\": zod.array(zod.guid()),\n \"allowedConnections\": zod.array(zod.guid()),\n \"version\": zod.int(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true}),\n \"dateModified\": zod.iso.datetime({\"local\":true,\"offset\":true})\n})\n\n\nexport const putWorkspacesByIdParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\nexport const putWorkspacesByIdBodyOneVersionMax = 2147483647;\n\n\n\nexport const putWorkspacesByIdBody = zod.object({\n \"alias\": zod.string().min(1),\n \"name\": zod.string().min(1),\n \"serviceAccountKey\": zod.guid(),\n \"userGroups\": zod.array(zod.guid()),\n \"allowedConnections\": zod.array(zod.guid()),\n \"version\": zod.int().min(1).max(putWorkspacesByIdBodyOneVersionMax)\n})\n\nexport const putWorkspacesByIdResponse = zod.unknown()\n\n\nexport const postWorkspacesByIdGroupsParams = zod.object({\n \"id\": zod.guid()\n})\n\n\n\n\nexport const postWorkspacesByIdGroupsBody = zod.object({\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish()\n})\n\nexport const postWorkspacesByIdGroupsResponse = zod.void()\n\n\nexport const getWorkspacesByIdGroupsParams = zod.object({\n \"id\": zod.guid()\n})\n\nexport const getWorkspacesByIdGroupsQueryParams = zod.object({\n \"parentGroupId\": zod.guid().optional()\n})\n\n\n\n\nexport const getWorkspacesByIdGroupsResponseItem = zod.object({\n \"id\": zod.guid(),\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish(),\n \"workspaceId\": zod.guid(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true})\n})\nexport const getWorkspacesByIdGroupsResponse = zod.array(getWorkspacesByIdGroupsResponseItem)\n\n\nexport const deleteWorkspacesByIdGroupsByGroupIdParams = zod.object({\n \"id\": zod.guid(),\n \"groupId\": zod.guid()\n})\n\nexport const deleteWorkspacesByIdGroupsByGroupIdResponse = zod.unknown()\n\n\nexport const getWorkspacesByIdGroupsByGroupIdParams = zod.object({\n \"id\": zod.guid(),\n \"groupId\": zod.guid()\n})\n\n\n\n\nexport const getWorkspacesByIdGroupsByGroupIdResponse = zod.object({\n \"id\": zod.guid(),\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish(),\n \"workspaceId\": zod.guid(),\n \"dateCreated\": zod.iso.datetime({\"local\":true,\"offset\":true})\n})\n\n\nexport const putWorkspacesByIdGroupsByGroupIdParams = zod.object({\n \"id\": zod.guid(),\n \"groupId\": zod.guid()\n})\n\n\n\n\nexport const putWorkspacesByIdGroupsByGroupIdBody = zod.object({\n \"name\": zod.string().min(1),\n \"parentId\": zod.guid().nullish()\n})\n\nexport const putWorkspacesByIdGroupsByGroupIdResponse = zod.unknown()\n","/**\n * List Pending Approvals Tool\n *\n * Lists all workflow run steps that are currently waiting on a human\n * approve/reject decision, across every automation the caller can see.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getApprovalsPendingResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getApprovalsPendingResponse });\n\nconst listPendingApprovalsTool = {\n name: \"list-pending-approvals\",\n description:\n \"Lists workflow run steps that are currently paused and waiting for a human approve/reject decision. Each item includes the runId and stepId needed to submit a decision, plus the automation it belongs to and the prompt shown to the approver. Use this to find what is blocked on approval before calling decide-approval-step.\",\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n outputSchema,\n handler: async () => {\n return executeGetItemsApiCall<\n ReturnType<ApiClient[\"getApprovalsPending\"]>,\n ApiClient\n >((client) => client.getApprovalsPending(CAPTURE_RAW_HTTP_RESPONSE));\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(listPendingApprovalsTool);\n","/**\n * Decide Approval Step Tool\n *\n * Submits a human approve/reject decision for a workflow run step that is\n * currently paused waiting for approval.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n postApprovalsByRunIdStepsByStepIdDecisionParams,\n postApprovalsByRunIdStepsByStepIdDecisionBody,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n runId: postApprovalsByRunIdStepsByStepIdDecisionParams.shape.runId.describe(\n \"ID of the paused workflow run, from list-pending-approvals.\",\n ),\n stepId: postApprovalsByRunIdStepsByStepIdDecisionParams.shape.stepId.describe(\n \"ID of the pending approval step within the run, from list-pending-approvals.\",\n ),\n outcome: postApprovalsByRunIdStepsByStepIdDecisionBody.shape.outcome.describe(\n \"The decision: 'Approved' resumes the run past this step, 'Rejected' fails the run at this step.\",\n ),\n comment: postApprovalsByRunIdStepsByStepIdDecisionBody.shape.comment.describe(\n \"Optional free-text reason or note to record alongside the decision.\",\n ),\n};\n\nconst DecideApprovalStepTool = {\n name: \"decide-approval-step\",\n description:\n \"Submits a human approve/reject decision for a workflow run step that is currently \" +\n \"paused waiting for approval. Get the runId and stepId from list-pending-approvals — \" +\n \"only steps returned by that tool are valid targets. Setting outcome to 'Approved' \" +\n \"unblocks the run so it continues past this step; 'Rejected' fails the run at this \" +\n \"step. Not idempotent — a step can only be decided once, so calling this again for a \" +\n \"step that has already been decided will error rather than silently succeed.\",\n inputSchema,\n slices: [\"action\"],\n annotations: {\n idempotentHint: false,\n },\n handler: async ({ runId, stepId, outcome, comment }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postApprovalsByRunIdStepsByStepIdDecision(\n runId,\n stepId,\n { outcome, comment },\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(DecideApprovalStepTool);\n","/**\n * Approvals Tool Collection\n *\n * Tools for finding and deciding workflow run steps that are paused waiting\n * on a human approve/reject decision.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport listPendingApprovalsTool from \"./get/list-pending-approvals.js\";\nimport decideApprovalStepTool from \"./post/decide-approval-step.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"approvals\",\n displayName: \"Approvals\",\n description:\n \"Find workflow run steps paused waiting for human approval, and submit approve/reject decisions to unblock or fail them.\",\n },\n tools: () => [listPendingApprovalsTool, decideApprovalStepTool],\n};\n\nexport default collection;\n","/**\n * List Automations Tool\n *\n * Lists automations, optionally filtered by name/alias, workspace, or group.\n * Returns a page of summary items (not the full step graph) - use\n * get-automation to fetch the full definition of a specific automation.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsQueryParams,\n getAutomationsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsQueryParams.shape,\n filter: getAutomationsQueryParams.shape.filter.describe(\n \"Optional text matched against automation name and alias.\",\n ),\n groupId: getAutomationsQueryParams.shape.groupId.describe(\n \"Optional. Only return automations filed in this workspace group.\",\n ),\n workspaceId: getAutomationsQueryParams.shape.workspaceId.describe(\n \"Optional. Only return automations in this workspace (id from list-workspaces).\",\n ),\n};\n\nconst listAutomationsTool = {\n name: \"list-automations\",\n description:\n \"Lists automations with optional filtering by name/alias (filter), workspaceId, or groupId, with cursor paging (pass nextCursor from the previous response). Each item is a summary (id, alias, name, status, health, triggerAlias, version) - use get-automation with the returned id to fetch the full step/connection graph before editing.\",\n inputSchema,\n outputSchema: getAutomationsResponse,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async (params) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getAutomations\"]>, ApiClient>(\n (client) => client.getAutomations(params, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getAutomationsResponse\n>;\n\nexport default withStandardDecorators(listAutomationsTool);\n","/**\n * Get Automation Tool\n *\n * Fetches the full definition of a single automation, including its trigger,\n * steps, connections, canvas state and notification settings. This is the\n * \"current version\" the LLM should read before calling update-automation, so\n * no properties are accidentally dropped when saving changes back.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsByIdParams,\n getAutomationsByIdResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsByIdParams.shape,\n id: getAutomationsByIdParams.shape.id.describe(\n \"Id of the automation (from list-automations or create-automation).\",\n ),\n};\n\nconst getAutomationTool = {\n name: \"get-automation\",\n description:\n \"Gets the full definition of an automation by id: trigger, steps, connections, canvas state, notification settings, status, health and version. Read this before calling update-automation so the full body (including steps/connections) is preserved when saving.\",\n inputSchema,\n outputSchema: getAutomationsByIdResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getAutomationsById\"]>, ApiClient>(\n (client) => client.getAutomationsById(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getAutomationsByIdResponse\n>;\n\nexport default withStandardDecorators(getAutomationTool);\n","/**\n * Get Automation Ancestors Tool\n *\n * Lists the folder/group ancestry of an automation, from its immediate parent\n * up to the workspace root. Use this to show breadcrumbs or to find the\n * groupId chain above an automation.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsByIdAncestorsParams,\n getAutomationsByIdAncestorsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getAutomationsByIdAncestorsResponse });\n\nconst inputSchema = {\n ...getAutomationsByIdAncestorsParams.shape,\n id: getAutomationsByIdAncestorsParams.shape.id.describe(\n \"Id of the automation (from list-automations or create-automation).\",\n ),\n};\n\nconst getAutomationAncestorsTool = {\n name: \"get-automation-ancestors\",\n description:\n \"Lists the ancestor entities (workspace groups/folders) above an automation, ordered from the immediate parent up to the root. Use this to build breadcrumbs or to discover the groupId hierarchy an automation lives in.\",\n inputSchema,\n outputSchema,\n slices: [\"tree\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n return executeGetItemsApiCall<\n ReturnType<ApiClient[\"getAutomationsByIdAncestors\"]>,\n ApiClient\n >((client) => client.getAutomationsByIdAncestors(id, CAPTURE_RAW_HTTP_RESPONSE));\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(getAutomationAncestorsTool);\n","/**\n * Export Automation Tool\n *\n * Exports an automation as a portable definition (trigger, steps, connections,\n * canvas state, notification settings and referenced connection types) that\n * can be re-imported into this or another workspace via import-automation,\n * import-automation-into-existing, or validate-automation-import.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsByIdExportParams,\n getAutomationsByIdExportQueryParams,\n getAutomationsByIdExportResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport type { GetAutomationsByIdExportParams } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsByIdExportParams.shape,\n ...getAutomationsByIdExportQueryParams.shape,\n id: getAutomationsByIdExportParams.shape.id.describe(\n \"Id of the automation to export.\",\n ),\n include: getAutomationsByIdExportQueryParams.shape.include.describe(\n \"Optional. Limits which parts of the automation are exported. Omit to export everything.\",\n ),\n};\n\nconst exportAutomationTool = {\n name: \"export-automation\",\n description:\n \"Exports an automation as a portable definition (trigger, steps, connections, canvas state, notification settings, referenced connection types) suitable for backup or moving to another workspace. Optionally scope what's included via 'include'. Re-import the result with import-automation (new automation) or import-automation-into-existing (overwrite an existing one), or dry-run it first with validate-automation-import.\",\n inputSchema,\n outputSchema: getAutomationsByIdExportResponse,\n slices: [\"export\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id, include }) => {\n const params: GetAutomationsByIdExportParams = { include };\n return executeGetApiCall<\n ReturnType<ApiClient[\"getAutomationsByIdExport\"]>,\n ApiClient\n >((client) =>\n client.getAutomationsByIdExport(id, params, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof getAutomationsByIdExportResponse>;\n\nexport default withStandardDecorators(exportAutomationTool);\n","/**\n * List Automation Runs Tool\n *\n * Lists past and in-progress runs (executions) of a single automation, each\n * with its step-level run history. Use trigger-automation to start a new run.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsByIdRunsParams,\n getAutomationsByIdRunsQueryParams,\n getAutomationsByIdRunsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport type { GetAutomationsByIdRunsParams } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsByIdRunsParams.shape,\n ...getAutomationsByIdRunsQueryParams.shape,\n id: getAutomationsByIdRunsParams.shape.id.describe(\n \"Id of the automation whose runs to list.\",\n ),\n};\n\nconst listAutomationRunsTool = {\n name: \"list-automation-runs\",\n description:\n \"Lists runs (executions) of an automation, newest first, with cursor paging (pass nextCursor from the previous response). Each run includes its status, timing, correlation id, error (if any), and a full step-by-step run history. Use this to investigate whether/how an automation has been executing, or to check the outcome of a run started via trigger-automation.\",\n inputSchema,\n outputSchema: getAutomationsByIdRunsResponse,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id, skip, take }) => {\n const params: GetAutomationsByIdRunsParams = { skip, take };\n return executeGetApiCall<\n ReturnType<ApiClient[\"getAutomationsByIdRuns\"]>,\n ApiClient\n >((client) =>\n client.getAutomationsByIdRuns(id, params, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof getAutomationsByIdRunsResponse>;\n\nexport default withStandardDecorators(listAutomationRunsTool);\n","/**\n * The Umbraco base URL the stdio server's API client was initialized with.\n *\n * Set once by `src/index.ts`; tools that need an absolute URL the API doesn't\n * return read it here. Deliberately not set by the hosted Worker: it serves\n * several sites from one isolate, so a module-level value would leak one\n * request's site into another's — tools must treat `undefined` as \"unknown\".\n */\nimport { normalizeBaseUrl } from \"@umbraco-cms/mcp-server-sdk\";\n\nlet umbracoBaseUrl: string | undefined;\n\nexport function setUmbracoBaseUrl(baseUrl: string | undefined): void {\n umbracoBaseUrl = baseUrl ? normalizeBaseUrl(baseUrl) : undefined;\n}\n\nexport function getUmbracoBaseUrl(): string | undefined {\n return umbracoBaseUrl;\n}\n","/**\n * Automate Version Gates\n *\n * Some Automate features arrived partway through a major line, and each major line got\n * them at its own minor: the 17.x and 18.x lines are released side by side, so 17.N\n * carries the same features as 18.N. A single \"18.3 or later\" check would wrongly refuse\n * a feature on Automate 17.4, so every gate looks up the minimum for the connected major.\n *\n * Minimums were read from the published Umbraco.Automate packages (runtime assemblies and\n * backoffice client sources) for every 17.x and 18.x release.\n */\n\nimport {\n UmbracoManagementClient,\n CAPTURE_RAW_HTTP_RESPONSE,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\n\n/** The first Automate version with each feature, per major. */\nexport const AUTOMATE_FEATURE_MIN_VERSIONS = {\n /**\n * \"approved\" / \"rejected\" outputs on Request Approval. Before them the step has one\n * plain output that runs on approval, and a rejection fails the run.\n */\n approvalOutcomes: { 17: \"17.2.0\", 18: \"18.2.0\" },\n /** A \"done\" output on While/ForEach/Parallel that runs once after the container. */\n containerDone: { 17: \"17.3.0\", 18: \"18.3.0\" },\n /** GET /automations/{id}/webhook-url. */\n webhookUrlEndpoint: { 17: \"17.4.0\", 18: \"18.4.0\" },\n /** TriggerItemResponseModel.supportsManualRun. */\n triggerSupportsManualRun: { 17: \"17.4.0\", 18: \"18.4.0\" },\n} as const satisfies Record<string, Record<number, string>>;\n\nexport type AutomateFeature = keyof typeof AUTOMATE_FEATURE_MIN_VERSIONS;\n\ntype Version = [major: number, minor: number, patch: number];\n\nfunction parseVersion(version: string | undefined): Version | undefined {\n const [major, minor, patch = 0] = (version ?? \"\").split(/[.+-]/).map(Number);\n if (!Number.isFinite(major) || !Number.isFinite(minor) || !Number.isFinite(patch)) return undefined;\n return [major, minor, patch];\n}\n\nfunction compareVersions(a: Version, b: Version): number {\n return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];\n}\n\n/**\n * Whether an Automate version has a feature. A major newer than any in the table has it;\n * an older one does not. An unreadable version is assumed to have it, so a missing\n * manifest entry never blocks a call.\n */\nexport function automateVersionSupports(feature: AutomateFeature, version: string | undefined): boolean {\n const installed = parseVersion(version);\n if (!installed) return true;\n\n const minimums: Record<number, string> = AUTOMATE_FEATURE_MIN_VERSIONS[feature];\n const minimum = parseVersion(minimums[installed[0]]);\n if (minimum) return compareVersions(installed, minimum) >= 0;\n\n const majors = Object.keys(minimums).map(Number);\n return installed[0] > Math.max(...majors);\n}\n\n/** The feature's minimum on the installed version's major (\"17.3\"), or undefined if the major isn't in the table. */\nexport function minimumAutomateVersion(feature: AutomateFeature, version: string | undefined): string | undefined {\n const major = parseVersion(version)?.[0];\n const minimum = major === undefined ? undefined : (AUTOMATE_FEATURE_MIN_VERSIONS[feature] as Record<number, string>)[major];\n return minimum?.replace(/\\.0$/, \"\");\n}\n\n/** \"17.3+ (Umbraco 17) / 18.3+ (Umbraco 18)\" - for messages that don't know the installed version. */\nexport function describeMinimumAutomateVersion(feature: AutomateFeature): string {\n return Object.entries(AUTOMATE_FEATURE_MIN_VERSIONS[feature] as Record<number, string>)\n .map(([major, version]) => `${version.replace(/\\.0$/, \"\")}+ (Umbraco ${major})`)\n .join(\" / \");\n}\n\n/** The installed Automate version, from the backoffice package manifest; undefined if it can't be read. */\nexport async function getAutomateVersion(): Promise<string | undefined> {\n try {\n const response = (await UmbracoManagementClient<{ id?: string; version?: string }[]>(\n { method: \"GET\", url: \"/umbraco/management/api/v1/manifest/manifest\" },\n CAPTURE_RAW_HTTP_RESPONSE,\n )) as unknown as HttpResponse<{ id?: string; version?: string }[]>;\n return response.data?.find?.((p) => p.id === \"Umbraco.Automate\")?.version;\n } catch {\n return undefined;\n }\n}\n","/**\n * Get Automation Webhook URL Tool\n *\n * Returns the inbound webhook URL for an automation that is triggered by an\n * incoming HTTP request. Only meaningful for automations whose trigger is\n * webhook-based - give this URL to the external system that should call it.\n *\n * The webhook-url endpoint only exists from Umbraco Automate 17.4 / 18.4 (see\n * AUTOMATE_FEATURE_MIN_VERSIONS). Older versions answer it with a bare 404 (no\n * problem details), while the public receiver at /automate/webhook/{id} works\n * the same on all of them, so on those versions the URL is derived instead of\n * failing.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n createToolResult,\n UmbracoApiError,\n CAPTURE_RAW_HTTP_RESPONSE,\n getApiClient,\n type ToolDefinition,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsByIdWebhookUrlParams,\n getAutomationsByIdWebhookUrlResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport { getUmbracoBaseUrl } from \"../../../../config/umbraco-base-url.js\";\nimport { describeMinimumAutomateVersion } from \"../_shared/automate-version.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsByIdWebhookUrlParams.shape,\n id: getAutomationsByIdWebhookUrlParams.shape.id.describe(\n \"Id of the automation (from list-automations or create-automation).\",\n ),\n};\n\nconst outputSchema = getAutomationsByIdWebhookUrlResponse.extend({\n note: z\n .string()\n .optional()\n .describe(\"Present when the URL was derived rather than reported by Umbraco.\"),\n});\n\nconst WEBHOOK_RECEIVER_PATH = \"/automate/webhook\";\n\n// A missing route 404s with no problem-details body; a missing automation 404s with one.\nconst isMissingEndpoint = (response: HttpResponse) =>\n response.status === 404 &&\n !(response.data && typeof response.data === \"object\" && \"title\" in response.data);\n\nconst throwApiError = (response: HttpResponse): never => {\n throw new UmbracoApiError(\n (response.data as Record<string, unknown> | undefined) || {\n status: response.status,\n detail: response.statusText,\n },\n );\n};\n\nconst getAutomationWebhookUrlTool = {\n name: \"get-automation-webhook-url\",\n description:\n \"Gets the inbound webhook URL for an automation whose trigger is webhook-based. Share this URL with the external system that should invoke the automation. For automations with a different trigger type, this endpoint is not meaningful.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n const client = getApiClient<ApiClient>();\n const response = (await client.getAutomationsByIdWebhookUrl(\n id,\n CAPTURE_RAW_HTTP_RESPONSE,\n )) as unknown as HttpResponse<z.infer<typeof getAutomationsByIdWebhookUrlResponse>>;\n\n if (response.status === 200) {\n return createToolResult(response.data);\n }\n if (!isMissingEndpoint(response)) {\n return throwApiError(response);\n }\n\n // No endpoint: confirm the automation exists so an unknown id still errors as it does with one.\n const automation = (await client.getAutomationsById(\n id,\n CAPTURE_RAW_HTTP_RESPONSE,\n )) as unknown as HttpResponse;\n if (automation.status !== 200) {\n return throwApiError(automation);\n }\n\n const path = `${WEBHOOK_RECEIVER_PATH}/${id}`;\n const baseUrl = getUmbracoBaseUrl();\n const versionNote = `this Umbraco Automate version does not report webhook URLs (that needs ${describeMinimumAutomateVersion(\"webhookUrlEndpoint\")}).`;\n return createToolResult({\n url: baseUrl ? `${baseUrl}${path}` : path,\n note: baseUrl\n ? `Derived from the configured Umbraco base URL: ${versionNote} If the site's public domain differs from that base URL, use the public domain instead.`\n : `Path relative to the Umbraco site's public URL: ${versionNote}`,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(getAutomationWebhookUrlTool);\n","/**\n * Get Automation Group Tool\n *\n * Fetches a single workspace group (folder) that automations can be\n * organized under. Use list-automations with groupId to see the automations\n * inside a group, and get-automation-ancestors to find a group's parents.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getAutomationsGroupsByGroupIdParams,\n getAutomationsGroupsByGroupIdResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getAutomationsGroupsByGroupIdParams.shape,\n groupId: getAutomationsGroupsByGroupIdParams.shape.groupId.describe(\n \"Id of the workspace group (an automation's groupId, or an id from list-workspace-groups).\",\n ),\n};\n\nconst getAutomationGroupTool = {\n name: \"get-automation-group\",\n description:\n \"Gets a single workspace group (folder used to organize automations) by id, including its parent group and owning workspace. Use list-automations with groupId to list the automations inside this group.\",\n inputSchema,\n outputSchema: getAutomationsGroupsByGroupIdResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ groupId }) => {\n return executeGetApiCall<\n ReturnType<ApiClient[\"getAutomationsGroupsByGroupId\"]>,\n ApiClient\n >((client) =>\n client.getAutomationsGroupsByGroupId(groupId, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getAutomationsGroupsByGroupIdResponse\n>;\n\nexport default withStandardDecorators(getAutomationGroupTool);\n","/**\n * Create Automation Tool\n *\n * Creates a new, empty draft automation (no trigger, steps or connections\n * yet) inside a workspace. The automation is created in Draft status and is\n * not live until publish-automation is called. Build out the trigger and\n * step graph afterwards with set-automation-trigger, add-automation-step,\n * and connect-automation-steps - this tool only reserves the\n * alias/name/id.\n */\n\nimport {\n withStandardDecorators,\n createToolResult,\n getApiClient,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport type { CreateAutomationRequestModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n alias: z\n .string()\n .min(1)\n .describe(\"Unique, code-friendly alias for the automation (e.g. 'notify-on-publish').\"),\n name: z.string().min(1).describe(\"Human-readable display name.\"),\n description: z\n .string()\n .optional()\n .describe(\"Optional description of what this automation does.\"),\n workspaceId: z\n .string()\n .uuid()\n .describe(\n \"Id of the workspace this automation belongs to. Not validated against existing workspaces at creation time (verified against the live API) - pass an id from list-workspaces/get-workspace to avoid creating an automation under a workspace that doesn't exist.\"\n ),\n groupId: z\n .string()\n .uuid()\n .optional()\n .describe(\"Optional id of the workspace group (folder) to create the automation in.\"),\n};\n\ntype CreateAutomationParams = {\n alias: string;\n name: string;\n description?: string;\n workspaceId: string;\n groupId?: string;\n};\n\nconst outputSchema = z.object({\n message: z.string(),\n id: z.string().uuid(),\n});\n\nconst createAutomationTool = {\n name: \"create-automation\",\n description:\n \"Creates a new draft automation with no trigger, steps or connections yet - just alias, name, description and workspace/group placement. The automation starts in Draft status and has no effect until it has a trigger and steps configured and publish-automation is called. Follow up with set-automation-trigger, then add-automation-step and connect-automation-steps to build out the graph.\",\n inputSchema,\n outputSchema,\n slices: [\"create\"],\n handler: async (model: CreateAutomationParams) => {\n const client = getApiClient<ApiClient>();\n\n const body: CreateAutomationRequestModel = {\n alias: model.alias,\n name: model.name,\n description: model.description ?? null,\n workspaceId: model.workspaceId,\n groupId: model.groupId ?? null,\n trigger: null,\n steps: [],\n connections: [],\n canvasState: null,\n notificationSettings: null,\n };\n\n const response = (await client.postAutomations(\n body,\n CAPTURE_RAW_HTTP_RESPONSE,\n )) as unknown as HttpResponse;\n\n const locationHeader =\n response.headers?.location || response.headers?.Location;\n if (!locationHeader) {\n throw new Error(\n \"No Location header in response - cannot determine created automation ID\",\n );\n }\n\n const idMatch = locationHeader.match(/\\/([a-f0-9-]{36})$/i);\n if (!idMatch) {\n throw new Error(\n `Could not extract ID from Location header: ${locationHeader}`,\n );\n }\n\n return createToolResult({\n message: `Automation \"${model.name}\" created successfully`,\n id: idMatch[1],\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(createAutomationTool);\n","/**\n * Publish Automation Tool\n *\n * Publishes the current draft version of an automation, making it live so its\n * trigger becomes active. Has a real side effect: once published, the\n * automation's trigger can fire and start runs. Use unpublish-automation to\n * take it offline again, or re-enable-automation if it was auto-disabled.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postAutomationsByIdPublishParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postAutomationsByIdPublishParams.shape,\n id: postAutomationsByIdPublishParams.shape.id.describe(\n \"Id of the automation to publish. It must already have a trigger and at least one step.\",\n ),\n};\n\nconst publishAutomationTool = {\n name: \"publish-automation\",\n description:\n \"Publishes an automation, making its current version live. This activates the trigger so the automation can start running for real - only use when the automation's trigger, steps and connections are ready. Publishing checks that a trigger is set, the workspace's service account, allowed connections and section access, and that `${steps.…}` bindings name existing steps. It does not check ids inside settings (forms, document types, content), `${trigger.…}` field names or setting values - mistakes there only show up when a run fails. An automation's `health` reflects the error rate of its runs, not whether its configuration is valid. Use unpublish-automation to stop it from running without deleting it.\",\n inputSchema,\n slices: [\"publish\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postAutomationsByIdPublish(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(publishAutomationTool);\n","/**\n * Unpublish Automation Tool\n *\n * Takes a published automation offline: its trigger stops firing and no new\n * runs will start, but the automation, its history and its definition are\n * kept. Use publish-automation to bring it back live.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postAutomationsByIdUnpublishParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postAutomationsByIdUnpublishParams.shape,\n id: postAutomationsByIdUnpublishParams.shape.id.describe(\n \"Id of the automation to unpublish.\",\n ),\n};\n\nconst unpublishAutomationTool = {\n name: \"unpublish-automation\",\n description:\n \"Unpublishes an automation, taking it offline so its trigger stops firing and no new runs can start. The automation definition and run history are preserved - use publish-automation to make it live again.\",\n inputSchema,\n slices: [\"publish\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postAutomationsByIdUnpublish(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(unpublishAutomationTool);\n","/**\n * Re-enable Automation Tool\n *\n * Re-enables an automation that Umbraco auto-disabled after repeated run\n * failures (health = Disabled), letting its trigger fire again. Investigate\n * and fix the underlying cause (see list-automation-runs) before re-enabling,\n * or it may just get disabled again.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postAutomationsByIdReEnableParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postAutomationsByIdReEnableParams.shape,\n id: postAutomationsByIdReEnableParams.shape.id.describe(\n \"Id of the automation to re-enable.\",\n ),\n};\n\nconst reEnableAutomationTool = {\n name: \"re-enable-automation\",\n description:\n \"Re-enables an automation that was automatically disabled by Umbraco after repeated failures (health = Disabled), allowing its trigger to fire again. Check list-automation-runs first to understand why it was disabled - re-enabling without fixing the cause will likely lead to it being disabled again.\",\n inputSchema,\n slices: [\"action\"],\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postAutomationsByIdReEnable(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(reEnableAutomationTool);\n","/**\n * Trigger Automation Tool\n *\n * Manually starts a new run of an automation right now, bypassing its normal\n * trigger condition. Has a real side effect: it executes the automation's\n * steps immediately. Use list-automation-runs afterwards to check the\n * outcome. The automation must be published first (verified against the\n * live API) - publish-automation before calling this on a Draft automation.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postAutomationsByIdTriggerParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postAutomationsByIdTriggerParams.shape,\n id: postAutomationsByIdTriggerParams.shape.id.describe(\n \"Id of the published automation to run now.\",\n ),\n};\n\nconst triggerAutomationTool = {\n name: \"trigger-automation\",\n description:\n \"Manually starts a new run of an automation immediately, bypassing its configured trigger condition. The automation must be published first (publish-automation) - this fails on a Draft or Unpublished automation. Has a real side effect - it executes the automation's steps right now. Use list-automation-runs afterwards to see the resulting run and its outcome.\",\n inputSchema,\n slices: [\"action\"],\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postAutomationsByIdTrigger(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(triggerAutomationTool);\n","/**\n * Import Automation Tool\n *\n * Creates a new automation in a workspace from a previously exported\n * definition (see export-automation). Note: this reuses the exported\n * automation's original id rather than minting a new one (verified against\n * the live API) - importing the same export twice, or into a workspace that\n * already has an automation with that id, will conflict. To overwrite an\n * existing automation in place, use import-automation-into-existing\n * instead. Dry-run the same payload first with validate-automation-import to\n * catch problems (e.g. missing connections) before committing.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n postAutomationsImportBody,\n postAutomationsImportResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport type { ImportAutomationRequestModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: postAutomationsImportBody.shape.workspaceId.describe(\n \"Id of the workspace to create the automation in (from list-workspaces).\",\n ),\n exportModel: z.object(postAutomationsImportBody.shape.exportModel.shape).describe(\n \"The exact object returned by export-automation, passed through unmodified. Not meant to be written by hand.\",\n ),\n};\n\nconst importAutomationTool = {\n name: \"import-automation\",\n description:\n \"Creates a new automation in the given workspace from an exported definition (see export-automation for the exportModel shape). `exportModel` should be the exact object returned by export-automation, passed through unmodified - it is not meant to be hand-authored; to build an automation's graph yourself, use create-automation followed by add-automation-step/connect-automation-steps/set-automation-trigger instead. This reuses the exported automation's original id rather than generating a new one - importing the same export twice, or into a workspace where that id already exists, will fail. Use validate-automation-import first to check for problems without making changes.\",\n inputSchema,\n outputSchema: postAutomationsImportResponse,\n slices: [\"import\"],\n handler: async (model: { workspaceId: string; exportModel: ImportAutomationRequestModel[\"exportModel\"] }) => {\n const body: ImportAutomationRequestModel = {\n workspaceId: model.workspaceId,\n exportModel: model.exportModel,\n };\n return executeGetApiCall<\n ReturnType<ApiClient[\"postAutomationsImport\"]>,\n ApiClient\n >((client) => client.postAutomationsImport(body, CAPTURE_RAW_HTTP_RESPONSE));\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof postAutomationsImportResponse>;\n\nexport default withStandardDecorators(importAutomationTool);\n","/**\n * Validate Automation Import Tool\n *\n * Dry-runs an automation import payload (see export-automation) without\n * actually creating or changing anything - returns whether it would succeed\n * plus any errors/warnings (e.g. missing connections referenced by the\n * export). Use import-automation with the same payload once this reports\n * success.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n postAutomationsImportValidateBody,\n postAutomationsImportValidateResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport type { ImportAutomationRequestModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: postAutomationsImportValidateBody.shape.workspaceId.describe(\n \"Id of the workspace to validate the import against (from list-workspaces).\",\n ),\n exportModel: z.object(postAutomationsImportValidateBody.shape.exportModel.shape).describe(\n \"The exact object returned by export-automation, passed through unmodified. Not meant to be written by hand.\",\n ),\n};\n\nconst validateAutomationImportTool = {\n name: \"validate-automation-import\",\n description:\n \"Validates an automation import payload (see export-automation for the exportModel shape) against a workspace without creating or changing anything. `exportModel` should be the exact object returned by export-automation, passed through unmodified rather than hand-authored. Returns success plus any errors/warnings (e.g. connections referenced by the export that don't exist in this workspace). Call import-automation with the same payload once this reports success.\",\n inputSchema,\n outputSchema: postAutomationsImportValidateResponse,\n slices: [\"import\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async (model: { workspaceId: string; exportModel: ImportAutomationRequestModel[\"exportModel\"] }) => {\n const body: ImportAutomationRequestModel = {\n workspaceId: model.workspaceId,\n exportModel: model.exportModel,\n };\n return executeGetApiCall<\n ReturnType<ApiClient[\"postAutomationsImportValidate\"]>,\n ApiClient\n >((client) =>\n client.postAutomationsImportValidate(body, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof postAutomationsImportValidateResponse>;\n\nexport default withStandardDecorators(validateAutomationImportTool);\n","/**\n * Step Outputs\n *\n * Branching steps expose named outputs, and a connection has to name one exactly the\n * way the backoffice canvas does or it is silently never followed:\n *\n * - If: \"true\" / \"false\" - outcome matching is case-sensitive, so \"True\" never routes.\n * - Switch: each case's Name, plus \"default\".\n * - Request Approval: \"approved\" / \"rejected\".\n * - Containers (While, ForEach, Parallel): \"body\" (runs inside) / \"done\" (runs once\n * after). The runtime routes these by sourceHandle, not outcome - a connection with\n * only an outcome is treated as part of the body.\n *\n * The canvas saves every such connection with sourceHandle and outcome both set to the\n * output name (it also draws edges from sourceHandle), so this does the same. Mirrors\n * getNodeType and the handle constants in the Automate client's model-to-flow.ts.\n */\n\nimport { ToolValidationError } from \"@umbraco-cms/mcp-server-sdk\";\nimport type { StepConfigurationModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { describeMinimumAutomateVersion } from \"./automate-version.js\";\n\nconst IF_ALIAS = \"umbracoAutomate.if\";\nconst SWITCH_ALIAS = \"umbracoAutomate.switch\";\nexport const APPROVAL_ALIAS = \"umbracoAutomate.requestApproval\";\nconst PARALLEL_ALIAS = \"umbracoAutomate.parallel\";\nconst CONTAINER_ALIASES = new Set([\"umbracoAutomate.while\", \"umbracoAutomate.forEach\", PARALLEL_ALIAS]);\n\nexport const BODY_HANDLE = \"body\";\nexport const DONE_HANDLE = \"done\";\n\n// Words a model tends to reach for when it means a container's body or its exit.\nconst CONTAINER_SYNONYMS: Record<string, string> = {\n body: BODY_HANDLE,\n loop: BODY_HANDLE,\n each: BODY_HANDLE,\n iteration: BODY_HANDLE,\n branch: BODY_HANDLE,\n done: DONE_HANDLE,\n after: DONE_HANDLE,\n exit: DONE_HANDLE,\n complete: DONE_HANDLE,\n completed: DONE_HANDLE,\n next: DONE_HANDLE,\n};\n\nfunction switchCaseNames(step: StepConfigurationModel): string[] {\n const cases = (step.settings as Record<string, unknown> | undefined)?.cases;\n if (!Array.isArray(cases)) return [];\n return cases\n .map((c) => (c && typeof c === \"object\" ? (c as Record<string, unknown>).Name ?? (c as Record<string, unknown>).name : undefined))\n .filter((name): name is string => typeof name === \"string\" && name.length > 0);\n}\n\n/** The named outputs of a step, or undefined for a step with a single unnamed output. */\nexport function getStepOutputs(step: StepConfigurationModel): string[] | undefined {\n if (step.actionAlias === IF_ALIAS) return [\"true\", \"false\"];\n if (step.actionAlias === SWITCH_ALIAS) return [...switchCaseNames(step), \"default\"];\n if (step.actionAlias === APPROVAL_ALIAS) return [\"approved\", \"rejected\"];\n if (CONTAINER_ALIASES.has(step.actionAlias)) return [BODY_HANDLE, DONE_HANDLE];\n return undefined;\n}\n\n/**\n * A container's \"done\" output runs a single continuation: the runtime uses the first\n * connection on it and never runs the targets of any others.\n */\nexport function isSingleConnectionOutput(step: StepConfigurationModel, output: string): boolean {\n return CONTAINER_ALIASES.has(step.actionAlias) && output === DONE_HANDLE;\n}\n\n/**\n * Resolves the caller's `outcome` for a connection leaving `step` to the exact output name,\n * returning the sourceHandle/outcome pair to save. `step` is undefined for the trigger.\n * Steps without named outputs keep the previous behaviour: outcome passed through as given.\n */\nexport function resolveConnectionOutput(\n step: StepConfigurationModel | undefined,\n outcome: string | undefined,\n): { sourceHandle: string | null; outcome: string | null } {\n const outputs = step ? getStepOutputs(step) : undefined;\n if (!step || !outputs) {\n return { sourceHandle: null, outcome: outcome ?? null };\n }\n\n const label = step.alias ?? step.id;\n const valid = outputs.map((o) => `\"${o}\"`).join(\", \");\n if (!outcome) {\n throw new ToolValidationError({\n title: \"Outcome required\",\n detail: `Step \"${label}\" (${step.actionAlias}) has named outputs, so connections from it must pass outcome - one of ${valid}.`,\n });\n }\n\n const wanted = outcome.trim();\n const match =\n outputs.find((o) => o === wanted) ??\n outputs.find((o) => o.toLowerCase() === wanted.toLowerCase()) ??\n (CONTAINER_ALIASES.has(step.actionAlias) ? CONTAINER_SYNONYMS[wanted.toLowerCase()] : undefined);\n if (!match) {\n throw new ToolValidationError({\n title: \"Unknown outcome\",\n detail: `Step \"${label}\" (${step.actionAlias}) has no output \"${outcome}\". Valid outcomes: ${valid}.${\n step.actionAlias === SWITCH_ALIAS ? \" Switch outputs are its case names - add the case with update-automation-step first.\" : \"\"\n }`,\n });\n }\n return { sourceHandle: match, outcome: match };\n}\n\n/** Guidance for the `outcome` inputs of the connection tools. */\nexport const OUTCOME_HELP =\n `Which named output of the source step this connection leaves from. Required when the source step has named outputs, and must match one exactly (matching is case-insensitive here and saved in the exact form): If - \"true\"/\"false\"; Switch - one of its case names, or \"default\"; Request Approval - \"approved\"/\"rejected\" (needs Umbraco Automate ${describeMinimumAutomateVersion(\"approvalOutcomes\")}; before that it has a single output that runs on approval - omit outcome); While/ForEach/Parallel - \"body\" (runs inside the loop/branch; \"loop\" also accepted) or \"done\" (runs once afterwards; \"after\" also accepted; needs Umbraco Automate ${describeMinimumAutomateVersion(\"containerDone\")}, before which a container has only a body). Omit for steps with a single output, and for the trigger.`;\n","/**\n * Canvas Layout\n *\n * Positions an automation's trigger and steps for the backoffice canvas (React Flow).\n *\n * The canvas places nodes by their top-left corner and draws smooth-step edges between\n * handles, so an edge is only straight when the source handle and the target handle\n * share an x coordinate - a few pixels off and it gets a visible sideways jog. Getting\n * that right needs each node's rendered size, which depends on its label, so the\n * geometry below mirrors the Automate canvas's own markup and CSS (the node rules are\n * identical across 17.0-17.4 and 18.2-18.4; 17.4's canvas sources match 18.4's byte for\n * byte, and widths were re-measured in the Umbraco 17 backoffice): nodes are `min-width: 220px; max-width: 280px` plus a 1px border, the\n * header is icon + label + action bar, action/container nodes always show the 36-char\n * step id chip (so they always hit the max width), If/Approval/container handles sit\n * at 30%/70% of the bottom edge, and Switch handles sit on the right edge, one per row.\n * Widths were measured in the rendered canvas (label font: Lato 700 14px).\n *\n * The layout is a tidy tree from the trigger: every step sits one fixed gap below the\n * lowest of its parents, children are ordered by the parent's outputs (true/false,\n * case order, body/done) and centred under it, a single child from an off-centre\n * output sits right under that output, and each subtree only takes the width it needs.\n * A step with several parents (a join) is placed under the parent directly above it.\n */\n\nimport type {\n StepConfigurationModel,\n StepConnectionModel,\n} from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getStepOutputs } from \"./step-outputs.js\";\n\n// Same sentinel as automation-graph.ts (not imported from there, which imports this module).\nconst TRIGGER_STEP_ID = \"00000000-0000-0000-0000-000000000000\";\n\n// Spacing between nodes: vertical gap from a parent's bottom edge to a child's top\n// edge (room for the add-action button and edge labels), and horizontal gap between\n// neighbouring subtrees.\nconst VERTICAL_GAP = 72;\nconst HORIZONTAL_GAP = 40;\n// A Switch's outputs leave from its right edge, so its children start just right of it.\nconst SWITCH_CHILD_OFFSET = 32;\n// Space kept below every node for its add-action button.\nconst ADD_BUTTON_ROOM = 28;\n\nconst NODE_MIN_WIDTH = 220;\nconst NODE_MAX_WIDTH = 280;\nconst NODE_BORDER = 2;\n// Header = padding + icon + gaps + label + edit/delete action bar. The edit button\n// (28px) is left out for a trigger with no settings.\nconst HEADER_CHROME = 146;\nconst EDIT_BUTTON_WIDTH = 28;\n// Body = padding + chip padding + monospace (11px) characters.\nconst BODY_CHROME = 28;\nconst CHIP_PADDING = 12;\nconst MONOSPACE_CHAR_WIDTH = 6.6;\n// Switch case rows: padding either side of the label.\nconst SWITCH_ROW_CHROME = 34;\nconst TRIGGER_TAG_WIDTH = 68.3;\n\nconst HEIGHTS = { trigger: 65, action: 115, branch: 117, container: 144 } as const;\nconst SWITCH_HEADER_HEIGHT = 88;\nconst SWITCH_ROW_HEIGHT = 45;\nconst SWITCH_FIRST_HANDLE_Y = 110;\n\nconst APPROVAL_ALIAS = \"umbracoAutomate.requestApproval\";\nconst BRANCH_ALIASES = new Set([\"umbracoAutomate.if\", APPROVAL_ALIAS]);\nconst CONTAINER_ALIASES = new Set([\"umbracoAutomate.while\", \"umbracoAutomate.forEach\", \"umbracoAutomate.parallel\"]);\nconst SWITCH_ALIAS = \"umbracoAutomate.switch\";\n\n// Character advance widths for ASCII 32-126, measured in the canvas.\nconst asciiTable = (csv: string) => csv.split(\",\").map(Number);\nconst LABEL_WIDTHS = asciiTable(\n \"3.4,3.93,5.54,8.12,8.12,11.47,10.13,2.96,3.84,3.84,5.95,8.12,3.28,5.22,3.33,6.52,8.12,8.12,8.12,8.12,8.12,8.12,8.12,8.12,8.12,8.12,3.6,3.79,8.12,8.12,8.12,6.44,11.81,9.72,9.22,9.26,10.65,8.05,7.92,10.16,10.79,4.15,6.01,9.6,7.27,13.23,10.79,11.31,8.67,11.31,9,7.68,8.4,10.39,9.72,14.71,9.39,9.07,8.48,4.39,6.52,4.39,8.12,6.53,5.6,7.11,7.95,6.75,7.95,7.48,5.02,7.39,7.9,3.56,3.56,7.48,3.48,11.72,7.9,8.04,7.95,7.95,5.22,6.15,5.21,7.9,7.39,11.23,7.31,7.38,6.43,4.28,3.65,4.28,8.12\",\n);\nconst CASE_WIDTHS = asciiTable(\n \"3.07,3.23,4.45,6.96,6.96,9.62,8.54,2.45,3.2,3.2,5.1,6.96,2.72,4.46,2.83,5.42,6.96,6.96,6.96,6.96,6.96,6.96,6.96,6.96,6.96,6.96,3,3.14,6.96,6.96,6.96,5.37,10.04,8.12,7.76,8.02,9.13,6.93,6.79,8.77,9.16,3.36,5.07,7.95,6.16,11.14,9.16,9.61,7.21,9.61,7.52,6.51,7.09,8.83,8.12,12.43,7.79,7.49,7.22,3.67,5.42,3.67,6.96,5.51,4.8,5.96,6.72,5.73,6.72,6.34,4.21,6.24,6.7,2.88,2.88,6.1,2.83,9.87,6.7,6.8,6.73,6.72,4.37,5.2,4.3,6.69,6.19,9.43,5.98,6.19,5.42,3.61,3.01,3.61,6.96\",\n);\n\nfunction textWidth(text: string, table: number[]): number {\n const fallback = table[33 + 1] ?? 8; // \"B\"-ish width for characters outside ASCII\n let width = 0;\n for (const ch of text) {\n const code = ch.codePointAt(0) ?? 0;\n width += code >= 32 && code <= 126 ? table[code - 32] : fallback;\n }\n return width;\n}\n\nconst clampWidth = (content: number) =>\n Math.min(NODE_MAX_WIDTH, Math.max(NODE_MIN_WIDTH, content)) + NODE_BORDER;\n\nconst chipWidth = (text: string | null | undefined) =>\n text ? BODY_CHROME + CHIP_PADDING + text.length * MONOSPACE_CHAR_WIDTH : 0;\n\ninterface NodeBox {\n width: number;\n height: number;\n /** Output handle x positions relative to the node's left edge, by output name. */\n outputX: (output: string | null) => number;\n isSwitch: boolean;\n}\n\n// The canvas shows the step's name, or the catalogue name when the name is just the alias.\nfunction stepBox(step: StepConfigurationModel, options: CanvasLayoutOptions): NodeBox {\n const label = step.name ?? step.actionAlias;\n const header = textWidth(label, LABEL_WIDTHS) + HEADER_CHROME;\n\n // Before Request Approval had approved/rejected outputs the canvas drew it as a plain action.\n const isBranch =\n BRANCH_ALIASES.has(step.actionAlias) && (step.actionAlias !== APPROVAL_ALIAS || options.approvalOutcomes !== false);\n if (isBranch) {\n const width = clampWidth(Math.max(header, chipWidth(step.alias)));\n const [first] = getStepOutputs(step) ?? [];\n return {\n width,\n height: HEIGHTS.branch,\n outputX: (o) => (o === first ? 0.3 : 0.7) * width,\n isSwitch: false,\n };\n }\n if (CONTAINER_ALIASES.has(step.actionAlias)) {\n const width = NODE_MAX_WIDTH + NODE_BORDER;\n return { width, height: HEIGHTS.container, outputX: (o) => (o === \"done\" ? 0.7 : 0.3) * width, isSwitch: false };\n }\n if (step.actionAlias === SWITCH_ALIAS) {\n const outputs = getStepOutputs(step) ?? [\"default\"];\n const rows = Math.max(0, ...outputs.map((o) => SWITCH_ROW_CHROME + textWidth(o, CASE_WIDTHS)));\n const width = clampWidth(Math.max(header, chipWidth(step.alias), rows));\n return { width, height: SWITCH_HEADER_HEIGHT + SWITCH_ROW_HEIGHT * outputs.length, outputX: () => width, isSwitch: true };\n }\n const width = NODE_MAX_WIDTH + NODE_BORDER;\n return { width, height: HEIGHTS.action, outputX: () => width / 2, isSwitch: false };\n}\n\n/** How the canvas labels the trigger node: catalogue name (or alias) and whether it shows an edit button. */\nexport interface TriggerLabel {\n name: string;\n hasSettings: boolean;\n}\n\nfunction triggerBox({ name, hasSettings }: TriggerLabel): NodeBox {\n const chrome = HEADER_CHROME - (hasSettings ? 0 : EDIT_BUTTON_WIDTH);\n const width = clampWidth(Math.max(textWidth(name, LABEL_WIDTHS), TRIGGER_TAG_WIDTH) + chrome);\n return { width, height: HEIGHTS.trigger, outputX: () => width / 2, isSwitch: false };\n}\n\n/** Y of each Switch output handle, relative to the node's top (for callers that need it). */\nexport const switchHandleY = (index: number) => SWITCH_FIRST_HANDLE_Y + SWITCH_ROW_HEIGHT * index;\n\ninterface Box {\n x0: number;\n x1: number;\n y0: number;\n y1: number;\n}\n\nexport interface CanvasLayoutOptions {\n /** Whether Request Approval steps have approved/rejected outputs (Automate 17.2 / 18.2+). Defaults to true. */\n approvalOutcomes?: boolean;\n}\n\nexport interface CanvasLayout {\n stepPositions: Record<string, { x: number; y: number }>;\n triggerPosition: { x: number; y: number };\n}\n\nexport function computeCanvasLayout(\n steps: StepConfigurationModel[],\n connections: StepConnectionModel[],\n triggerLabel: TriggerLabel,\n options: CanvasLayoutOptions = {},\n): CanvasLayout {\n const stepById = new Map(steps.map((s) => [s.id, s]));\n const boxes = new Map<string, NodeBox>(steps.map((s) => [s.id, stepBox(s, options)]));\n boxes.set(TRIGGER_STEP_ID, triggerBox(triggerLabel));\n\n // Outgoing connections per node, ordered by the source's outputs (then as saved).\n const outputRank = (sourceId: string, c: StepConnectionModel) => {\n const outputs = stepById.has(sourceId) ? getStepOutputs(stepById.get(sourceId)!) : undefined;\n const name = c.sourceHandle ?? c.outcome ?? null;\n const rank = outputs && name ? outputs.indexOf(name) : -1;\n return rank === -1 ? Number.MAX_SAFE_INTEGER : rank;\n };\n const outgoing = new Map<string, StepConnectionModel[]>();\n const incoming = new Map<string, StepConnectionModel[]>();\n connections.forEach((c) => {\n if (!boxes.has(c.sourceStepId) || !stepById.has(c.targetStepId)) return;\n (outgoing.get(c.sourceStepId) ?? outgoing.set(c.sourceStepId, []).get(c.sourceStepId)!).push(c);\n (incoming.get(c.targetStepId) ?? incoming.set(c.targetStepId, []).get(c.targetStepId)!).push(c);\n });\n for (const [sourceId, list] of outgoing) {\n const order = new Map(list.map((c, i) => [c, i]));\n list.sort((a, b) => outputRank(sourceId, a) - outputRank(sourceId, b) || order.get(a)! - order.get(b)!);\n }\n\n // Top edge of every reachable node: one gap below the lowest parent (Kahn's order, so\n // joins wait for all parents). Nodes on a cycle or not reachable from the trigger stay unset.\n const top = new Map<string, number>([[TRIGGER_STEP_ID, 0]]);\n const pending = new Map(steps.map((s) => [s.id, incoming.get(s.id)?.length ?? 0]));\n const queue = [TRIGGER_STEP_ID];\n while (queue.length) {\n const id = queue.shift()!;\n const bottom = top.get(id)! + boxes.get(id)!.height;\n for (const c of outgoing.get(id) ?? []) {\n top.set(c.targetStepId, Math.max(top.get(c.targetStepId) ?? 0, bottom + VERTICAL_GAP));\n const left = pending.get(c.targetStepId)! - 1;\n pending.set(c.targetStepId, left);\n if (left === 0) queue.push(c.targetStepId);\n }\n }\n const reached = (id: string) => id === TRIGGER_STEP_ID || (pending.get(id) === 0 && top.has(id));\n\n // Tree: each step hangs off the reachable parent directly above it (the lowest one).\n const treeChildren = new Map<string, { id: string; output: string | null }[]>();\n for (const step of steps) {\n if (!reached(step.id)) continue;\n const parents = (incoming.get(step.id) ?? []).filter((c) => reached(c.sourceStepId));\n const primary = parents.reduce<StepConnectionModel | undefined>((best, c) => {\n const bottom = (c: StepConnectionModel) => top.get(c.sourceStepId)! + boxes.get(c.sourceStepId)!.height;\n return !best || bottom(c) > bottom(best) ? c : best;\n }, undefined);\n if (primary) {\n const list = treeChildren.get(primary.sourceStepId) ?? [];\n list.push({ id: step.id, output: primary.sourceHandle ?? primary.outcome ?? null });\n treeChildren.set(primary.sourceStepId, list);\n }\n }\n for (const [parentId, list] of treeChildren) {\n const rank = new Map((outgoing.get(parentId) ?? []).map((c, i) => [c.targetStepId, i]));\n list.sort((a, b) => (rank.get(a.id) ?? 0) - (rank.get(b.id) ?? 0));\n }\n\n // Bottom-up: where each child's centre sits relative to its parent's centre. Each\n // subtree is kept as the boxes it occupies (x relative to its root's centre, y\n // absolute): its nodes, plus the corridor its edges run through down to its\n // children. Siblings are packed left to right as close as those boxes allow where\n // they overlap vertically, so a short branch can tuck in beside a deep one without\n // any node landing on another node or across an edge.\n const offset = new Map<string, number>();\n const shiftBoxes = (boxes: Box[], dx: number) => boxes.map((b) => ({ ...b, x0: b.x0 + dx, x1: b.x1 + dx }));\n const measure = (id: string): Box[] => {\n const box = boxes.get(id)!;\n const nodeTop = top.get(id)!;\n const own: Box = { x0: -box.width / 2, x1: box.width / 2, y0: nodeTop, y1: nodeTop + box.height + ADD_BUTTON_ROOM };\n const children = treeChildren.get(id) ?? [];\n if (!children.length) return [own];\n const childBoxes = children.map((c) => measure(c.id));\n\n let centres: number[];\n if (children.length === 1 && !box.isSwitch) {\n centres = [box.outputX(children[0].output) - box.width / 2];\n } else {\n centres = [0];\n let placed = childBoxes[0];\n for (let i = 1; i < children.length; i++) {\n const previous = boxes.get(children[i - 1].id)!.width;\n let centre = centres[i - 1] + (previous + boxes.get(children[i].id)!.width) / 2 + HORIZONTAL_GAP;\n for (const a of placed) {\n for (const b of childBoxes[i]) {\n if (a.y0 < b.y1 && b.y0 < a.y1) centre = Math.max(centre, a.x1 + HORIZONTAL_GAP - b.x0);\n }\n }\n centres.push(centre);\n placed = placed.concat(shiftBoxes(childBoxes[i], centre));\n }\n const shift = box.isSwitch\n ? box.width / 2 + SWITCH_CHILD_OFFSET - centres[0]\n : -(centres[0] + centres[centres.length - 1]) / 2;\n centres = centres.map((x) => x + shift);\n }\n\n children.forEach((c, i) => offset.set(c.id, centres[i]));\n const handles = children.map((c) => box.outputX(c.output) - box.width / 2);\n const corridor: Box = {\n x0: Math.min(...centres, ...handles),\n x1: Math.max(...centres, ...handles),\n y0: nodeTop + (box.isSwitch ? SWITCH_FIRST_HANDLE_Y : box.height),\n y1: Math.min(...children.map((c) => top.get(c.id)!)),\n };\n return [own, corridor, ...childBoxes.flatMap((b, i) => shiftBoxes(b, centres[i]))];\n };\n const treeBoxes = measure(TRIGGER_STEP_ID);\n const treeExtent = { left: Math.min(...treeBoxes.map((b) => b.x0)) };\n\n // Top-down: absolute centres, then top-left positions.\n const centre = new Map<string, number>([[TRIGGER_STEP_ID, 0]]);\n const place = (id: string) => {\n for (const c of treeChildren.get(id) ?? []) {\n centre.set(c.id, centre.get(id)! + offset.get(c.id)!);\n place(c.id);\n }\n };\n place(TRIGGER_STEP_ID);\n\n const stepPositions: Record<string, { x: number; y: number }> = {};\n let lowest: number = HEIGHTS.trigger;\n for (const [id, x] of centre) {\n if (id === TRIGGER_STEP_ID) continue;\n const box = boxes.get(id)!;\n stepPositions[id] = { x: Math.round(x - box.width / 2), y: Math.round(top.get(id)!) };\n lowest = Math.max(lowest, top.get(id)! + box.height);\n }\n\n // Steps not reachable from the trigger (not connected yet, or on a cycle): one row\n // below everything, starting at the left edge of the tree.\n const loose = steps.filter((s) => !centre.has(s.id));\n let cursor = Math.min(treeExtent.left, -boxes.get(TRIGGER_STEP_ID)!.width / 2);\n for (const step of loose) {\n stepPositions[step.id] = { x: Math.round(cursor), y: Math.round(lowest + VERTICAL_GAP * 2) };\n cursor += boxes.get(step.id)!.width + HORIZONTAL_GAP;\n }\n\n const trigger = boxes.get(TRIGGER_STEP_ID)!;\n return { stepPositions, triggerPosition: { x: Math.round(-trigger.width / 2), y: 0 } };\n}\n","/**\n * Automation Graph Helpers\n *\n * Shared internals for the step/connection/trigger composite tools\n * (add-automation-step, update-automation-step, remove-automation-step,\n * connect-automation-steps, disconnect-automation-steps,\n * set-automation-trigger) and the metadata-only update-automation tool.\n *\n * The Automate Management API only exposes a full-replace PUT for an\n * automation's definition (trigger + steps + connections + canvasState +\n * notificationSettings + version, all-or-nothing with optimistic\n * concurrency). Asking an LLM to author that whole body by hand - inventing\n * step UUIDs, wiring sourceStepId/targetStepId references, matching a\n * regex-constrained retryInterval duration string, and round-tripping a\n * version number - is exactly the anti-pattern the MCP tool review flagged.\n *\n * These helpers hide that round trip: every composite tool does an internal\n * get-automation, mutates just the piece it owns, and PUTs the result back\n * with the version it just read. This does not eliminate the API's\n * optimistic-concurrency check (a genuine concurrent edit still fails), it\n * just stops the LLM from having to manage it by hand for routine graph\n * edits.\n */\n\nimport {\n getApiClient,\n UmbracoApiError,\n ToolValidationError,\n CAPTURE_RAW_HTTP_RESPONSE,\n type HttpResponse,\n type ProblemDetails,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type {\n getUmbracoAutomateManagementAPI,\n AutomationResponseModel,\n UpdateAutomationRequestModel,\n StepConfigurationModel,\n StepConnectionModel,\n} from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { computeCanvasLayout, type CanvasLayoutOptions, type TriggerLabel } from \"./canvas-layout.js\";\nimport { APPROVAL_ALIAS } from \"./step-outputs.js\";\nimport { automateVersionSupports, getAutomateVersion } from \"./automate-version.js\";\n\nexport type ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\n/** Fetches the current full definition of an automation, throwing an actionable error on failure. */\nexport async function fetchAutomation(id: string): Promise<AutomationResponseModel> {\n const client = getApiClient<ApiClient>();\n const response = (await client.getAutomationsById(\n id,\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<AutomationResponseModel | ProblemDetails>;\n\n if (response.status < 200 || response.status >= 300) {\n throw new UmbracoApiError(\n (response.data as ProblemDetails) ?? {\n status: response.status,\n detail: response.statusText,\n }\n );\n }\n return response.data as AutomationResponseModel;\n}\n\n/**\n * Builds the full PUT body from a freshly-fetched automation, applying the\n * given overrides on top. Anything not overridden is copied through as-is,\n * so callers only need to specify the piece of the graph they're changing.\n */\nexport function toPutBody(\n automation: AutomationResponseModel,\n overrides: Partial<UpdateAutomationRequestModel> = {}\n): UpdateAutomationRequestModel {\n return {\n alias: automation.alias,\n name: automation.name,\n description: automation.description ?? null,\n groupId: automation.groupId ?? null,\n trigger: automation.trigger ?? null,\n steps: automation.steps.map(stripStepReadOnlyFields),\n connections: automation.connections,\n canvasState: automation.canvasState ?? null,\n notificationSettings: automation.notificationSettings ?? null,\n version: automation.version,\n ...overrides,\n };\n}\n\n// The GET response's step shape includes `connectionId` (which connection\n// created this step, for steps that call another automation) - the PUT\n// body's step shape doesn't accept it back, so it must be dropped when\n// round-tripping steps read from GET into a PUT body.\nexport function stripStepReadOnlyFields(step: StepConfigurationModel): StepConfigurationModel {\n const { connectionId: _connectionId, ...rest } = step;\n return rest;\n}\n\n/**\n * Saves a full PUT body back to the automation. Throws on any non-2xx\n * response. A 409/412 means the automation was changed by someone else\n * since it was read (optimistic concurrency) - every composite tool built\n * on this helper re-fetches fresh state on each call, so simply retrying\n * the same tool call is a safe and sufficient fix, and the resulting error\n * says so explicitly rather than surfacing a raw HTTP status.\n */\nexport async function saveAutomation(\n id: string,\n body: UpdateAutomationRequestModel\n): Promise<void> {\n const client = getApiClient<ApiClient>();\n const response = (await client.putAutomationsById(\n id,\n body,\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<ProblemDetails | void>;\n\n if (response.status === 409 || response.status === 412) {\n throw new ToolValidationError({\n title: \"Automation changed since it was read\",\n status: response.status,\n detail:\n \"This automation was modified by someone else between reading it and saving this change (optimistic concurrency conflict). Call this tool again with the same arguments - it will re-read the current definition and retry automatically.\",\n });\n }\n\n if (response.status < 200 || response.status >= 300) {\n throw new UmbracoApiError(\n (response.data as ProblemDetails) ?? {\n status: response.status,\n detail: response.statusText,\n }\n );\n }\n}\n\n/**\n * Resolves a caller-supplied step reference (its `alias`, or its raw step\n * id) to the actual step. Steps are matched by alias first since that's the\n * stable, human-chosen name; the id is also accepted since it's what\n * get-automation/list results show for a step that has no alias set.\n */\nexport function resolveStep(\n automation: AutomationResponseModel,\n ref: string\n): StepConfigurationModel {\n const byAlias = automation.steps.find((s) => s.alias === ref);\n if (byAlias) return byAlias;\n\n const byId = automation.steps.find((s) => s.id === ref);\n if (byId) return byId;\n\n const known = automation.steps\n .map((s) => s.alias ?? s.id)\n .join(\", \") || \"(no steps yet)\";\n throw new ToolValidationError({\n title: \"Step not found\",\n detail: `No step with alias or id \"${ref}\" exists on this automation. Known steps: ${known}. Call get-automation to see the current step list.`,\n });\n}\n\n// The API represents \"runs directly off the trigger\" as a connection whose\n// sourceStepId is this all-zero sentinel - it doesn't appear in `steps` (the\n// trigger isn't a step), so resolveStep alone can never match it. Every\n// automation actually wired up in the backoffice canvas has a connection\n// shaped this way for its first step(s).\nexport const TRIGGER_STEP_ID = \"00000000-0000-0000-0000-000000000000\";\n\n/**\n * Resolves a connection *source* reference, which - unlike a plain step\n * reference - may also mean \"the automation's trigger\". Callers pass the\n * literal keyword \"trigger\" (case-insensitive) or the trigger sentinel id\n * to connect a step directly off the trigger; anything else is resolved as\n * a normal step via resolveStep. Only sources may refer to the trigger - a\n * connection's target is always a real step.\n */\nexport function resolveConnectionSource(\n automation: AutomationResponseModel,\n ref: string\n): { id: string } {\n if (ref === TRIGGER_STEP_ID || ref.trim().toLowerCase() === \"trigger\") {\n if (!automation.trigger) {\n throw new ToolValidationError({\n title: \"No trigger configured\",\n detail: `\"${ref}\" refers to the automation's trigger, but this automation has no trigger set yet. Call set-automation-trigger first.`,\n });\n }\n return { id: TRIGGER_STEP_ID };\n }\n return resolveStep(automation, ref);\n}\n\n/**\n * How the canvas labels each trigger type, from the catalogue: its name (the canvas\n * falls back to the alias) and whether it has settings (which adds an edit button).\n * The layout needs both to know the trigger node's width. They are product-defined per\n * alias, so they are cached for the life of the process instead of re-reading the\n * catalogue on every save.\n */\nconst triggerLabels = new Map<string, TriggerLabel>();\n\nasync function getTriggerLabel(alias: string): Promise<TriggerLabel> {\n if (!triggerLabels.has(alias)) {\n try {\n const client = getApiClient<ApiClient>();\n const response = (await client.getCatalogueTriggers(\n undefined,\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<{ alias: string; name: string; settingsSchema?: { fields?: unknown[] } | null }[]>;\n if (response.status === 200) {\n for (const t of response.data ?? []) {\n triggerLabels.set(t.alias, { name: t.name, hasSettings: (t.settingsSchema?.fields?.length ?? 0) > 0 });\n }\n }\n } catch {\n // Fall back below, as the canvas does.\n }\n }\n return triggerLabels.get(alias) ?? { name: alias, hasSettings: true };\n}\n\n/** Positions for the given steps and connections; see canvas-layout.ts. */\nexport function computeAutoLayout(\n steps: StepConfigurationModel[],\n connections: StepConnectionModel[],\n triggerLabel: TriggerLabel = { name: \"\", hasSettings: true },\n options: CanvasLayoutOptions = {}\n): { stepPositions: Record<string, { x: number; y: number }>; triggerPosition: { x: number; y: number } } {\n return computeCanvasLayout(steps, connections, triggerLabel, options);\n}\n\n/**\n * Lays out an automation for a (possibly about-to-be-saved) set of steps and\n * connections, returning ready-to-use `steps` and `canvasState` overrides for\n * toPutBody. Any existing canvas viewport is preserved - only step positions and the\n * trigger's canvas position change. `steps` defaults to the automation's current steps.\n */\nexport async function applyAutoLayout(\n automation: AutomationResponseModel,\n connections: StepConnectionModel[],\n steps: StepConfigurationModel[] = automation.steps\n): Promise<{ steps: StepConfigurationModel[]; canvasState: string }> {\n const triggerLabel = automation.trigger\n ? await getTriggerLabel(automation.trigger.triggerAlias)\n : { name: \"\", hasSettings: true };\n // Only an approval step's node shape depends on the Automate version.\n const approvalOutcomes = steps.some((s) => s.actionAlias === APPROVAL_ALIAS)\n ? automateVersionSupports(\"approvalOutcomes\", await getAutomateVersion())\n : true;\n const { stepPositions, triggerPosition } = computeAutoLayout(steps, connections, triggerLabel, { approvalOutcomes });\n\n const laidOut = steps.map((s) => ({\n ...stripStepReadOnlyFields(s),\n position: stepPositions[s.id] ?? s.position,\n }));\n\n let canvas: Record<string, unknown> = {};\n if (automation.canvasState) {\n try {\n canvas = JSON.parse(automation.canvasState) as Record<string, unknown>;\n } catch {\n canvas = {};\n }\n }\n canvas.triggerPosition = triggerPosition;\n\n return { steps: laidOut, canvasState: JSON.stringify(canvas) };\n}\n","/**\n * Step Settings Normalization\n *\n * A step's `settings` is an untyped object the Management API stores verbatim.\n * The runtime reads condition-based settings case-insensitively, but the\n * backoffice editors (ConditionBuilder for If/While, SwitchCaseBuilder for\n * Switch) read PascalCase keys only - `{ Groups: [{ Conditions: [{ LeftOperand,\n * Operator, RightOperand }] }] }` and `[{ Name, Conditions }]`. Settings saved\n * in camelCase therefore run correctly but open as empty in the backoffice, and\n * re-saving them there drops the conditions.\n *\n * So condition sets and switch cases are rewritten to PascalCase keys before\n * saving. Only those two structures are touched, identified by shape (a\n * `groups` array of objects holding a `conditions` array, or a list of cases\n * that each hold such a set); everything else passes through unchanged, and\n * operand values are never altered.\n */\n\ntype JsonObject = Record<string, unknown>;\n\nconst isObject = (value: unknown): value is JsonObject =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst getKey = (obj: JsonObject, key: string): unknown =>\n obj[key] ?? obj[key.charAt(0).toUpperCase() + key.slice(1)];\n\nconst isConditionSet = (value: unknown): value is JsonObject => {\n if (!isObject(value)) return false;\n const groups = getKey(value, \"groups\");\n return (\n Array.isArray(groups) &&\n groups.every((group) => isObject(group) && Array.isArray(getKey(group, \"conditions\")))\n );\n};\n\nconst isSwitchCaseList = (value: unknown): value is JsonObject[] =>\n Array.isArray(value) &&\n value.length > 0 &&\n value.every((item) => isObject(item) && isConditionSet(getKey(item, \"conditions\")));\n\n/** Recursively upper-cases the first letter of every object key; values are left as-is. */\nfunction pascalKeys(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(pascalKeys);\n if (!isObject(value)) return value;\n return Object.fromEntries(\n Object.entries(value).map(([key, inner]) => [\n key.charAt(0).toUpperCase() + key.slice(1),\n pascalKeys(inner),\n ]),\n );\n}\n\nexport function normalizeStepSettings(settings: JsonObject): JsonObject {\n return Object.fromEntries(\n Object.entries(settings).map(([key, value]) => [\n key,\n isConditionSet(value) || isSwitchCaseList(value) ? pascalKeys(value) : value,\n ]),\n );\n}\n\n/** Shared guidance on settings keys, for every tool that saves or resolves step or trigger settings. */\nexport const SETTINGS_KEYS_HELP =\n \"Use each settingsSchema field's `key` exactly - a key the step type doesn't declare is refused, because Automate would save it without using it.\";\n\n/**\n * Shared guidance on binding expressions and values, for the `settings` input of the step tools.\n * Binding syntax mirrors Automate's BindingEvaluator (`${ steps.myAlias.field }`).\n */\nexport const STEP_VALUES_HELP =\n \"Fields with supportsBindings: true accept binding expressions: `${trigger.<field>}` for the trigger's output and `${steps.<stepAlias>.<field>}` for an earlier step's output, with field names taken from that trigger's or step's outputSchema (for one with hasDynamicOutputSchema, from resolve-step-type-output-schema). Values reach the step as given, so a value written to a content property must be in that property's stored form - e.g. a Toggle (true/false) property takes 1 or 0, not \\\"true\\\".\";\n\n/**\n * Shared guidance for the `settings` input of the step tools, so the model knows\n * the condition format without guessing from other automations.\n */\nexport const CONDITION_SETTINGS_HELP =\n \"Condition-based steps take a condition set: { groups: [{ conditions: [{ leftOperand, operator, rightOperand }] }] } - conditions within a group are ANDed, groups are ORed (there is no combinator field). If/While put it under `conditions`; Switch takes `cases`: [{ name, conditions: <condition set> }], evaluated in order, first match wins. Connect each Switch case with connect-automation-steps using outcome = the case name, plus outcome \\\"default\\\" for no match; an If connects with outcome \\\"true\\\"/\\\"false\\\", a While/ForEach/Parallel with \\\"body\\\"/\\\"done\\\". Operators: Equals, NotEquals, Contains, NotContains, StartsWith, EndsWith, GreaterThan, LessThan, GreaterThanOrEquals, LessThanOrEquals, IsEmpty, IsNotEmpty. Keys may be camelCase; they are saved in the PascalCase form the backoffice editor reads.\";\n","/**\n * Settings Keys\n *\n * Automate stores a step's or trigger's `settings` verbatim and reads them into the step\n * type's settings class, so a key the step type doesn't declare is saved without complaint\n * and then has no effect: a Form Submitted trigger given `formId` instead of `formIds`\n * fires for every form, and resolving its output schema returns the generic envelope.\n * Nothing on the server reports this, not even publishing.\n *\n * So the step tools check the keys against the step type's settingsSchema from the\n * catalogue first and refuse unknown ones, suggesting the declared key a near miss was\n * meant to be. Keys match case-insensitively, as the server reads them. If the catalogue\n * can't be read, doesn't know the alias, or declares no settings fields for it, the check\n * is skipped and the API decides - a step type (e.g. from a package) may read settings it\n * doesn't declare, and refusing every key would make it impossible to configure.\n */\n\nimport {\n getApiClient,\n CAPTURE_RAW_HTTP_RESPONSE,\n ToolValidationError,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type {\n getUmbracoAutomateManagementAPI,\n StepTypeItemResponseModel,\n} from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nexport interface UnknownSettingKey {\n key: string;\n /** The declared key this one most likely meant, if any. */\n suggestion?: string;\n}\n\n/** The keys in `settings` that `fields` (a settingsSchema's fields, or null for none) doesn't declare. */\nexport function findUnknownSettingKeys(\n fields: ReadonlyArray<{ key: string }> | null | undefined,\n settings: Record<string, unknown>\n): UnknownSettingKey[] {\n const declared = (fields ?? []).map((field) => field.key);\n return Object.keys(settings)\n .filter((key) => !declared.some((d) => d.toLowerCase() === key.toLowerCase()))\n .map((key) => {\n const lower = key.toLowerCase();\n const suggestion = declared.find((d) => d.toLowerCase().startsWith(lower) || lower.startsWith(d.toLowerCase()));\n return suggestion ? { key, suggestion } : { key };\n });\n}\n\n/** The step type's declared settings fields, or undefined when there are none to check against. */\nasync function fetchSettingsFields(alias: string): Promise<ReadonlyArray<{ key: string }> | undefined> {\n try {\n const client = getApiClient<ApiClient>();\n const response = (await client.getCatalogueStepTypes({}, CAPTURE_RAW_HTTP_RESPONSE)) as unknown as HttpResponse<\n StepTypeItemResponseModel[]\n >;\n if (response.status < 200 || response.status >= 300 || !Array.isArray(response.data)) return undefined;\n const stepType = response.data.find((item) => item.alias === alias);\n const fields = stepType?.settingsSchema?.fields;\n return fields && fields.length > 0 ? fields : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Refuses `settings` keys the step type `alias` doesn't declare, listing the keys it does.\n * Does nothing if the catalogue can't be read, doesn't know the alias, or declares no settings for it.\n */\nexport async function assertKnownSettingKeys(alias: string, settings: Record<string, unknown> | undefined): Promise<void> {\n if (!settings || Object.keys(settings).length === 0) return;\n const fields = await fetchSettingsFields(alias);\n if (fields === undefined) return;\n\n const unknown = findUnknownSettingKeys(fields, settings);\n if (unknown.length === 0) return;\n\n const listed = unknown\n .map(({ key, suggestion }) => (suggestion ? `\"${key}\" (did you mean \"${suggestion}\"?)` : `\"${key}\"`))\n .join(\", \");\n const declared = fields.map((field) => `\"${field.key}\"`).join(\", \");\n throw new ToolValidationError({\n title: \"Unknown settings\",\n status: 400,\n detail:\n `\"${alias}\" has no setting ${listed}. Its settings are: ${declared}.` +\n \" Automate would save an unknown key without using it, so the step would silently behave as if it were not set.\" +\n \" Use the `key` values from the step type's settingsSchema in the catalogue.\",\n });\n}\n","/**\n * Add Automation Step Tool\n *\n * Appends a new step to an automation's graph without requiring the caller\n * to construct or resend the rest of the definition. The step's id is\n * generated server-side; refer to the step afterwards by the `alias` you\n * gave it (in connect-automation-steps, update-automation-step,\n * remove-automation-step).\n */\n\nimport { z } from \"zod\";\nimport { randomUUID } from \"node:crypto\";\nimport {\n withStandardDecorators,\n createToolResult,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { StepConfigurationModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n fetchAutomation,\n toPutBody,\n saveAutomation,\n stripStepReadOnlyFields,\n applyAutoLayout,\n TRIGGER_STEP_ID,\n} from \"../_shared/automation-graph.js\";\nimport {\n normalizeStepSettings,\n CONDITION_SETTINGS_HELP,\n SETTINGS_KEYS_HELP,\n STEP_VALUES_HELP,\n} from \"../_shared/step-settings.js\";\nimport { assertKnownSettingKeys } from \"../_shared/settings-keys.js\";\n\nconst errorBehaviors = [\"Retry\", \"Suspend\", \"Terminate\", \"Compensate\"] as const;\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation to add the step to.\"),\n actionAlias: z\n .string()\n .min(1)\n .describe(\n \"Alias of the action or control-flow step type to use, as returned by list-catalogue-actions or list-catalogue-control-flows.\"\n ),\n alias: z\n .string()\n .min(1)\n .describe(\n \"Unique name for this step within the automation. Letters and digits only, starting with a letter - no hyphens, underscores or spaces (e.g. 'sendWelcomeEmail'). Use this to refer to the step later in connect-automation-steps, update-automation-step, and remove-automation-step.\"\n ),\n name: z.string().min(1).describe(\"Human-readable display name for this step.\"),\n settings: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n `The step's configuration, matching the shape described by that step type's settingsSchema (see list-catalogue-actions/list-catalogue-control-flows). Defaults to an empty object if omitted. ${SETTINGS_KEYS_HELP} ${STEP_VALUES_HELP} ${CONDITION_SETTINGS_HELP}`\n ),\n inputMappings: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n \"Maps this step's input fields to expressions referencing earlier steps' output (e.g. trigger data or a prior step's result). Defaults to none if omitted - configure later with update-automation-step once you know what's available.\"\n ),\n errorBehavior: z\n .enum(errorBehaviors)\n .optional()\n .describe(\n \"What happens if this step fails at runtime: Retry (per retryInterval/maxRetries), Suspend (pause the run for manual resume-run), Terminate (fail the run), or Compensate (run a compensating step). Defaults to Terminate.\"\n ),\n retryInterval: z\n .string()\n .regex(/^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$/)\n .optional()\n .describe(\n \"Delay before retrying, as a d.hh:mm:ss duration string (e.g. '00:05:00' for 5 minutes). Only meaningful when errorBehavior is Retry.\"\n ),\n maxRetries: z\n .number()\n .int()\n .optional()\n .describe(\"Maximum retry attempts before giving up. Only meaningful when errorBehavior is Retry.\"),\n};\n\ntype AddAutomationStepParams = {\n automationId: string;\n actionAlias: string;\n alias: string;\n name: string;\n settings?: Record<string, unknown>;\n inputMappings?: Record<string, string>;\n errorBehavior?: (typeof errorBehaviors)[number];\n retryInterval?: string;\n maxRetries?: number;\n};\n\nconst outputSchema = z.object({\n message: z.string(),\n stepId: z.string().uuid(),\n alias: z.string(),\n});\n\nconst addAutomationStepTool = {\n name: \"add-automation-step\",\n description:\n \"Adds a new step to an automation's graph. You only need to describe the new step - this tool reads the automation's current definition, appends the step, and saves it back, so nothing else is affected. If the automation has a trigger and no steps yet, the new step is connected to the trigger, so a one-step automation needs no connect-automation-steps call. Later steps are added unconnected: use connect-automation-steps to make each one run after another step (an unconnected step still runs directly off the trigger, but the backoffice canvas shows it detached). Canvas positions are assigned automatically (an unconnected step waits in a row below the graph until it is connected); use the Umbraco backoffice canvas to rearrange steps visually if needed.\",\n inputSchema,\n outputSchema,\n slices: [\"update\"],\n annotations: {\n idempotentHint: false,\n },\n handler: async (params: AddAutomationStepParams) => {\n await assertKnownSettingKeys(params.actionAlias, params.settings);\n const automation = await fetchAutomation(params.automationId);\n\n if (automation.steps.some((s) => s.alias === params.alias)) {\n throw new Error(\n `A step with alias \"${params.alias}\" already exists on this automation - step aliases must be unique. Choose a different alias, or use update-automation-step to modify the existing one.`\n );\n }\n\n const stepId = randomUUID();\n const newStep: StepConfigurationModel = {\n id: stepId,\n actionAlias: params.actionAlias,\n name: params.name,\n alias: params.alias,\n settings: normalizeStepSettings(params.settings ?? {}),\n inputMappings: params.inputMappings ?? {},\n position: { x: 0, y: 0 },\n errorBehavior: params.errorBehavior ?? \"Terminate\",\n retryInterval: params.retryInterval ?? null,\n maxRetries: params.maxRetries ?? null,\n };\n\n // The first step gets an explicit connection from the trigger, as the backoffice canvas\n // saves it. Automate runs an unconnected step off the trigger anyway, but the canvas only\n // draws the line for a saved connection. Later steps are left unconnected (the layout\n // parks them in the row below the graph) until connect-automation-steps places them.\n const connectToTrigger = automation.trigger != null && automation.steps.length === 0;\n const connections = connectToTrigger\n ? [\n ...automation.connections,\n {\n sourceStepId: TRIGGER_STEP_ID,\n sourceHandle: null,\n targetStepId: stepId,\n targetHandle: null,\n outcome: null,\n filter: null,\n },\n ]\n : automation.connections;\n const { steps, canvasState } = await applyAutoLayout(automation, connections, [\n ...automation.steps.map(stripStepReadOnlyFields),\n newStep,\n ]);\n const body = toPutBody(automation, { steps, connections, canvasState });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({\n message: connectToTrigger\n ? `Step \"${params.alias}\" added and connected to the trigger.`\n : `Step \"${params.alias}\" added.`,\n stepId,\n alias: params.alias,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(addAutomationStepTool);\n","/**\n * Connect Automation Steps Tool\n *\n * Wires one step's output to another step's input. A step with no incoming\n * connection runs directly off the trigger; every other step only runs once\n * something connects into it. Use add-automation-step first to create the\n * steps, then this tool to link them into a flow.\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, ToolValidationError, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport type { StepConfigurationModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { fetchAutomation, toPutBody, saveAutomation, resolveStep, resolveConnectionSource, applyAutoLayout, TRIGGER_STEP_ID } from \"../_shared/automation-graph.js\";\nimport {\n resolveConnectionOutput,\n isSingleConnectionOutput,\n APPROVAL_ALIAS,\n DONE_HANDLE,\n OUTCOME_HELP,\n} from \"../_shared/step-outputs.js\";\nimport {\n automateVersionSupports,\n describeMinimumAutomateVersion,\n getAutomateVersion,\n minimumAutomateVersion,\n} from \"../_shared/automate-version.js\";\n\nconst operators = [\n \"Equals\",\n \"NotEquals\",\n \"Contains\",\n \"NotContains\",\n \"StartsWith\",\n \"EndsWith\",\n \"GreaterThan\",\n \"LessThan\",\n \"GreaterThanOrEquals\",\n \"LessThanOrEquals\",\n \"IsEmpty\",\n \"IsNotEmpty\",\n] as const;\n\nconst conditionSchema = z.object({\n leftOperand: z\n .string()\n .describe(\"Expression to test, e.g. a reference to the source step's output or trigger data.\"),\n operator: z.enum(operators),\n rightOperand: z\n .string()\n .describe(\"Value to compare against. Ignored for IsEmpty/IsNotEmpty but still required by the API - pass an empty string.\"),\n});\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation to connect steps within.\"),\n sourceStep: z\n .string()\n .min(1)\n .describe(\n \"The step this connection runs from, by alias (preferred) or step id. Pass the literal \\\"trigger\\\" to run this step directly off the automation's trigger instead of another step.\"\n ),\n targetStep: z\n .string()\n .min(1)\n .describe(\"The step this connection runs to, by alias (preferred) or step id.\"),\n outcome: z.string().optional().describe(OUTCOME_HELP),\n conditions: z\n .array(conditionSchema)\n .optional()\n .describe(\n \"Optional list of conditions that must ALL be true (AND) for this connection to be followed - use this for a conditional path off a branching step. Omit for an unconditional connection. This tool only supports a single AND-group; for the rarer OR-of-AND case, build the connection through the Umbraco backoffice canvas instead.\"\n ),\n};\n\ntype ConnectAutomationStepsParams = {\n automationId: string;\n sourceStep: string;\n targetStep: string;\n outcome?: string;\n conditions?: { leftOperand: string; operator: (typeof operators)[number]; rightOperand: string }[];\n};\n\nconst outputSchema = z.object({ message: z.string() });\n\n/**\n * Request Approval only has \"approved\"/\"rejected\" outputs from Automate 17.2 / 18.2. Before\n * that its single plain output runs on approval and a rejection fails the run, so a\n * connection saved on a named output is never followed.\n */\nasync function resolveApprovalOutput(\n step: StepConfigurationModel,\n outcome: string | undefined,\n): Promise<{ sourceHandle: string | null; outcome: string | null }> {\n const automateVersion = await getAutomateVersion();\n if (automateVersionSupports(\"approvalOutcomes\", automateVersion)) {\n return resolveConnectionOutput(step, outcome);\n }\n if (outcome === undefined || outcome.trim().toLowerCase() === \"approved\") {\n return { sourceHandle: null, outcome: null };\n }\n throw new ToolValidationError({\n title: \"Not supported by this Automate version\",\n detail: `This Umbraco Automate version (${automateVersion}) has no \"${outcome}\" output on Request Approval steps: its single output runs when the step is approved, and a rejection fails the run. Connect without an outcome (or with \"approved\") to run a step after approval, or upgrade Umbraco Automate to ${minimumAutomateVersion(\"approvalOutcomes\", automateVersion) ?? describeMinimumAutomateVersion(\"approvalOutcomes\")} or later to branch on the decision.`,\n });\n}\n\nconst connectAutomationStepsTool = {\n name: \"connect-automation-steps\",\n description:\n \"Connects one step's output to another step's input, so the target step runs after the source step (optionally only for a specific outcome, and/or only when conditions are met). The target step must already exist on the automation - use add-automation-step first. Connections from a branching step (If, Switch, Request Approval, While, ForEach, Parallel) must name the output via `outcome`. Pass sourceStep: \\\"trigger\\\" to run the target step directly off the automation's trigger instead of another step. Adding a connection does not remove any existing connections between other steps. Also re-lays out every step's canvas position top-down by distance from the trigger, so the graph reads as a flow instead of piling up wherever add-automation-step happened to place it.\",\n inputSchema,\n outputSchema,\n slices: [\"update\"],\n annotations: {\n idempotentHint: false,\n },\n handler: async (params: ConnectAutomationStepsParams) => {\n const automation = await fetchAutomation(params.automationId);\n const source = resolveConnectionSource(automation, params.sourceStep);\n const target = resolveStep(automation, params.targetStep);\n const sourceStep = source.id === TRIGGER_STEP_ID ? undefined : resolveStep(automation, source.id);\n const output =\n sourceStep?.actionAlias === APPROVAL_ALIAS\n ? await resolveApprovalOutput(sourceStep, params.outcome)\n : resolveConnectionOutput(sourceStep, params.outcome);\n\n if (sourceStep && output.sourceHandle === DONE_HANDLE) {\n // Before the \"done\" output existed every connection from a container was part of its\n // body, so a \"done\" connection would silently run inside the loop instead of after it.\n const automateVersion = await getAutomateVersion();\n if (!automateVersionSupports(\"containerDone\", automateVersion)) {\n throw new ToolValidationError({\n title: \"Not supported by this Automate version\",\n detail: `This Umbraco Automate version (${automateVersion}) has no \"done\" output on ${sourceStep.actionAlias} steps - every connection from it runs inside the loop. Connect the step with outcome \"body\" to run it on each iteration, or upgrade Umbraco Automate to ${minimumAutomateVersion(\"containerDone\", automateVersion) ?? describeMinimumAutomateVersion(\"containerDone\")} or later to run steps after the loop.`,\n });\n }\n }\n\n if (\n sourceStep &&\n output.sourceHandle &&\n isSingleConnectionOutput(sourceStep, output.sourceHandle) &&\n automation.connections.some((c) => c.sourceStepId === source.id && c.sourceHandle === output.sourceHandle)\n ) {\n throw new ToolValidationError({\n title: \"Output already connected\",\n detail: `\"${params.sourceStep}\" already has a step on its \"${output.sourceHandle}\" output, and only the first one would ever run. Chain further steps after that step instead, or disconnect-automation-steps it first.`,\n });\n }\n\n const alreadyConnected = automation.connections.some(\n (c) =>\n c.sourceStepId === source.id &&\n c.targetStepId === target.id &&\n (c.outcome ?? null) === output.outcome &&\n (c.sourceHandle ?? null) === output.sourceHandle\n );\n if (alreadyConnected) {\n throw new Error(\n `A connection from \"${params.sourceStep}\" to \"${params.targetStep}\"${\n output.outcome ? ` for outcome \"${output.outcome}\"` : \"\"\n } already exists - use disconnect-automation-steps first if you need to replace it (e.g. with different conditions).`\n );\n }\n\n const newConnection = {\n sourceStepId: source.id,\n sourceHandle: output.sourceHandle,\n targetStepId: target.id,\n targetHandle: null,\n outcome: output.outcome,\n filter: params.conditions?.length\n ? { groups: [{ conditions: params.conditions }] }\n : null,\n };\n\n const newConnections = [...automation.connections, newConnection];\n const { steps, canvasState } = await applyAutoLayout(automation, newConnections);\n\n const body = toPutBody(automation, {\n connections: newConnections,\n steps,\n canvasState,\n });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({\n message: `Connected \"${params.sourceStep}\"${output.outcome ? ` (${output.outcome})` : \"\"} -> \"${params.targetStep}\".`,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(connectAutomationStepsTool);\n","/**\n * Update Automation Tool\n *\n * Changes an automation's metadata (alias, name, description, group)\n * without touching its trigger, steps, connections or notification\n * settings. To edit the graph itself, use add-automation-step,\n * update-automation-step, remove-automation-step, connect-automation-steps,\n * disconnect-automation-steps, or set-automation-trigger instead - each of\n * those reads the current definition and saves only its own change, the\n * same way this tool does, so there's no need to round-trip the whole\n * automation body by hand or track its version number yourself.\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport { fetchAutomation, toPutBody, saveAutomation } from \"../_shared/automation-graph.js\";\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation to update.\"),\n alias: z.string().min(1).optional().describe(\"New unique, code-friendly alias. Omit to leave unchanged.\"),\n name: z.string().min(1).optional().describe(\"New display name. Omit to leave unchanged.\"),\n description: z\n .string()\n .nullish()\n .describe(\"New description. Pass null to clear it. Omit to leave unchanged.\"),\n groupId: z\n .string()\n .uuid()\n .nullish()\n .describe(\n \"New workspace group (folder) id, from get-automation-group / list-workspace-groups. Pass null to move it to the workspace root. Omit to leave unchanged.\"\n ),\n};\n\ntype UpdateAutomationParams = {\n automationId: string;\n alias?: string;\n name?: string;\n description?: string | null;\n groupId?: string | null;\n};\n\nconst outputSchema = z.object({ message: z.string() });\n\nconst updateAutomationTool = {\n name: \"update-automation\",\n description:\n \"Renames an automation, edits its description, or moves it to a different workspace group. Only the fields you provide are changed; the trigger, steps, connections and notification settings are read from the automation's current definition and saved back unmodified. Use the dedicated graph tools (add-automation-step, connect-automation-steps, set-automation-trigger, etc.) to change those instead.\",\n inputSchema,\n outputSchema,\n slices: [\"update\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async (params: UpdateAutomationParams) => {\n const automation = await fetchAutomation(params.automationId);\n\n const body = toPutBody(automation, {\n alias: params.alias ?? automation.alias,\n name: params.name ?? automation.name,\n description: params.description !== undefined ? params.description : automation.description,\n groupId: params.groupId !== undefined ? params.groupId : automation.groupId,\n });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({ message: `Automation \"${body.name}\" updated.` });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(updateAutomationTool);\n","/**\n * Import Automation Into Existing Tool\n *\n * Overwrites an existing automation's trigger/steps/connections/canvas\n * state with a previously exported definition (see export-automation).\n * Unlike import-automation, this replaces content in place rather than\n * creating a new automation - use it to restore a backup or apply an\n * exported definition from another workspace onto this automation. Dry-run\n * the same exportModel with validate-automation-import first if unsure.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n putAutomationsByIdImportParams,\n putAutomationsByIdImportBody,\n putAutomationsByIdImportResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\nimport type { AutomationExportModel } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n id: putAutomationsByIdImportParams.shape.id.describe(\n \"Id of the existing automation to overwrite.\",\n ),\n exportModel: z.object(putAutomationsByIdImportBody.shape).describe(\n \"The exact object returned by export-automation, passed through unmodified. Not meant to be written by hand.\",\n ),\n};\n\nconst importAutomationIntoExistingTool = {\n name: \"import-automation-into-existing\",\n description:\n \"Overwrites the trigger, steps, connections, canvas state and notification settings of an existing automation (identified by id) with a previously exported definition (see export-automation for the exportModel shape). `exportModel` should be the exact object returned by export-automation, passed through unmodified - it is not meant to be hand-authored; to make a targeted change to an existing automation's graph, use update-automation-step/add-automation-step/connect-automation-steps/set-automation-trigger instead. This replaces content in place rather than creating a new automation - use import-automation instead if you want a brand new automation. Consider validate-automation-import first to check the export is compatible with this workspace.\",\n inputSchema,\n outputSchema: putAutomationsByIdImportResponse,\n slices: [\"import\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async (model: { id: string; exportModel: AutomationExportModel }) => {\n return executeGetApiCall<\n ReturnType<ApiClient[\"putAutomationsByIdImport\"]>,\n ApiClient\n >((client) =>\n client.putAutomationsByIdImport(\n model.id,\n model.exportModel,\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof putAutomationsByIdImportResponse>;\n\nexport default withStandardDecorators(importAutomationIntoExistingTool);\n","/**\n * Update Automation Step Tool\n *\n * Changes one existing step's own fields (settings, mappings, error\n * handling) without touching the rest of the automation's graph. To change\n * how steps connect to each other, use connect-automation-steps /\n * disconnect-automation-steps instead.\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport {\n fetchAutomation,\n toPutBody,\n saveAutomation,\n resolveStep,\n stripStepReadOnlyFields,\n applyAutoLayout,\n} from \"../_shared/automation-graph.js\";\nimport {\n normalizeStepSettings,\n CONDITION_SETTINGS_HELP,\n SETTINGS_KEYS_HELP,\n STEP_VALUES_HELP,\n} from \"../_shared/step-settings.js\";\nimport { assertKnownSettingKeys } from \"../_shared/settings-keys.js\";\n\nconst errorBehaviors = [\"Retry\", \"Suspend\", \"Terminate\", \"Compensate\"] as const;\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation the step belongs to.\"),\n step: z\n .string()\n .min(1)\n .describe(\"The step to update, by its alias (preferred) or its step id, as seen in get-automation.\"),\n name: z.string().min(1).optional().describe(\"New display name, if changing it.\"),\n settings: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n `New configuration for the step, replacing its current settings entirely (not merged field-by-field). Match the shape from that step type's settingsSchema. Omit to leave settings unchanged. ${SETTINGS_KEYS_HELP} ${STEP_VALUES_HELP} ${CONDITION_SETTINGS_HELP}`\n ),\n inputMappings: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n \"New input mappings, replacing the current set entirely (not merged). Omit to leave mappings unchanged.\"\n ),\n errorBehavior: z\n .enum(errorBehaviors)\n .optional()\n .describe(\"New failure-handling behavior. Omit to leave unchanged.\"),\n retryInterval: z\n .string()\n .regex(/^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$/)\n .nullish()\n .describe(\n \"New retry delay as a d.hh:mm:ss duration string, only meaningful with errorBehavior Retry. Pass null to clear it. Omit to leave unchanged.\"\n ),\n maxRetries: z\n .number()\n .int()\n .nullish()\n .describe(\"New max retry count. Pass null to clear it. Omit to leave unchanged.\"),\n};\n\ntype UpdateAutomationStepParams = {\n automationId: string;\n step: string;\n name?: string;\n settings?: Record<string, unknown>;\n inputMappings?: Record<string, string>;\n errorBehavior?: (typeof errorBehaviors)[number];\n retryInterval?: string | null;\n maxRetries?: number | null;\n};\n\nconst outputSchema = z.object({ message: z.string() });\n\nconst updateAutomationStepTool = {\n name: \"update-automation-step\",\n description:\n \"Updates one step's own configuration (name, settings, input mappings, error handling) by alias or id. Only the fields you provide are changed; everything else about the step, and the rest of the automation's steps/connections/trigger, is left as-is. `settings` and `inputMappings`, if provided, fully replace the step's current value for that field rather than merging - read get-automation first if you need to preserve part of an existing settings object while changing another part.\",\n inputSchema,\n outputSchema,\n slices: [\"update\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async (params: UpdateAutomationStepParams) => {\n const automation = await fetchAutomation(params.automationId);\n const target = resolveStep(automation, params.step);\n await assertKnownSettingKeys(target.actionAlias, params.settings);\n\n const updatedSteps = automation.steps.map((step) => {\n const s = stripStepReadOnlyFields(step);\n if (s.id !== target.id) return s;\n return {\n ...s,\n name: params.name ?? s.name,\n settings: params.settings ? normalizeStepSettings(params.settings) : s.settings,\n inputMappings: params.inputMappings ?? s.inputMappings,\n errorBehavior: params.errorBehavior ?? s.errorBehavior,\n retryInterval: params.retryInterval !== undefined ? params.retryInterval : s.retryInterval,\n maxRetries: params.maxRetries !== undefined ? params.maxRetries : s.maxRetries,\n };\n });\n\n // A new name or settings can change the node's size and outputs (e.g. Switch cases),\n // so re-lay out when either changes.\n const relayout = params.name !== undefined || params.settings !== undefined;\n const body = relayout\n ? toPutBody(automation, await applyAutoLayout(automation, automation.connections, updatedSteps))\n : toPutBody(automation, { steps: updatedSteps });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({ message: `Step \"${params.step}\" updated.` });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(updateAutomationStepTool);\n","/**\n * Set Automation Trigger Tool\n *\n * Sets or replaces the automation's trigger - what starts a run - without\n * touching its steps, connections, or anything else. Pass no triggerAlias\n * to clear the trigger entirely (the automation cannot be published without\n * one).\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport { fetchAutomation, toPutBody, saveAutomation, applyAutoLayout } from \"../_shared/automation-graph.js\";\nimport { assertKnownSettingKeys } from \"../_shared/settings-keys.js\";\nimport { SETTINGS_KEYS_HELP } from \"../_shared/step-settings.js\";\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation to set the trigger for.\"),\n triggerAlias: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Alias of the trigger type to use, as returned by list-catalogue-triggers. Omit (leave unset) to clear the automation's trigger entirely.\"\n ),\n settings: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n `The trigger's configuration, matching the shape described by that trigger type's settingsSchema (see list-catalogue-triggers), e.g. Form Submitted takes \\`formIds\\` (an array of form ids). ${SETTINGS_KEYS_HELP} Required when setting a triggerAlias; ignored when clearing the trigger.`\n ),\n};\n\ntype SetAutomationTriggerParams = {\n automationId: string;\n triggerAlias?: string;\n settings?: Record<string, unknown>;\n};\n\nconst outputSchema = z.object({ message: z.string() });\n\nconst setAutomationTriggerTool = {\n name: \"set-automation-trigger\",\n description:\n \"Sets what starts the automation: a trigger type (from list-catalogue-triggers) and its settings. Replaces any existing trigger entirely, and re-lays out the canvas around it. Omit triggerAlias to remove the trigger - a Draft automation with no trigger can still be edited, but publish-automation will fail until one is set. Steps and connections are left unchanged.\",\n inputSchema,\n outputSchema,\n slices: [\"update\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async (params: SetAutomationTriggerParams) => {\n if (params.triggerAlias) await assertKnownSettingKeys(params.triggerAlias, params.settings);\n const automation = await fetchAutomation(params.automationId);\n\n const trigger = params.triggerAlias\n ? { triggerAlias: params.triggerAlias, settings: params.settings ?? {} }\n : null;\n // A different trigger label changes the trigger node's width, so re-centre the layout.\n const { steps, canvasState } = await applyAutoLayout({ ...automation, trigger }, automation.connections);\n const body = toPutBody(automation, { trigger, steps, canvasState });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({\n message: params.triggerAlias\n ? `Trigger set to \"${params.triggerAlias}\".`\n : \"Trigger cleared.\",\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(setAutomationTriggerTool);\n","/**\n * Delete Automation Tool\n *\n * Permanently deletes an automation, its definition and its run history.\n * This cannot be undone - if you might need it again, use export-automation\n * to save a copy first, and unpublish-automation instead if you only want to\n * stop it from running.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { deleteAutomationsByIdParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...deleteAutomationsByIdParams.shape,\n id: deleteAutomationsByIdParams.shape.id.describe(\n \"Id of the automation to delete permanently.\",\n ),\n};\n\nconst deleteAutomationTool = {\n name: \"delete-automation\",\n description:\n \"Permanently deletes an automation by id, including its run history. This cannot be undone. Use export-automation first if you might want to restore it later, or unpublish-automation instead if you only want to stop it from running.\",\n inputSchema,\n annotations: {\n destructiveHint: true,\n },\n slices: [\"delete\"],\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.deleteAutomationsById(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(deleteAutomationTool);\n","/**\n * Remove Automation Step Tool\n *\n * Removes a single step from an automation's graph. Any connections to or\n * from the removed step are removed along with it, so the graph never ends\n * up referencing a step that no longer exists.\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport {\n fetchAutomation,\n toPutBody,\n saveAutomation,\n resolveStep,\n applyAutoLayout,\n} from \"../_shared/automation-graph.js\";\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation the step belongs to.\"),\n step: z\n .string()\n .min(1)\n .describe(\"The step to remove, by its alias (preferred) or its step id, as seen in get-automation.\"),\n};\n\nconst outputSchema = z.object({\n message: z.string(),\n removedConnectionCount: z.number().int(),\n});\n\nconst removeAutomationStepTool = {\n name: \"remove-automation-step\",\n description:\n \"Removes a step from an automation's graph, along with any connections that reference it (incoming or outgoing) so the graph stays consistent. This cannot be undone except by re-adding the step and its connections. Not valid to leave the trigger's first step disconnected - check the resulting graph with get-automation if this step was a hub other steps only reached through it.\",\n inputSchema,\n outputSchema,\n slices: [\"delete\"],\n annotations: {\n destructiveHint: true,\n },\n handler: async (params: { automationId: string; step: string }) => {\n const automation = await fetchAutomation(params.automationId);\n const target = resolveStep(automation, params.step);\n\n const remainingConnections = automation.connections.filter(\n (c) => c.sourceStepId !== target.id && c.targetStepId !== target.id\n );\n const removedConnectionCount = automation.connections.length - remainingConnections.length;\n\n const { steps, canvasState } = await applyAutoLayout(\n automation,\n remainingConnections,\n automation.steps.filter((s) => s.id !== target.id)\n );\n\n const body = toPutBody(automation, {\n steps,\n connections: remainingConnections,\n canvasState,\n });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({\n message: `Step \"${params.step}\" removed.`,\n removedConnectionCount,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(removeAutomationStepTool);\n","/**\n * Disconnect Automation Steps Tool\n *\n * Removes the connection(s) between two steps, without deleting either\n * step. Use remove-automation-step instead if the step itself should be\n * removed entirely.\n */\n\nimport { z } from \"zod\";\nimport { withStandardDecorators, createToolResult, type ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport { fetchAutomation, toPutBody, saveAutomation, resolveStep, resolveConnectionSource, applyAutoLayout, TRIGGER_STEP_ID } from \"../_shared/automation-graph.js\";\nimport { resolveConnectionOutput } from \"../_shared/step-outputs.js\";\n\nconst inputSchema = {\n automationId: z.string().uuid().describe(\"Id of the automation to disconnect steps within.\"),\n sourceStep: z\n .string()\n .min(1)\n .describe(\n \"The connection's source step, by alias (preferred) or step id. Pass \\\"trigger\\\" to remove a connection that runs directly off the automation's trigger.\"\n ),\n targetStep: z\n .string()\n .min(1)\n .describe(\"The connection's target step, by alias (preferred) or step id.\"),\n outcome: z\n .string()\n .optional()\n .describe(\n \"If there are multiple connections between the same two steps for different outcomes (e.g. a branching step's 'true' and 'false' paths both pointing at the same target), narrow to the one for this outcome. Omit to remove all connections between the two steps.\"\n ),\n};\n\nconst outputSchema = z.object({\n message: z.string(),\n removedCount: z.number().int(),\n});\n\nconst disconnectAutomationStepsTool = {\n name: \"disconnect-automation-steps\",\n description:\n \"Removes the connection(s) between two steps, identified by alias or step id, without deleting either step. If the two steps have more than one connection between them (distinguished by outcome), pass `outcome` to remove only that one - otherwise all connections between them are removed. Use get-automation first if you need to see the exact current connections.\",\n inputSchema,\n outputSchema,\n slices: [\"delete\"],\n annotations: {\n destructiveHint: true,\n },\n handler: async (params: { automationId: string; sourceStep: string; targetStep: string; outcome?: string }) => {\n const automation = await fetchAutomation(params.automationId);\n const source = resolveConnectionSource(automation, params.sourceStep);\n const target = resolveStep(automation, params.targetStep);\n\n // Match the output the way connect-automation-steps saves it (\"loop\" -> \"body\", \"True\" ->\n // \"true\"), and case-insensitively against both fields so connections saved before outcomes\n // were normalized (e.g. outcome \"True\", no sourceHandle) can still be removed.\n const wanted = new Set<string>();\n if (params.outcome !== undefined) {\n wanted.add(params.outcome.trim().toLowerCase());\n const sourceStep = source.id === TRIGGER_STEP_ID ? undefined : resolveStep(automation, source.id);\n try {\n const resolved = resolveConnectionOutput(sourceStep, params.outcome).outcome;\n if (resolved) wanted.add(resolved.toLowerCase());\n } catch {\n // Not a current output name - still match it literally, for legacy connections.\n }\n }\n const matchesOutcome = (value: string | null | undefined) => !!value && wanted.has(value.toLowerCase());\n\n const remaining = automation.connections.filter((c) => {\n const matches =\n c.sourceStepId === source.id &&\n c.targetStepId === target.id &&\n (params.outcome === undefined || matchesOutcome(c.outcome) || matchesOutcome(c.sourceHandle));\n return !matches;\n });\n const removedCount = automation.connections.length - remaining.length;\n\n if (removedCount === 0) {\n throw new Error(\n `No connection found from \"${params.sourceStep}\" to \"${params.targetStep}\"${\n params.outcome ? ` for outcome \"${params.outcome}\"` : \"\"\n }. Call get-automation to see the current connections.`\n );\n }\n\n const { steps, canvasState } = await applyAutoLayout(automation, remaining);\n const body = toPutBody(automation, { connections: remaining, steps, canvasState });\n await saveAutomation(params.automationId, body);\n\n return createToolResult({\n message: `Disconnected \"${params.sourceStep}\" -> \"${params.targetStep}\".`,\n removedCount,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(disconnectAutomationStepsTool);\n","/**\n * Automations Tool Collection\n *\n * Tools for managing Umbraco Automate automations: their definitions\n * (trigger, steps, connections), lifecycle (publish/unpublish/re-enable),\n * manual triggering, run history, webhook URLs, workspace groups, and\n * import/export of portable definitions.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\n\n// get\nimport listAutomationsTool from \"./get/list-automations.js\";\nimport getAutomationTool from \"./get/get-automation.js\";\nimport getAutomationAncestorsTool from \"./get/get-automation-ancestors.js\";\nimport exportAutomationTool from \"./get/export-automation.js\";\nimport listAutomationRunsTool from \"./get/list-automation-runs.js\";\nimport getAutomationWebhookUrlTool from \"./get/get-automation-webhook-url.js\";\nimport getAutomationGroupTool from \"./get/get-automation-group.js\";\n\n// post\nimport createAutomationTool from \"./post/create-automation.js\";\nimport publishAutomationTool from \"./post/publish-automation.js\";\nimport unpublishAutomationTool from \"./post/unpublish-automation.js\";\nimport reEnableAutomationTool from \"./post/re-enable-automation.js\";\nimport triggerAutomationTool from \"./post/trigger-automation.js\";\nimport importAutomationTool from \"./post/import-automation.js\";\nimport validateAutomationImportTool from \"./post/validate-automation-import.js\";\nimport addAutomationStepTool from \"./post/add-automation-step.js\";\nimport connectAutomationStepsTool from \"./post/connect-automation-steps.js\";\n\n// put\nimport updateAutomationTool from \"./put/update-automation.js\";\nimport importAutomationIntoExistingTool from \"./put/import-automation-into-existing.js\";\nimport updateAutomationStepTool from \"./put/update-automation-step.js\";\nimport setAutomationTriggerTool from \"./put/set-automation-trigger.js\";\n\n// delete\nimport deleteAutomationTool from \"./delete/delete-automation.js\";\nimport removeAutomationStepTool from \"./delete/remove-automation-step.js\";\nimport disconnectAutomationStepsTool from \"./delete/disconnect-automation-steps.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"automations\",\n displayName: \"Automations\",\n description:\n \"Manage Umbraco Automate automations: create/read/update/delete automation definitions, build out their trigger/step/connection graph one piece at a time, publish/unpublish/re-enable/trigger their lifecycle, inspect run history, look up webhook URLs and workspace groups, and import/export portable automation definitions.\",\n },\n tools: () => [\n listAutomationsTool,\n getAutomationTool,\n getAutomationAncestorsTool,\n exportAutomationTool,\n listAutomationRunsTool,\n getAutomationWebhookUrlTool,\n getAutomationGroupTool,\n createAutomationTool,\n publishAutomationTool,\n unpublishAutomationTool,\n reEnableAutomationTool,\n triggerAutomationTool,\n importAutomationTool,\n validateAutomationImportTool,\n updateAutomationTool,\n importAutomationIntoExistingTool,\n deleteAutomationTool,\n addAutomationStepTool,\n updateAutomationStepTool,\n removeAutomationStepTool,\n connectAutomationStepsTool,\n disconnectAutomationStepsTool,\n setAutomationTriggerTool,\n ],\n};\n\nexport default collection;\n","/**\n * List Catalogue Actions Tool\n *\n * Lists the action step definitions available for building automations,\n * optionally scoped to what a specific workspace's connections support.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getCatalogueActionsQueryParams,\n getCatalogueActionsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueActionsResponse });\n\nconst inputSchema = {\n ...getCatalogueActionsQueryParams.shape,\n workspaceId: getCatalogueActionsQueryParams.shape.workspaceId.describe(\n \"Optional. Only return items usable with connections configured in this workspace (id from list-workspaces).\",\n ),\n};\n\nconst listCatalogueActionsTool = {\n name: \"list-catalogue-actions\",\n description:\n \"Lists the available action step definitions that can be added to an automation. Each item's `alias` is the identifier used to reference that action when adding a step to an automation in the automations collection, and `connectionTypeAlias` (when present) identifies which connection type a step of this action requires. Optionally pass a `workspaceId` to only return actions usable with connections configured in that workspace. Call this before adding an action step to discover valid aliases and their settings schema. When an item's `hasDynamicOutputSchema` is true, its `outputSchema` here is only a generic placeholder and may not match the real shape - call resolve-step-type-output-schema with the configured settings to get the fields later steps can bind to.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async (params) => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueActions\"]>, ApiClient>(\n (client) => client.getCatalogueActions(params, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueActionsTool);\n","/**\n * List Catalogue Connection Types Tool\n *\n * Lists the connection type definitions available for creating connections\n * that automation steps can use to talk to external systems.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getCatalogueConnectionTypesResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueConnectionTypesResponse });\n\nconst listCatalogueConnectionTypesTool = {\n name: \"list-catalogue-connection-types\",\n description:\n \"Lists the available connection type definitions (e.g. HTTP, SMTP, Slack). Each item's `alias` identifies the connection type to use when creating a connection in the connections collection, and `settingsSchema` describes the fields required to configure that connection. Call this before creating a connection, or to check which connection type an action/trigger's `connectionTypeAlias` refers to.\",\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async () => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueConnectionTypes\"]>, ApiClient>(\n (client) => client.getCatalogueConnectionTypes(CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueConnectionTypesTool);\n","/**\n * List Catalogue Control Flows Tool\n *\n * Lists the control-flow step definitions (e.g. branch, loop) available\n * for structuring an automation's logic.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getCatalogueControlFlowsResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueControlFlowsResponse });\n\nconst listCatalogueControlFlowsTool = {\n name: \"list-catalogue-control-flows\",\n description:\n \"Lists the available control-flow step definitions (e.g. branch/condition, loop) that can be added to an automation to direct or repeat execution. Each item's `alias` is the identifier used to reference that control-flow construct when adding a step to an automation in the automations collection, and `settingsSchema` describes the fields needed to configure it. Call this before adding a control-flow step to discover valid aliases.\",\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async () => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueControlFlows\"]>, ApiClient>(\n (client) => client.getCatalogueControlFlows(CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueControlFlowsTool);\n","/**\n * List Catalogue Notification Channels Tool\n *\n * Lists the notification channel definitions available for sending alerts\n * or messages from an automation (e.g. email, Slack, Teams).\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getCatalogueNotificationChannelsResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueNotificationChannelsResponse });\n\nconst listCatalogueNotificationChannelsTool = {\n name: \"list-catalogue-notification-channels\",\n description:\n \"Lists the available notification channel definitions (e.g. email, Slack, Teams) that an automation can use to notify people. Each item's `alias` is the identifier used to reference that channel when configuring a notification step, and `settingsSchema` describes the fields required to configure it. Call this before adding a notification step to discover valid channel aliases.\",\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async () => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueNotificationChannels\"]>, ApiClient>(\n (client) => client.getCatalogueNotificationChannels(CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueNotificationChannelsTool);\n","/**\n * List Catalogue Step Types Tool\n *\n * Lists all step type definitions across every category (actions,\n * control-flows, triggers, etc.) in a single flat list.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getCatalogueStepTypesQueryParams,\n getCatalogueStepTypesResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueStepTypesResponse });\n\nconst inputSchema = {\n ...getCatalogueStepTypesQueryParams.shape,\n type: getCatalogueStepTypesQueryParams.shape.type.describe(\n \"Optional category filter, using a `type` value as returned by this tool when called without it. Omit to list every category.\",\n ),\n};\n\nconst listCatalogueStepTypesTool = {\n name: \"list-catalogue-step-types\",\n description:\n \"Lists all step type definitions available for building an automation, across every category (actions, control-flows, triggers, and more) in one flat list. Each item's `alias` is the identifier used when adding a step to an automation, and `type` identifies which category it belongs to. Optionally pass `type` to filter to a single category. Prefer the category-specific tools (list-catalogue-actions, list-catalogue-control-flows, list-catalogue-triggers) when you already know the category you need; use this tool when you need an overview across all categories or don't know which category a step belongs to. When an item's `hasDynamicOutputSchema` is true, its `outputSchema` here is only a generic placeholder and may not match the real shape - call resolve-step-type-output-schema with the configured settings to get the fields later steps can bind to.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async (params) => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueStepTypes\"]>, ApiClient>(\n (client) => client.getCatalogueStepTypes(params, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueStepTypesTool);\n","/**\n * List Catalogue Triggers Tool\n *\n * Lists the trigger definitions available for starting an automation\n * (e.g. content published, schedule, webhook received).\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getCatalogueTriggersQueryParams,\n getCatalogueTriggersResponseItem,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\n// Automate builds that predate `supportsManualRun` omit it, so it must not be\n// required or every call fails output validation on those instances.\nconst triggerItemSchema = getCatalogueTriggersResponseItem.extend({\n supportsManualRun: getCatalogueTriggersResponseItem.shape.supportsManualRun.optional(),\n});\n\nconst outputSchema = z.object({ items: z.array(triggerItemSchema) });\n\nconst inputSchema = {\n ...getCatalogueTriggersQueryParams.shape,\n workspaceId: getCatalogueTriggersQueryParams.shape.workspaceId.describe(\n \"Optional. Only return items usable with connections configured in this workspace (id from list-workspaces).\",\n ),\n};\n\nconst listCatalogueTriggersTool = {\n name: \"list-catalogue-triggers\",\n description:\n \"Lists the available trigger definitions that can start an automation (e.g. content published, schedule, webhook received). Each item's `alias` is the identifier used to reference that trigger when configuring an automation's trigger step, `supportsManualRun` (when present) indicates whether the trigger can also be fired manually, and `connectionTypeAlias` (when present) identifies which connection type it requires. Optionally pass a `workspaceId` to only return triggers usable with connections configured in that workspace. Call this before configuring an automation's trigger to discover valid aliases and their settings schema. When an item's `hasDynamicOutputSchema` is true, its `outputSchema` here is only a generic placeholder and may not match the real shape - call resolve-step-type-output-schema with the configured settings to get the fields later steps can bind to.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async (params) => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueTriggers\"]>, ApiClient>(\n (client) => client.getCatalogueTriggers(params, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueTriggersTool);\n","/**\n * List Catalogue Webhook Authenticators Tool\n *\n * Lists the webhook authenticator definitions available for securing\n * inbound webhook triggers.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getCatalogueWebhookAuthenticatorsResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({ items: getCatalogueWebhookAuthenticatorsResponse });\n\nconst listCatalogueWebhookAuthenticatorsTool = {\n name: \"list-catalogue-webhook-authenticators\",\n description:\n \"Lists the available webhook authenticator definitions (e.g. shared secret, signature verification) that can secure an inbound webhook trigger. Each item's `alias` is the identifier used to reference that authenticator when configuring a webhook trigger, and `settingsSchema` describes the fields required to configure it. Call this before configuring a webhook-triggered automation to discover valid authenticator aliases.\",\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async () => {\n return executeGetItemsApiCall<ReturnType<ApiClient[\"getCatalogueWebhookAuthenticators\"]>, ApiClient>(\n (client) => client.getCatalogueWebhookAuthenticators(CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(listCatalogueWebhookAuthenticatorsTool);\n","/**\n * Resolve Step Type Output Schema Tool\n *\n * Computes the JSON output schema a step type would produce for a given\n * configuration. Some step types have a dynamic output schema that depends\n * on their settings (e.g. a database query action's output shape depends on\n * the configured query), so this must be resolved rather than read statically\n * from the catalogue entry.\n *\n * The API answers 200 with a `null` body when the step has no output data -\n * control-flow steps like If and Parallel, or a dynamic step not configured enough\n * to resolve (Run AI Agent with no agent chosen). Passed through as-is, that null\n * becomes missing structuredContent and the MCP client rejects the result, so it\n * is reported as an explicit \"no output\" result instead.\n */\n\nimport {\n withStandardDecorators,\n getApiClient,\n createToolResult,\n createToolResultError,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n type HttpResponse,\n type ProblemDetails,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport { assertKnownSettingKeys } from \"../../automations/_shared/settings-keys.js\";\nimport { SETTINGS_KEYS_HELP } from \"../../automations/_shared/step-settings.js\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = z.object({\n alias: z\n .string()\n .describe(\n \"The step type alias to resolve, as returned by list-catalogue-actions, list-catalogue-control-flows, list-catalogue-triggers, or list-catalogue-step-types.\"\n ),\n settings: z\n .record(z.string(), z.unknown())\n .describe(\n `The step's configured settings, matching the shape described by that step type's settingsSchema, e.g. Form Submitted takes \\`formIds\\` (an array of form ids). ${SETTINGS_KEYS_HELP} Used to resolve a dynamic output schema when hasDynamicOutputSchema is true. An id that doesn't exist is not reported - it just adds nothing (a form that doesn't exist adds no fields), so check ids before relying on the result.`\n ),\n});\n\n// Any JSON schema object. Not the generated response schema: Umbraco 17's spec describes\n// it with additionalProperties, which generates a z.record, and an MCP outputSchema has to\n// be an object schema - with a record every call fails before reaching the handler.\nconst outputSchema = z.looseObject({});\n\nconst resolveStepTypeOutputSchemaTool = {\n name: \"resolve-step-type-output-schema\",\n description:\n \"Computes the JSON schema of the data a configured step would output at runtime, for a given step type alias and settings. Use this when a catalogue entry has hasDynamicOutputSchema set to true, meaning its static outputSchema is not enough — the real output shape depends on how the step is configured (e.g. the columns returned by a database query action depend on the query itself). The resolved schema tells you what fields will be available for later steps in the automation to reference. If the step has no output for these settings, the result is { hasOutput: false, message } instead of a schema: control-flow steps like If and Parallel never output data, and a dynamic step returns this until it is configured enough to resolve (e.g. Run AI Agent before an agent is chosen). Read-only: no data is created or changed.\",\n inputSchema: inputSchema.shape,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ alias, settings }) => {\n await assertKnownSettingKeys(alias, settings);\n const client = getApiClient<ApiClient>();\n const response = (await client.postCatalogueStepTypesByAliasOutputSchema(\n alias,\n { settings },\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<ProblemDetails | Record<string, unknown> | null>;\n\n if (response.status >= 200 && response.status < 300) {\n if (response.data == null) {\n return createToolResult({\n hasOutput: false,\n message: `Step type \"${alias}\" has no output for these settings, so later steps have nothing from it to reference. Control-flow steps like If and Parallel never output data; a step whose output depends on its settings (e.g. Run AI Agent without an agent chosen) resolves once it is configured.`,\n });\n }\n return createToolResult(response.data);\n }\n\n const errorData: ProblemDetails = (response.data as ProblemDetails) || {\n status: response.status,\n detail: response.statusText,\n };\n return createToolResultError(errorData);\n },\n} satisfies ToolDefinition<typeof inputSchema.shape, typeof outputSchema>;\n\nexport default withStandardDecorators(resolveStepTypeOutputSchemaTool);\n","/**\n * Catalogue Tool Collection\n *\n * Read-only reference lookups for what is available when building\n * automations: actions, connection types, control-flow constructs,\n * notification channels, step types, triggers, and webhook authenticators.\n * Aliases returned by these tools are used to configure steps in the\n * automations collection.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport listActionsTool from \"./get/list-actions.js\";\nimport listConnectionTypesTool from \"./get/list-connection-types.js\";\nimport listControlFlowsTool from \"./get/list-control-flows.js\";\nimport listNotificationChannelsTool from \"./get/list-notification-channels.js\";\nimport listStepTypesTool from \"./get/list-step-types.js\";\nimport listTriggersTool from \"./get/list-triggers.js\";\nimport listWebhookAuthenticatorsTool from \"./get/list-webhook-authenticators.js\";\nimport resolveStepTypeOutputSchemaTool from \"./post/resolve-step-type-output-schema.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"catalogue\",\n displayName: \"Catalogue\",\n description:\n \"Reference catalogue of everything available for building automations: actions, connection types, control-flow constructs, notification channels, step types, triggers, and webhook authenticators.\",\n },\n tools: () => [\n listActionsTool,\n listConnectionTypesTool,\n listControlFlowsTool,\n listNotificationChannelsTool,\n listStepTypesTool,\n listTriggersTool,\n listWebhookAuthenticatorsTool,\n resolveStepTypeOutputSchemaTool,\n ],\n};\n\nexport default collection;\n","/**\n * List Connections Tool\n *\n * Lists configured connections (credentials/endpoints to third-party services)\n * that automation steps can use.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getConnectionsQueryParams,\n getConnectionsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getConnectionsQueryParams.shape,\n filter: getConnectionsQueryParams.shape.filter.describe(\n \"Optional text matched against connection name and alias.\",\n ),\n};\n\nconst listConnectionsTool = {\n name: \"list-connections\",\n description:\n \"Lists connections configured for this Umbraco instance — the credentials/endpoints automation steps use to talk to third-party services (e.g. an email provider, a REST API, a Slack workspace). Each item includes id, alias, name, type and version, but not the connection's settings/secrets — use get-connection for the full detail on a single connection. Supports an optional text filter and cursor paging (pass nextCursor from the previous response). A connection's `type` must match one of the aliases returned by the catalogue's connection-types listing.\",\n inputSchema,\n outputSchema: getConnectionsResponse,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ filter, skip, take }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getConnections\"]>, ApiClient>(\n (client) =>\n client.getConnections({ filter, skip, take }, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getConnectionsResponse\n>;\n\nexport default withStandardDecorators(listConnectionsTool);\n","/**\n * Get Connection Tool\n *\n * Retrieves the full detail of a single connection, including its settings.\n */\n\nimport {\n withStandardDecorators,\n getApiClient,\n createToolResult,\n createToolResultError,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n type HttpResponse,\n type ProblemDetails,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getConnectionsByIdParams,\n getConnectionsByIdResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\n// Key-name patterns that commonly hold credentials in a connection's settings\n// bag. The API returns `settings` as an untyped record (its shape depends on\n// the connection's type), so there is no schema-level way to know which\n// fields are secret — matching on common naming conventions is the only\n// generic redaction available without per-type knowledge.\nconst SECRET_KEY_PATTERN =\n /secret|password|token|api[-_]?key|access[-_]?key|client[-_]?secret|private[-_]?key|credential|auth/i;\nconst REDACTED_PLACEHOLDER = \"***REDACTED***\";\n\nfunction redactSecrets(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(redactSecrets);\n }\n if (value && typeof value === \"object\") {\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>).map(([key, val]) => [\n key,\n SECRET_KEY_PATTERN.test(key) && typeof val === \"string\"\n ? REDACTED_PLACEHOLDER\n : redactSecrets(val),\n ])\n );\n }\n return value;\n}\n\nconst inputSchema = {\n ...getConnectionsByIdParams.shape,\n id: getConnectionsByIdParams.shape.id.describe(\n \"Id of the connection (from list-connections or create-connection).\",\n ),\n};\n\nconst getConnectionTool = {\n name: \"get-connection\",\n description:\n \"Gets a single connection by id, including its alias, name, type, version and settings. The settings object is whatever the connection's type requires (e.g. base URL, API key, account id) — check the catalogue's connection-types listing for the settingsSchema of a given type. Fields whose name looks like a credential (secret, password, token, api key, etc.) are redacted server-side and returned as \\\"***REDACTED***\\\" — this tool cannot be used to read back a connection's raw secret values. Use test-connection to validate credentials without needing to inspect them.\",\n inputSchema,\n outputSchema: getConnectionsByIdResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n const client = getApiClient<ApiClient>();\n const response = (await client.getConnectionsById(\n id,\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<ProblemDetails | Record<string, unknown>>;\n\n if (response.status >= 200 && response.status < 300) {\n const data = response.data as Record<string, unknown>;\n return createToolResult({\n ...data,\n settings: redactSecrets(data.settings),\n });\n }\n\n const errorData: ProblemDetails = (response.data as ProblemDetails) || {\n status: response.status,\n detail: response.statusText,\n };\n return createToolResultError(errorData);\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getConnectionsByIdResponse\n>;\n\nexport default withStandardDecorators(getConnectionTool);\n","/**\n * Create Connection Tool\n *\n * Creates a new connection (credentials/endpoint to a third-party service)\n * that automation steps can reference.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n getApiClient,\n createToolResult,\n createToolResultError,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n type HttpResponse,\n type ProblemDetails,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postConnectionsBody } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({\n message: z.string(),\n id: z.string(),\n});\n\nconst inputSchema = {\n ...postConnectionsBody.shape,\n alias: postConnectionsBody.shape.alias.describe(\n \"Unique, code-friendly alias that automation steps use to reference this connection.\",\n ),\n name: postConnectionsBody.shape.name.describe(\n \"Human-readable display name.\",\n ),\n type: postConnectionsBody.shape.type.describe(\n \"Connection type alias, from list-catalogue-connection-types (e.g. 'http').\",\n ),\n settings: postConnectionsBody.shape.settings.describe(\n \"Settings object matching that connection type's settingsSchema from list-catalogue-connection-types.\",\n ),\n};\n\nconst createConnectionTool = {\n name: \"create-connection\",\n description:\n \"Creates a new connection — a named set of credentials/endpoint settings (e.g. an API key and base URL) that automation steps can reference by alias. `type` must match one of the aliases returned by the catalogue's connection-types listing, and `settings` must satisfy that type's settingsSchema. The new connection's id is generated by the server and returned here — use test-connection afterwards to confirm the credentials actually work.\",\n inputSchema,\n outputSchema: outputSchema.shape,\n slices: [\"create\"],\n annotations: {},\n handler: async ({ alias, name, type, settings }) => {\n const client = getApiClient<ApiClient>();\n const response = (await client.postConnections(\n { alias, name, type, settings },\n CAPTURE_RAW_HTTP_RESPONSE\n )) as unknown as HttpResponse<ProblemDetails | void>;\n\n if (response.status === 201) {\n const locationHeader =\n response.headers?.[\"location\"] || response.headers?.[\"Location\"];\n let createdId = \"\";\n if (locationHeader) {\n const idMatch = locationHeader.match(/connections\\/([a-f0-9-]+)$/i);\n if (idMatch) {\n createdId = idMatch[1];\n }\n }\n return createToolResult({\n message: \"Connection created successfully\",\n id: createdId,\n });\n }\n\n const errorData: ProblemDetails = (response.data as ProblemDetails) || {\n status: response.status,\n detail: response.statusText,\n };\n return createToolResultError(errorData);\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema.shape>;\n\nexport default withStandardDecorators(createConnectionTool);\n","/**\n * Test Connection Tool\n *\n * Validates that a saved connection's credentials/settings actually work\n * against the third-party service, without persisting any state.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n postConnectionsByIdTestParams,\n postConnectionsByIdTestResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postConnectionsByIdTestParams.shape,\n id: postConnectionsByIdTestParams.shape.id.describe(\n \"Id of the saved connection to test.\",\n ),\n};\n\nconst testConnectionTool = {\n name: \"test-connection\",\n description:\n \"Tests an already-saved connection by id — attempts to reach the third-party service with its stored settings and reports whether the credentials/endpoint are valid. Read-only: it does not change the connection or create/consume any resource on the third-party side. Returns a status of Success, Warning or Failure plus human-readable details explaining the result. Use this after create-connection or update-connection to confirm the credentials actually work.\",\n inputSchema,\n outputSchema: postConnectionsByIdTestResponse,\n slices: [\"action\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n return executeGetApiCall<\n ReturnType<ApiClient[\"postConnectionsByIdTest\"]>,\n ApiClient\n >((client) => client.postConnectionsByIdTest(id, CAPTURE_RAW_HTTP_RESPONSE));\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof postConnectionsByIdTestResponse\n>;\n\nexport default withStandardDecorators(testConnectionTool);\n","/**\n * Update Connection Tool\n *\n * Replaces a connection's alias, name, type and settings. Uses optimistic\n * concurrency (version) to detect conflicting edits.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n putConnectionsByIdParams,\n putConnectionsByIdBody,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = z.object({\n ...putConnectionsByIdParams.shape,\n ...putConnectionsByIdBody.shape,\n id: putConnectionsByIdParams.shape.id.describe(\n \"Id of the connection to update.\",\n ),\n alias: putConnectionsByIdBody.shape.alias.describe(\n \"Connection alias. Pass the current value to keep it.\",\n ),\n name: putConnectionsByIdBody.shape.name.describe(\n \"Display name. Pass the current value to keep it.\",\n ),\n type: putConnectionsByIdBody.shape.type.describe(\n \"Connection type alias from list-catalogue-connection-types. Pass the current value to keep it.\",\n ),\n settings: putConnectionsByIdBody.shape.settings.describe(\n \"The complete settings object for the connection type. Replaces the stored settings - include every field you want to keep.\",\n ),\n version: putConnectionsByIdBody.shape.version.describe(\n \"The connection's current version from get-connection. A stale value is rejected as a conflict.\",\n ),\n});\n\nconst updateConnectionTool = {\n name: \"update-connection\",\n description:\n \"Replaces a connection's alias, name, type and settings by id. This is a full replace, not a partial patch — provide all fields, including any settings you want to keep. Requires the connection's current `version` (from get-connection or list-connections) to detect conflicting edits from someone else; a mismatched version returns a conflict error, so re-fetch and retry. A connection's `type` must match one of the aliases returned by the catalogue's connection-types listing, and its settings must satisfy that type's settingsSchema.\",\n inputSchema: inputSchema.shape,\n slices: [\"update\"],\n annotations: {\n idempotentHint: true,\n },\n handler: async ({ id, alias, name, type, settings, version }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.putConnectionsById(\n id,\n { alias, name, type, settings, version },\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema.shape>;\n\nexport default withStandardDecorators(updateConnectionTool);\n","/**\n * Delete Connection Tool\n *\n * Permanently removes a connection. Any automation step that references it\n * will fail at runtime until repointed to a different connection.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { deleteConnectionsByIdParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...deleteConnectionsByIdParams.shape,\n id: deleteConnectionsByIdParams.shape.id.describe(\n \"Id of the connection to delete permanently.\",\n ),\n};\n\nconst deleteConnectionTool = {\n name: \"delete-connection\",\n description:\n \"Permanently deletes a connection by id. This is not reversible and is not idempotent — calling it again on an already-deleted connection returns a not-found error. Any automation step still referencing this connection will fail the next time it runs, so check for references before deleting.\",\n inputSchema,\n slices: [\"delete\"],\n annotations: {\n destructiveHint: true,\n },\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.deleteConnectionsById(id, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(deleteConnectionTool);\n","/**\n * Connections Tool Collection\n *\n * Tools for managing connections — configured credentials/endpoints to\n * third-party services that automation steps reference (e.g. an email\n * provider, a REST API, a Slack workspace).\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport listConnectionsTool from \"./get/list-connections.js\";\nimport getConnectionTool from \"./get/get-connection.js\";\nimport createConnectionTool from \"./post/create-connection.js\";\nimport testConnectionTool from \"./post/test-connection.js\";\nimport updateConnectionTool from \"./put/update-connection.js\";\nimport deleteConnectionTool from \"./delete/delete-connection.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"connections\",\n displayName: \"Connections\",\n description:\n \"Manage connections — configured credentials/endpoints to third-party services that automation steps can reference by alias\",\n },\n tools: () => [\n listConnectionsTool,\n getConnectionTool,\n createConnectionTool,\n testConnectionTool,\n updateConnectionTool,\n deleteConnectionTool,\n ],\n};\n\nexport default collection;\n","/**\n * Get Metrics Tool\n *\n * Returns overall run statistics across the workspace (or across all\n * workspaces the caller can see, if no workspaceId is given): total number\n * of runs, a breakdown of run counts per status, and the overall success\n * rate. Use this for a single top-level health snapshot of automation runs.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getMetricsQueryParams,\n getMetricsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\n// byStatus only holds the statuses that have runs (an instance with none returns {}).\n// The Umbraco 17 spec lists every status as a required key, so the generated schema\n// would reject that on every instance with fewer than all seven statuses in use.\nconst outputSchema = getMetricsResponse.extend({\n byStatus: z.record(z.string(), z.int()),\n});\n\nconst inputSchema = {\n ...getMetricsQueryParams.shape,\n workspaceId: getMetricsQueryParams.shape.workspaceId.describe(\n \"Optional. Only count runs of automations in this workspace (id from list-workspaces).\",\n ),\n from: getMetricsQueryParams.shape.from.describe(\n \"Optional start of the time window, as an ISO 8601 date-time (e.g. '2026-09-01T00:00:00Z'). Omit for no lower bound.\",\n ),\n to: getMetricsQueryParams.shape.to.describe(\n \"Optional end of the time window, as an ISO 8601 date-time (e.g. '2026-09-30T23:59:59Z'). Omit for no upper bound.\",\n ),\n};\n\nconst getMetricsTool = {\n name: \"get-metrics\",\n description:\n \"Gets overall automation run metrics: totalRuns, a byStatus breakdown (e.g. how many runs are Completed, Failed, Running), and successRate (successful runs / total runs). Optionally scope to a single workspace with workspaceId, and/or restrict to runs started within [from, to] (ISO 8601 date-times). If from/to are omitted, the metrics cover all recorded runs with no time restriction. Use get-metrics-by-automation instead when you need the breakdown per individual automation rather than one aggregate total.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ workspaceId, from, to }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getMetrics\"]>, ApiClient>(\n (client) =>\n client.getMetrics(\n { workspaceId, from, to },\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof outputSchema\n>;\n\nexport default withStandardDecorators(getMetricsTool);\n","/**\n * Get Metrics By Automation Tool\n *\n * Returns run counts broken down per individual automation: total runs,\n * successes, and failures for each automation. Use this to compare\n * automations against each other or find which ones are failing most often.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getMetricsByAutomationQueryParams,\n getMetricsByAutomationResponseItem,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({\n items: z.array(getMetricsByAutomationResponseItem),\n});\n\nconst inputSchema = {\n ...getMetricsByAutomationQueryParams.shape,\n workspaceId: getMetricsByAutomationQueryParams.shape.workspaceId.describe(\n \"Optional. Only count runs of automations in this workspace (id from list-workspaces).\",\n ),\n from: getMetricsByAutomationQueryParams.shape.from.describe(\n \"Optional start of the time window, as an ISO 8601 date-time (e.g. '2026-09-01T00:00:00Z'). Omit for no lower bound.\",\n ),\n to: getMetricsByAutomationQueryParams.shape.to.describe(\n \"Optional end of the time window, as an ISO 8601 date-time (e.g. '2026-09-30T23:59:59Z'). Omit for no upper bound.\",\n ),\n take: getMetricsByAutomationQueryParams.shape.take.describe(\n \"Maximum number of automations to return (default 10).\",\n ),\n};\n\nconst getMetricsByAutomationTool = {\n name: \"get-metrics-by-automation\",\n description:\n \"Gets automation run metrics broken down per individual automation. Each item has automationId, automationName, totalRuns, successCount, and failCount, so you can compare automations or spot which ones fail most. Optionally scope to a single workspace with workspaceId, and/or restrict to runs started within [from, to] (ISO 8601 date-times) — if omitted, all recorded runs are considered. `take` limits how many automations are returned (defaults to 10) — the ordering of results is determined by the API and not otherwise documented here, so raise `take` if you need to confirm whether an automation you're looking for is included; there is no `skip`/total-count for this endpoint, so a full response cannot be distinguished from a truncated one. Use get-metrics instead when you only need one overall total rather than a per-automation list.\",\n inputSchema,\n outputSchema,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ workspaceId, from, to, take }) => {\n return executeGetItemsApiCall<\n ReturnType<ApiClient[\"getMetricsByAutomation\"]>,\n ApiClient\n >((client) =>\n client.getMetricsByAutomation(\n { workspaceId, from, to, take },\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof outputSchema\n>;\n\nexport default withStandardDecorators(getMetricsByAutomationTool);\n","/**\n * Metrics Tool Collection\n *\n * Read-only analytics/reporting tools over automation run history:\n * overall run statistics and per-automation breakdowns.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport getMetricsTool from \"./get/get-metrics.js\";\nimport getMetricsByAutomationTool from \"./get/get-metrics-by-automation.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"metrics\",\n displayName: \"Metrics\",\n description:\n \"Analytics and reporting over automation run history: overall run totals/success rate, and per-automation run counts.\",\n },\n tools: () => [getMetricsTool, getMetricsByAutomationTool],\n};\n\nexport default collection;\n","/**\n * List Runs Tool\n *\n * Lists workflow run instances across all automations, newest first, with\n * simple skip/take paging. Each run belongs to an automation in the\n * \"automations\" collection and reports its own lifecycle status.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getRunsQueryParams,\n getRunsResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst listRunsTool = {\n name: \"list-runs\",\n description:\n \"Lists workflow run instances across all automations, most recent first, with cursor paging (pass nextCursor from the previous response). Each item reports its lifecycle status (Pending, Running, Completed, Failed, Suspended, Cancelled, Rejected) plus the automation it belongs to. Use get-run-by-id for full step-by-step detail on a specific run, and list-pending-approvals (approvals collection) to see which runs are currently blocked waiting on a human decision.\",\n inputSchema: getRunsQueryParams.shape,\n outputSchema: getRunsResponse,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ skip, take }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getRuns\"]>, ApiClient>(\n (client) => client.getRuns({ skip, take }, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<\n typeof getRunsQueryParams.shape,\n typeof getRunsResponse\n>;\n\nexport default withStandardDecorators(listRunsTool);\n","/**\n * Get Run By Id Tool\n *\n * Returns the full detail of a single workflow run, including the\n * step-by-step execution state (stepRuns) so callers can see exactly which\n * step is running, failed, or waiting on something.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getRunsByIdParams,\n getRunsByIdResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getRunsByIdParams.shape,\n id: getRunsByIdParams.shape.id.describe(\n \"Id of the run (from list-runs or list-automation-runs).\",\n ),\n};\n\nconst getRunByIdTool = {\n name: \"get-run-by-id\",\n description:\n \"Gets the full detail of a single workflow run by id, including the automation it belongs to, its overall status (Pending, Running, Completed, Failed, Suspended, Cancelled, Rejected), and the step-by-step execution state (stepRuns) with each step's own status, timing, and error if any. A step in status WaitingForInput is blocked on a human decision — check list-pending-approvals (approvals collection) for the matching approval.\",\n inputSchema,\n outputSchema: getRunsByIdResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ id }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getRunsById\"]>, ApiClient>(\n (client) => client.getRunsById(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getRunsByIdResponse\n>;\n\nexport default withStandardDecorators(getRunByIdTool);\n","/**\n * Replay Run Tool\n *\n * Re-executes a finished workflow run from the start as a brand new run.\n * Only valid once a run has reached a terminal status — Completed, Failed,\n * Cancelled, or Rejected. Use resume-run instead if the run is Suspended.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postRunsByIdReplayParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postRunsByIdReplayParams.shape,\n id: postRunsByIdReplayParams.shape.id.describe(\n \"Id of the finished run to replay.\",\n ),\n};\n\nconst replayRunTool = {\n name: \"replay-run\",\n description:\n \"Re-executes a finished workflow run from the start, creating a new run against the same automation. Only valid once the run has reached a terminal status (Completed, Failed, Cancelled, or Rejected) — check status via get-run-by-id first. For a run that is Suspended, use resume-run instead.\",\n inputSchema,\n slices: [\"action\"],\n annotations: {},\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postRunsByIdReplay(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, undefined>;\n\nexport default withStandardDecorators(replayRunTool);\n","/**\n * Resume Run Tool\n *\n * Resumes a workflow run that is currently Suspended, continuing execution\n * from where it was paused. Not valid for runs in any other status.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postRunsByIdResumeParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postRunsByIdResumeParams.shape,\n id: postRunsByIdResumeParams.shape.id.describe(\n \"Id of the Suspended run to continue.\",\n ),\n};\n\nconst resumeRunTool = {\n name: \"resume-run\",\n description:\n \"Resumes a workflow run that is currently Suspended, continuing execution from where it was paused. Only valid when the run's status is Suspended — check status via get-run-by-id first. Not the same as replay-run, which starts a finished run over from the beginning.\",\n inputSchema,\n slices: [\"action\"],\n annotations: {},\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postRunsByIdResume(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, undefined>;\n\nexport default withStandardDecorators(resumeRunTool);\n","/**\n * Suspend Run Tool\n *\n * Pauses a workflow run that is currently in progress (Pending or Running),\n * leaving it in a Suspended state that can later be continued with\n * resume-run.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postRunsByIdSuspendParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postRunsByIdSuspendParams.shape,\n id: postRunsByIdSuspendParams.shape.id.describe(\n \"Id of the Pending or Running run to pause.\",\n ),\n};\n\nconst suspendRunTool = {\n name: \"suspend-run\",\n description:\n \"Pauses a workflow run that is currently in progress (status Pending or Running), leaving it Suspended so it can be continued later with resume-run instead of running to completion. Not valid for a run that has already finished or been terminated — check status via get-run-by-id first.\",\n inputSchema,\n slices: [\"action\"],\n annotations: {},\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postRunsByIdSuspend(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, undefined>;\n\nexport default withStandardDecorators(suspendRunTool);\n","/**\n * Terminate Run Tool\n *\n * Force-stops a workflow run that has not yet reached a terminal status,\n * marking it Cancelled. This is irreversible — the run cannot be resumed or\n * replayed afterwards, only started again as a new trigger of the\n * automation.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postRunsByIdTerminateParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postRunsByIdTerminateParams.shape,\n id: postRunsByIdTerminateParams.shape.id.describe(\n \"Id of the Pending, Running or Suspended run to stop.\",\n ),\n};\n\nconst terminateRunTool = {\n name: \"terminate-run\",\n description:\n \"Force-stops a workflow run that is Pending, Running, or Suspended, cancelling it immediately. This is irreversible — a terminated run cannot be resumed or replayed; the automation must be triggered again to start a new run. Use suspend-run instead if you only want to pause the run temporarily.\",\n inputSchema,\n slices: [\"action\"],\n annotations: {\n destructiveHint: true,\n },\n handler: async ({ id }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postRunsByIdTerminate(id, CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, undefined>;\n\nexport default withStandardDecorators(terminateRunTool);\n","/**\n * Runs Tool Collection\n *\n * Tools for inspecting and controlling workflow run instances — one run per\n * execution of an automation. Covers listing runs, viewing step-by-step\n * execution detail, and lifecycle actions (replay, resume, suspend,\n * terminate).\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport listRunsTool from \"./get/list-runs.js\";\nimport getRunByIdTool from \"./get/get-run-by-id.js\";\nimport replayRunTool from \"./post/replay-run.js\";\nimport resumeRunTool from \"./post/resume-run.js\";\nimport suspendRunTool from \"./post/suspend-run.js\";\nimport terminateRunTool from \"./post/terminate-run.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"runs\",\n displayName: \"Runs\",\n description:\n \"Inspect and control workflow run instances — list runs, view step-by-step execution detail, and replay, resume, suspend, or terminate a run.\",\n },\n tools: () => [\n listRunsTool,\n getRunByIdTool,\n replayRunTool,\n resumeRunTool,\n suspendRunTool,\n terminateRunTool,\n ],\n};\n\nexport default collection;\n","/**\n * Get Version History Supported Types Tool\n *\n * Lists the entityType values accepted by every other version-history tool\n * (list-version-history, get-version-history-entry, compare-version-history,\n * rollback-version-history). Call this first if you are not already sure\n * which entityType string to use for the entity you are working with.\n */\n\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getVersionHistorySupportedTypesResponseItem } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst outputSchema = z.object({\n items: z.array(getVersionHistorySupportedTypesResponseItem),\n});\n\nconst getVersionHistorySupportedTypesTool = {\n name: \"list-version-history-supported-types\",\n description:\n \"Lists the entityType strings (PascalCase, e.g. 'Automation') that the version-history tools accept. Version history is a generic versioning/audit-trail feature over entities such as automations, letting you view past versions, compare them, and roll back. Call this before list-version-history, get-version-history-entry, compare-version-history, or rollback-version-history to confirm which entityType value to pass for the entity you are inspecting.\",\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n outputSchema,\n handler: async () => {\n return executeGetItemsApiCall<\n ReturnType<ApiClient[\"getVersionHistorySupportedTypes\"]>,\n ApiClient\n >((client) =>\n client.getVersionHistorySupportedTypes(CAPTURE_RAW_HTTP_RESPONSE),\n );\n },\n} satisfies ToolDefinition<undefined, typeof outputSchema>;\n\nexport default withStandardDecorators(getVersionHistorySupportedTypesTool);\n","/**\n * List Version History Tool\n *\n * Lists the recorded versions for a single entity (e.g. an automation),\n * along with the entity's current version number, total version count,\n * and (if applicable) which version is currently published.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getVersionHistoryByEntityTypeByEntityIdParams,\n getVersionHistoryByEntityTypeByEntityIdQueryParams,\n getVersionHistoryByEntityTypeByEntityIdResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = getVersionHistoryByEntityTypeByEntityIdParams.extend({\n ...getVersionHistoryByEntityTypeByEntityIdQueryParams.shape,\n entityType: getVersionHistoryByEntityTypeByEntityIdParams.shape.entityType.describe(\n \"Entity type in PascalCase, e.g. 'Automation'. See list-version-history-supported-types for the accepted values.\",\n ),\n entityId: getVersionHistoryByEntityTypeByEntityIdParams.shape.entityId.describe(\n \"Id of the entity whose history to list, e.g. an automation id.\",\n ),\n});\n\nconst listVersionHistoryTool = {\n name: \"list-version-history\",\n description:\n \"Lists the version history for a single entity, given its entityType and entityId. Returns currentVersion, totalVersions, publishedVersion (if any version is currently published), and a page of version entries (id, version number, dateCreated, createdByUserId, changeDescription, isPublished) ordered newest first. Use list-version-history-supported-types to confirm a valid entityType (PascalCase, e.g. 'Automation'). For entities with many versions, page through the history by passing nextCursor from the previous response. Use the version numbers returned here with get-version-history-entry, compare-version-history, or rollback-version-history.\",\n inputSchema: inputSchema.shape,\n outputSchema: getVersionHistoryByEntityTypeByEntityIdResponse,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ entityType, entityId, skip, take }) => {\n return executeGetApiCall<\n ReturnType<ApiClient[\"getVersionHistoryByEntityTypeByEntityId\"]>,\n ApiClient\n >((client) =>\n client.getVersionHistoryByEntityTypeByEntityId(\n entityType,\n entityId,\n { skip, take },\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema.shape,\n typeof getVersionHistoryByEntityTypeByEntityIdResponse\n>;\n\nexport default withStandardDecorators(listVersionHistoryTool);\n","/**\n * Get Version History Entry Tool\n *\n * Gets the snapshot metadata for one specific past version of an entity.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams,\n getVersionHistoryByEntityTypeByEntityIdByEntityVersionResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams.shape,\n entityType: getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams.shape.entityType.describe(\n \"Entity type in PascalCase, e.g. 'Automation'. See list-version-history-supported-types for the accepted values.\",\n ),\n entityId: getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams.shape.entityId.describe(\n \"Id of the entity whose history to read, e.g. an automation id.\",\n ),\n entityVersion: getVersionHistoryByEntityTypeByEntityIdByEntityVersionParams.shape.entityVersion.describe(\n \"Version number to read, from list-version-history (1 is the original creation).\",\n ),\n};\n\nconst getVersionHistoryEntryTool = {\n name: \"get-version-history-entry\",\n description:\n \"Gets one specific past version of an entity, identified by entityType, entityId, and entityVersion. Returns that version's id, version number, dateCreated, createdByUserId, changeDescription, and whether it isPublished. Use list-version-history first to find valid entityVersion numbers for the entity. Use list-version-history-supported-types to confirm a valid entityType (PascalCase, e.g. 'Automation').\",\n inputSchema,\n outputSchema: getVersionHistoryByEntityTypeByEntityIdByEntityVersionResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ entityType, entityId, entityVersion }) => {\n return executeGetApiCall<\n ReturnType<\n ApiClient[\"getVersionHistoryByEntityTypeByEntityIdByEntityVersion\"]\n >,\n ApiClient\n >((client) =>\n client.getVersionHistoryByEntityTypeByEntityIdByEntityVersion(\n entityType,\n entityId,\n entityVersion,\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getVersionHistoryByEntityTypeByEntityIdByEntityVersionResponse\n>;\n\nexport default withStandardDecorators(getVersionHistoryEntryTool);\n","/**\n * Compare Version History Tool\n *\n * Diffs two versions of the same entity, returning the individual field\n * changes (path, oldValue, newValue) between them.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams,\n getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams.shape,\n entityType: getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams.shape.entityType.describe(\n \"Entity type in PascalCase, e.g. 'Automation'. See list-version-history-supported-types for the accepted values.\",\n ),\n entityId: getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams.shape.entityId.describe(\n \"Id of the entity whose history to read, e.g. an automation id.\",\n ),\n fromEntityVersion: getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams.shape.fromEntityVersion.describe(\n \"The older version number to compare from, from list-version-history.\",\n ),\n toEntityVersion: getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionParams.shape.toEntityVersion.describe(\n \"The newer version number to compare to, from list-version-history.\",\n ),\n};\n\nconst compareVersionHistoryTool = {\n name: \"compare-version-history\",\n description:\n \"Compares two versions of an entity (fromEntityVersion vs toEntityVersion) and returns the list of field-level changes between them, each with the field path, oldValue, and newValue. Use list-version-history first to find valid version numbers for the entity. Use list-version-history-supported-types to confirm a valid entityType (PascalCase, e.g. 'Automation'). Review the diff here before deciding whether to call rollback-version-history.\",\n inputSchema,\n outputSchema:\n getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionResponse,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({\n entityType,\n entityId,\n fromEntityVersion,\n toEntityVersion,\n }) => {\n return executeGetApiCall<\n ReturnType<\n ApiClient[\"getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersion\"]\n >,\n ApiClient\n >((client) =>\n client.getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersion(\n entityType,\n entityId,\n fromEntityVersion,\n toEntityVersion,\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n typeof getVersionHistoryByEntityTypeByEntityIdByFromEntityVersionCompareByToEntityVersionResponse\n>;\n\nexport default withStandardDecorators(compareVersionHistoryTool);\n","/**\n * Rollback Version History Tool\n *\n * Rolls an entity back to a previously recorded version, replacing its\n * current state with that version's snapshot. This has a real, immediate\n * side effect and creates a new current version — it is not a preview.\n */\n\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams.shape,\n entityType: postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams.shape.entityType.describe(\n \"Entity type in PascalCase, e.g. 'Automation'. See list-version-history-supported-types for the accepted values.\",\n ),\n entityId: postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams.shape.entityId.describe(\n \"Id of the entity whose history to read, e.g. an automation id.\",\n ),\n entityVersion: postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollbackParams.shape.entityVersion.describe(\n \"Version number to restore, from list-version-history.\",\n ),\n};\n\nconst rollbackVersionHistoryTool = {\n name: \"rollback-version-history\",\n description:\n \"Rolls an entity back to a specific past version, identified by entityType, entityId, and entityVersion. This overwrites the entity's current state with that version's snapshot and has a real, immediate side effect — it is not reversible except by rolling back again to another version. Use list-version-history to find valid version numbers and compare-version-history to review what will change before calling this. Use list-version-history-supported-types to confirm a valid entityType (PascalCase, e.g. 'Automation').\",\n inputSchema,\n slices: [\"action\"],\n annotations: {\n destructiveHint: true,\n },\n handler: async ({ entityType, entityId, entityVersion }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.postVersionHistoryByEntityTypeByEntityIdByEntityVersionRollback(\n entityType,\n entityId,\n entityVersion,\n CAPTURE_RAW_HTTP_RESPONSE,\n ),\n );\n },\n} satisfies ToolDefinition<\n typeof inputSchema,\n undefined\n>;\n\nexport default withStandardDecorators(rollbackVersionHistoryTool);\n","/**\n * Version History Tool Collection\n *\n * A generic versioning/audit-trail feature over entities such as\n * automations: list an entity's recorded versions, inspect a single past\n * version, diff two versions, and roll back to a prior version.\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport getVersionHistorySupportedTypesTool from \"./get/list-version-history-supported-types.js\";\nimport listVersionHistoryTool from \"./get/list-version-history.js\";\nimport getVersionHistoryEntryTool from \"./get/get-version-history-entry.js\";\nimport compareVersionHistoryTool from \"./get/compare-version-history.js\";\nimport rollbackVersionHistoryTool from \"./post/rollback-version-history.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"version-history\",\n displayName: \"Version History\",\n description:\n \"View, compare, and roll back past versions of versioned entities (e.g. automations).\",\n },\n tools: () => [\n getVersionHistorySupportedTypesTool,\n listVersionHistoryTool,\n getVersionHistoryEntryTool,\n compareVersionHistoryTool,\n rollbackVersionHistoryTool,\n ],\n};\n\nexport default collection;\n","/**\n * List Workspaces Tool\n *\n * Lists workspaces with optional name/alias filtering and pagination. A\n * workspace is the top-level container that scopes a set of automations,\n * groups (folders that organize those automations), the connections\n * automations inside it may use, and which Umbraco user groups can manage it.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport {\n getWorkspacesQueryParams,\n getWorkspacesResponse,\n} from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n ...getWorkspacesQueryParams.shape,\n filter: getWorkspacesQueryParams.shape.filter.describe(\n \"Optional text matched against workspace name and alias.\",\n ),\n};\nconst outputSchema = getWorkspacesResponse;\n\nconst listWorkspacesTool = {\n name: \"list-workspaces\",\n description:\n \"Lists workspaces, optionally filtered by name/alias, with cursor paging (pass nextCursor from the previous response). Each result includes the workspace id, alias, name, and version needed to fetch, update, or list groups within it. Use list-workspace-groups afterwards to see how a specific workspace organizes its automations into groups.\",\n inputSchema,\n outputSchema,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ filter, skip, take }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getWorkspaces\"]>, ApiClient>(\n (client) =>\n client.getWorkspaces({ filter, skip, take }, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(listWorkspacesTool);\n","/**\n * Get Workspace Tool\n *\n * Fetches a single workspace by id, including its alias, the service account\n * key it runs automations as, the user groups allowed to manage it, and the\n * connections its automations are allowed to use. The returned `version`\n * value is required when calling update-workspace.\n */\n\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getWorkspacesByIdResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace to fetch.\"),\n};\nconst outputSchema = getWorkspacesByIdResponse;\n\nconst getWorkspaceTool = {\n name: \"get-workspace\",\n description:\n \"Gets a single workspace by id. Returns its alias, name, service account key, allowed user groups and connections, and the optimistic-concurrency `version` needed for update-workspace. Use list-workspaces to find a workspace id first.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ workspaceId }) => {\n return executeGetApiCall<ReturnType<ApiClient[\"getWorkspacesById\"]>, ApiClient>(\n (client) => client.getWorkspacesById(workspaceId, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(getWorkspaceTool);\n","/**\n * List Workspace Groups Tool\n *\n * Lists the groups (folders) a workspace uses to organize its automations.\n * Groups can be nested via `parentId`. This only returns one level at a\n * time: omit `parentGroupId` to list the workspace's top-level groups, or\n * pass a group id to list that group's direct children - it does not\n * recursively return every nested group in one call. Once you have a group\n * id, use `automations/groups/{groupId}` tools (in the automations\n * collection) to list the automations filed under it.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeGetItemsApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getWorkspacesByIdGroupsResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace whose groups to list.\"),\n parentGroupId: z\n .string()\n .optional()\n .describe(\n \"Optional parent group id. When set, returns only that group's direct children. When omitted, returns only the workspace's top-level groups (those with no parent) - not every group in the workspace. To see all groups, walk the tree: list top-level groups, then call this again with each group's id to list its children, recursively.\"\n ),\n};\nconst outputSchema = z.object({ items: getWorkspacesByIdGroupsResponse });\n\nconst listWorkspaceGroupsTool = {\n name: \"list-workspace-groups\",\n description:\n \"Lists one level of the groups a workspace uses to organize its automations: either the top-level groups (parentGroupId omitted) or the direct children of one group (parentGroupId set). This does not recursively return nested groups in a single call - call it again with a child group's id to go one level deeper. Each item includes the group id, name, parentId (for nesting) and workspaceId. Use get-workspace-group for a single group, or automations tools to see the automations filed under a group.\",\n inputSchema,\n outputSchema,\n slices: [\"list\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ workspaceId, parentGroupId }) => {\n return executeGetItemsApiCall<\n ReturnType<ApiClient[\"getWorkspacesByIdGroups\"]>,\n ApiClient\n >((client) =>\n client.getWorkspacesByIdGroups(\n workspaceId,\n { parentGroupId },\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(listWorkspaceGroupsTool);\n","/**\n * Get Workspace Group Tool\n *\n * Fetches a single group within a workspace by id. Groups are folders used\n * to organize the automations that live inside a workspace, and can be\n * nested via `parentId`.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeGetApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { getWorkspacesByIdGroupsByGroupIdResponse } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace the group belongs to.\"),\n groupId: z.string().describe(\"The id of the group to fetch.\"),\n};\nconst outputSchema = getWorkspacesByIdGroupsByGroupIdResponse;\n\nconst getWorkspaceGroupTool = {\n name: \"get-workspace-group\",\n description:\n \"Gets a single group within a workspace by id, including its name and optional parentId for nesting. Use list-workspace-groups to find a group id first, and automations tools to see the automations filed under it.\",\n inputSchema,\n outputSchema,\n slices: [\"read\"],\n annotations: {\n readOnlyHint: true,\n },\n handler: async ({ workspaceId, groupId }) => {\n return executeGetApiCall<\n ReturnType<ApiClient[\"getWorkspacesByIdGroupsByGroupId\"]>,\n ApiClient\n >((client) =>\n client.getWorkspacesByIdGroupsByGroupId(\n workspaceId,\n groupId,\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(getWorkspaceGroupTool);\n","/**\n * Create Workspace Tool\n *\n * Creates a new workspace. A workspace is the top-level container that\n * scopes a set of automations, the groups used to organize them, which\n * connections they're allowed to use, and which Umbraco user groups can\n * manage it. Uses manual response handling to extract the new workspace's\n * id from the Location header (the API returns 201 with no body).\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n createToolResult,\n UmbracoApiError,\n CAPTURE_RAW_HTTP_RESPONSE,\n getApiClient,\n type ToolDefinition,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n alias: z.string().min(1).describe(\"Unique machine alias for the workspace.\"),\n name: z.string().min(1).describe(\"Human-friendly display name for the workspace.\"),\n serviceAccountKey: z\n .string()\n .describe(\"Id of the Umbraco service account the workspace's automations run as.\"),\n userGroups: z\n .array(z.string())\n .optional()\n .default([])\n .describe(\"Ids of the Umbraco user groups allowed to manage this workspace.\"),\n allowedConnections: z\n .array(z.string())\n .optional()\n .default([])\n .describe(\"Ids of the connections that automations in this workspace are allowed to use.\"),\n};\n\nconst outputSchema = z.object({\n success: z.boolean(),\n id: z.string().optional(),\n location: z.string().optional(),\n});\n\nconst createWorkspaceTool = {\n name: \"create-workspace\",\n description:\n \"Creates a new workspace to hold automations. A workspace is the top-level container that scopes automations, the groups (folders) used to organize them, the connections its automations may use, and which Umbraco user groups can manage it. Follow up with create-workspace-group to add folders, or automations tools to add automations to it.\",\n inputSchema,\n outputSchema,\n slices: [\"create\"],\n annotations: {\n destructiveHint: false,\n idempotentHint: false,\n },\n handler: async ({ alias, name, serviceAccountKey, userGroups, allowedConnections }) => {\n const client = getApiClient<ApiClient>();\n const response = (await client.postWorkspaces(\n { alias, name, serviceAccountKey, userGroups, allowedConnections },\n CAPTURE_RAW_HTTP_RESPONSE\n )) as HttpResponse;\n\n if (response.status !== 201) {\n const errorData = response.data as Record<string, unknown> | undefined;\n throw new UmbracoApiError(\n errorData || {\n status: response.status,\n detail: response.statusText,\n }\n );\n }\n\n const location = response.headers?.Location || response.headers?.location;\n const id = location?.split(\"/\").pop();\n\n return createToolResult({\n success: true,\n id,\n location,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(createWorkspaceTool);\n","/**\n * Create Workspace Group Tool\n *\n * Creates a new group (folder) within a workspace, used to organize the\n * automations that live inside it. Groups can be nested by passing a\n * `parentId`. Uses manual response handling to extract the new group's id\n * from the Location header (the API returns 201 with no body).\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n createToolResult,\n UmbracoApiError,\n CAPTURE_RAW_HTTP_RESPONSE,\n getApiClient,\n type ToolDefinition,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace to create the group in.\"),\n name: z.string().min(1).describe(\"Display name for the group.\"),\n parentId: z\n .string()\n .nullish()\n .describe(\"Optional id of a parent group, to nest this group underneath it. Omit for a top-level group.\"),\n};\n\nconst outputSchema = z.object({\n success: z.boolean(),\n id: z.string().optional(),\n location: z.string().optional(),\n});\n\nconst createWorkspaceGroupTool = {\n name: \"create-workspace-group\",\n description:\n \"Creates a new group (folder) within a workspace to organize its automations. Pass parentId to nest it under an existing group, or omit it to create a top-level group. Use list-workspace-groups to find existing groups, and automations tools to file automations under the new group.\",\n inputSchema,\n outputSchema,\n slices: [\"create\"],\n annotations: {\n destructiveHint: false,\n idempotentHint: false,\n },\n handler: async ({ workspaceId, name, parentId }) => {\n const client = getApiClient<ApiClient>();\n const response = (await client.postWorkspacesByIdGroups(\n workspaceId,\n { name, parentId },\n CAPTURE_RAW_HTTP_RESPONSE\n )) as HttpResponse;\n\n if (response.status !== 201) {\n const errorData = response.data as Record<string, unknown> | undefined;\n throw new UmbracoApiError(\n errorData || {\n status: response.status,\n detail: response.statusText,\n }\n );\n }\n\n const location = response.headers?.Location || response.headers?.location;\n const id = location?.split(\"/\").pop();\n\n return createToolResult({\n success: true,\n id,\n location,\n });\n },\n} satisfies ToolDefinition<typeof inputSchema, typeof outputSchema>;\n\nexport default withStandardDecorators(createWorkspaceGroupTool);\n","/**\n * Update Workspace Tool\n *\n * Updates an existing workspace's alias, name, service account, allowed\n * user groups, and allowed connections. Requires the current `version`\n * (from get-workspace or list-workspaces) for optimistic concurrency — the\n * update is rejected if the workspace has changed since that version was\n * read.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { putWorkspacesByIdBody } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace to update.\"),\n ...putWorkspacesByIdBody.shape,\n alias: putWorkspacesByIdBody.shape.alias.describe(\n \"Unique machine alias for the workspace. Pass the current value to keep it.\",\n ),\n name: putWorkspacesByIdBody.shape.name.describe(\n \"Display name for the workspace. Pass the current value to keep it.\",\n ),\n serviceAccountKey: putWorkspacesByIdBody.shape.serviceAccountKey.describe(\n \"Id of the Umbraco user the workspace's automations run as. Pass the current value from get-workspace to keep it.\",\n ),\n userGroups: putWorkspacesByIdBody.shape.userGroups.describe(\n \"Ids of the Umbraco user groups allowed to manage this workspace. Replaces the whole list - pass the current list from get-workspace to keep it, or [] for none.\",\n ),\n allowedConnections: putWorkspacesByIdBody.shape.allowedConnections.describe(\n \"Ids of the connections this workspace's automations may use. Replaces the whole list - pass the current list from get-workspace to keep it, or [] for none.\",\n ),\n version: putWorkspacesByIdBody.shape.version.describe(\n \"The workspace's current version from get-workspace. A stale value is rejected as a conflict.\",\n ),\n};\n\nconst updateWorkspaceTool = {\n name: \"update-workspace\",\n description:\n \"Updates an existing workspace's alias, name, service account, allowed user groups, and allowed connections. Requires the current `version` returned by get-workspace or list-workspaces — the call fails if the workspace has been modified since, so fetch it fresh right before updating.\",\n inputSchema,\n slices: [\"update\"],\n annotations: {\n destructiveHint: false,\n idempotentHint: true,\n },\n handler: async ({\n workspaceId,\n alias,\n name,\n serviceAccountKey,\n userGroups,\n allowedConnections,\n version,\n }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.putWorkspacesById(\n workspaceId,\n { alias, name, serviceAccountKey, userGroups, allowedConnections, version },\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(updateWorkspaceTool);\n","/**\n * Update Workspace Group Tool\n *\n * Renames a group within a workspace and/or changes its parent group,\n * letting you re-nest a group elsewhere in the workspace's folder\n * hierarchy.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\nimport { putWorkspacesByIdGroupsByGroupIdBody } from \"../../../api/generated/umbracoAutomateManagementApi.zod.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace the group belongs to.\"),\n groupId: z.string().describe(\"The id of the group to update.\"),\n ...putWorkspacesByIdGroupsByGroupIdBody.shape,\n name: putWorkspacesByIdGroupsByGroupIdBody.shape.name.describe(\n \"Display name for the group. Pass the current name to keep it.\",\n ),\n parentId: putWorkspacesByIdGroupsByGroupIdBody.shape.parentId.describe(\n \"Optional id of the parent group to nest under. Omit or pass null to make it a top-level group.\",\n ),\n};\n\nconst updateWorkspaceGroupTool = {\n name: \"update-workspace-group\",\n description:\n \"Renames a group within a workspace and/or moves it under a different parent group. Pass parentId to re-nest the group, or omit it to make/keep it a top-level group. Use list-workspace-groups or get-workspace-group to find the current name and parentId first.\",\n inputSchema,\n slices: [\"update\"],\n annotations: {\n destructiveHint: false,\n idempotentHint: true,\n },\n handler: async ({ workspaceId, groupId, name, parentId }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.putWorkspacesByIdGroupsByGroupId(\n workspaceId,\n groupId,\n { name, parentId },\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(updateWorkspaceGroupTool);\n","/**\n * Delete Workspace Tool\n *\n * Permanently deletes a workspace, including its groups. This does not\n * automatically delete the automations that belong to it — check for\n * automations still assigned to this workspace before deleting it.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace to delete.\"),\n};\n\nconst deleteWorkspaceTool = {\n name: \"delete-workspace\",\n description:\n \"Permanently deletes a workspace and its groups. This is not idempotent — calling it again on an already-deleted workspace returns an error. Automations that belonged to this workspace are not deleted automatically, so confirm none remain assigned to it first.\",\n inputSchema,\n slices: [\"delete\"],\n annotations: {\n destructiveHint: true,\n idempotentHint: false,\n },\n handler: async ({ workspaceId }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.deleteWorkspacesById(workspaceId, CAPTURE_RAW_HTTP_RESPONSE)\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(deleteWorkspaceTool);\n","/**\n * Delete Workspace Group Tool\n *\n * Permanently deletes a group (folder) within a workspace. Check whether\n * any automations or child groups are filed under it first, since deleting\n * a group does not move them automatically.\n */\n\nimport { z } from \"zod\";\nimport {\n withStandardDecorators,\n executeVoidApiCall,\n CAPTURE_RAW_HTTP_RESPONSE,\n type ToolDefinition,\n} from \"@umbraco-cms/mcp-server-sdk\";\nimport type { getUmbracoAutomateManagementAPI } from \"../../../api/generated/umbracoAutomateManagementApi.js\";\n\ntype ApiClient = ReturnType<typeof getUmbracoAutomateManagementAPI>;\n\nconst inputSchema = {\n workspaceId: z.string().describe(\"The id of the workspace the group belongs to.\"),\n groupId: z.string().describe(\"The id of the group to delete.\"),\n};\n\nconst deleteWorkspaceGroupTool = {\n name: \"delete-workspace-group\",\n description:\n \"Permanently deletes a group within a workspace. This is not idempotent — calling it again on an already-deleted group returns an error. Automations and child groups filed under it are not moved or deleted automatically, so use list-workspace-groups to check for children first.\",\n inputSchema,\n slices: [\"delete\"],\n annotations: {\n destructiveHint: true,\n idempotentHint: false,\n },\n handler: async ({ workspaceId, groupId }) => {\n return executeVoidApiCall<ApiClient>((client) =>\n client.deleteWorkspacesByIdGroupsByGroupId(\n workspaceId,\n groupId,\n CAPTURE_RAW_HTTP_RESPONSE\n )\n );\n },\n} satisfies ToolDefinition<typeof inputSchema>;\n\nexport default withStandardDecorators(deleteWorkspaceGroupTool);\n","/**\n * Workspaces Tool Collection\n *\n * Workspaces are the top-level containers that scope automations: each\n * workspace defines which service account its automations run as, which\n * connections they may use, and which Umbraco user groups can manage it.\n * Within a workspace, groups act as folders for organizing automations\n * (see `automations/groups/{groupId}` in the automations collection to list\n * the automations filed under a group).\n */\n\nimport { ToolCollectionExport } from \"@umbraco-cms/mcp-server-sdk\";\nimport listWorkspacesTool from \"./get/list-workspaces.js\";\nimport getWorkspaceTool from \"./get/get-workspace.js\";\nimport listWorkspaceGroupsTool from \"./get/list-workspace-groups.js\";\nimport getWorkspaceGroupTool from \"./get/get-workspace-group.js\";\nimport createWorkspaceTool from \"./post/create-workspace.js\";\nimport createWorkspaceGroupTool from \"./post/create-workspace-group.js\";\nimport updateWorkspaceTool from \"./put/update-workspace.js\";\nimport updateWorkspaceGroupTool from \"./put/update-workspace-group.js\";\nimport deleteWorkspaceTool from \"./delete/delete-workspace.js\";\nimport deleteWorkspaceGroupTool from \"./delete/delete-workspace-group.js\";\n\nconst collection: ToolCollectionExport = {\n metadata: {\n name: \"workspaces\",\n displayName: \"Workspaces\",\n description:\n \"Manage workspaces (the top-level containers that scope automations, their allowed connections, and permitted user groups) and the groups used to organize automations within them.\",\n },\n tools: () => [\n // Read operations\n listWorkspacesTool,\n getWorkspaceTool,\n listWorkspaceGroupsTool,\n getWorkspaceGroupTool,\n // Create operations\n createWorkspaceTool,\n createWorkspaceGroupTool,\n // Update operations\n updateWorkspaceTool,\n updateWorkspaceGroupTool,\n // Delete operations\n deleteWorkspaceTool,\n deleteWorkspaceGroupTool,\n ],\n};\n\nexport default collection;\n","/**\n * Lenient Output Schemas\n *\n * The MCP SDK publishes each output schema as JSON Schema with every plain\n * `z.object` closed (`additionalProperties: false`), and clients that validate\n * structured content (Claude Desktop, MCP Inspector) refuse a result carrying a\n * key the schema doesn't list. Umbraco passes its responses through unchanged,\n * so a field added in a later Automate minor (e.g. 17.5's `visibleWhen` on\n * settings fields) would break every tool returning it on an MCP built against\n * an earlier spec.\n *\n * This opens every object in a tool's output schema to unknown keys and leaves\n * everything else as it was: known fields keep their types and required/optional\n * state, so responses from older Automate releases validate exactly as before,\n * and input schemas stay strict.\n *\n * The one exception is the reverse case: a field the generated client marks\n * required but that an earlier Automate release in the same major doesn't send\n * (see FIELDS_NEWER_AUTOMATE_ADDED). Those are made optional, so a client built\n * against a newer spec still accepts responses from older instances.\n */\n\nimport type { ToolCollectionExport, ToolDefinition } from \"@umbraco-cms/mcp-server-sdk\";\nimport { z } from \"zod\";\n\ntype AnySchema = z.core.$ZodType;\ntype Def = Record<string, any>;\n\nconst lenient = new WeakMap<AnySchema, AnySchema>();\n\n/**\n * Response fields the generated client marks required that Automate releases\n * before 18.6 / 17.6 don't return. Required, they would fail output validation\n * on those instances, so they are made optional wherever they appear.\n */\nexport const FIELDS_NEWER_AUTOMATE_ADDED = new Set([\n // settings field descriptors (catalogue settingsSchema.fields[])\n \"valueKind\",\n // catalogue step/trigger items\n \"outcomes\",\n \"hasDynamicOutcomes\",\n // run step runs (stepRuns[])\n \"logEntries\",\n]);\n\nfunction optionalIfAddedLater(key: string, schema: AnySchema): AnySchema {\n return FIELDS_NEWER_AUTOMATE_ADDED.has(key) && schema._zod.optin !== \"optional\"\n ? z.optional(schema as z.ZodType)\n : schema;\n}\n\n/** Child schemas held in a def, by the def key that holds them. */\nconst SINGLE_CHILD_KEYS = [\"element\", \"innerType\", \"keyType\", \"valueType\", \"left\", \"right\", \"in\", \"out\"];\nconst LIST_CHILD_KEYS = [\"options\", \"items\"];\n\nfunction rebuild(schema: AnySchema): AnySchema {\n const def = schema._zod.def as Def;\n const next: Def = { ...def };\n\n if (def.type === \"object\") {\n next.shape = Object.fromEntries(\n Object.entries(def.shape as Record<string, AnySchema>).map(([key, value]) => [\n key,\n optionalIfAddedLater(key, loosen(value)),\n ]),\n );\n next.catchall = def.catchall ? loosen(def.catchall) : z.unknown();\n } else if (def.type === \"lazy\") {\n const getter = def.getter as () => AnySchema;\n next.getter = () => loosen(getter());\n }\n for (const key of SINGLE_CHILD_KEYS) {\n if (def[key]) next[key] = loosen(def[key]);\n }\n for (const key of LIST_CHILD_KEYS) {\n if (Array.isArray(def[key])) next[key] = def[key].map(loosen);\n }\n if (def.type === \"tuple\" && def.rest) next.rest = loosen(def.rest);\n\n // `parent` keeps the original's registry metadata (descriptions) on the copy.\n return z.core.clone(schema, next as any, { parent: true });\n}\n\n/** Returns `schema` with every object in it open to unknown keys. */\nexport function loosen<T extends AnySchema>(schema: T): T {\n let result = lenient.get(schema);\n if (!result) {\n result = rebuild(schema);\n lenient.set(schema, result);\n }\n return result as T;\n}\n\nfunction withLenientOutputSchema(tool: ToolDefinition<any, any>): ToolDefinition<any, any> {\n if (!tool.outputSchema) return tool;\n // Tools may give a raw shape, which the SDK would wrap in a closed z.object.\n const outputSchema =\n tool.outputSchema instanceof z.ZodType\n ? loosen(tool.outputSchema)\n : loosen(z.object(tool.outputSchema));\n return { ...tool, outputSchema };\n}\n\n/** Wraps a collection so each of its tools publishes a lenient output schema. */\nexport function withLenientOutputSchemas(collection: ToolCollectionExport): ToolCollectionExport {\n return {\n ...collection,\n tools: (user) => collection.tools(user).map(withLenientOutputSchema),\n };\n}\n","/**\n * MCP Server Chain Configuration\n *\n * Configure external MCP servers that this server can connect to and proxy.\n * Tools from these servers will be available to the parent client with a prefix.\n *\n * @example\n * When configured with name: \"cms\", tools from that server appear as:\n * - cms:get-document\n * - cms:list-documents\n * - etc.\n */\n\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { McpServerConfig } from \"@umbraco-cms/mcp-server-sdk\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n/**\n * Use mock MCP server for testing chaining functionality.\n * Set USE_MOCK_MCP_CHAIN=true to use a simple mock server instead of real Umbraco.\n */\nconst useMockChain = process.env.USE_MOCK_MCP_CHAIN === \"true\";\n\n/**\n * Mock MCP server configuration for testing.\n * Uses a simple server that returns mock tools and responses.\n * Path resolves from dist/ to src/ since tsx runs TypeScript directly.\n * Note: tsup bundles into dist/index.js so __dirname is dist/, not dist/config/\n */\nconst mockCmsServer: McpServerConfig = {\n name: \"cms\",\n command: \"npx\",\n args: [\n \"tsx\",\n // From dist/index.js, go to ../src/testing/\n path.resolve(__dirname, \"../src/testing/mock-mcp-server.ts\"),\n ],\n proxyTools: true,\n};\n\n/**\n * Real Umbraco CMS MCP server configuration.\n */\nconst realCmsServer: McpServerConfig = {\n name: \"cms\",\n command: \"npx\",\n args: [\"-y\", \"@umbraco-cms/mcp-dev@17\"],\n env: {\n UMBRACO_BASE_URL: process.env.UMBRACO_BASE_URL || \"https://localhost:44320\",\n UMBRACO_CLIENT_ID: process.env.UMBRACO_CLIENT_ID || \"\",\n UMBRACO_CLIENT_SECRET: process.env.UMBRACO_CLIENT_SECRET || \"\",\n },\n proxyTools: true,\n};\n\n/**\n * External MCP servers to chain to.\n *\n * Each server configured here will:\n * 1. Be available for internal delegation (tools calling mcpClientManager.callTool())\n * 2. Have its tools proxied to the parent client (if proxyTools is true)\n * 3. Receive the same filter configuration (tools, slices, modes) as this server\n */\nexport const mcpServers: McpServerConfig[] = [\n // Use mock server for testing, real server otherwise\n useMockChain ? mockCmsServer : realCmsServer,\n\n // Add more chained MCP servers here as needed\n // {\n // name: \"another-mcp\",\n // command: \"npx\",\n // args: [\"-y\", \"@scope/another-mcp\"],\n // env: { ... },\n // proxyTools: true,\n // },\n];\n","/**\n * MCP Client Manager\n *\n * Singleton for calling tools on chained MCP servers from local tools.\n * =====================================================================\n *\n * This module creates and exports the `mcpClientManager` which allows your\n * tools to call tools on other MCP servers configured in `mcp-servers.ts`.\n *\n * WHY IS THIS A SEPARATE FILE?\n * ----------------------------\n * To avoid circular dependencies. Tools import from this file, and this file\n * imports from mcp-servers.ts (not index.ts which imports tool collections).\n *\n * USAGE IN TOOLS:\n * ---------------\n * ```typescript\n * import { mcpClientManager } from \"../../mcp-client.js\";\n *\n * // Call a tool on the \"cms\" server (defined in mcp-servers.ts)\n * const result = await mcpClientManager.callTool(\"cms\", \"get-document\", { id: \"...\" });\n *\n * // Extract structured content (preferred - when tool has outputSchema)\n * const data = result.structuredContent;\n *\n * // Or extract text content (legacy fallback)\n * const textContent = result.content?.find(c => c.type === \"text\");\n * const data = textContent ? JSON.parse(textContent.text) : null;\n * ```\n *\n * AVAILABLE METHODS:\n * ------------------\n * - callTool(serverName, toolName, args) - Call a tool on a chained server\n * - listTools(serverName) - List available tools on a chained server\n * - connect(serverName) - Explicitly connect to a server (usually automatic)\n * - isConnected(serverName) - Check if a server is connected\n * - hasServer(serverName) - Check if a server is registered\n *\n * See `src/tools/chained/get-chained-info.ts` for a complete example.\n */\n\nimport { createMcpClientManager } from \"@umbraco-cms/mcp-server-sdk\";\nimport { mcpServers } from \"../config/mcp-servers.js\";\n\nexport const mcpClientManager = createMcpClientManager({\n // Pass through any filter configuration to chained servers\n // filterConfig: { tools: [], slices: [], modes: [] },\n});\n\n// Register all configured MCP servers from mcp-servers.ts\n// These become available via mcpClientManager.callTool(serverName, ...)\nfor (const config of mcpServers) {\n mcpClientManager.registerServer(config);\n}\n","/**\n * Tool Slice Registry\n *\n * Defines all valid slice names for categorizing tools by operation type.\n * Extends the base slices from the toolkit with domain-specific slices.\n *\n * Slices are assigned explicitly on each tool via the `slices` property.\n * This is the SINGLE SOURCE OF TRUTH for slice names in this project.\n */\n\nimport { baseSliceNames } from \"@umbraco-cms/mcp-server-sdk\";\n\n/**\n * Tool slice names for this project.\n * Extends base CRUD slices with domain-specific operations.\n */\nexport const toolSliceNames = [\n // Base slices from toolkit (create, read, update, delete, list)\n ...baseSliceNames,\n\n // Query\n 'search',\n\n // Automate-specific\n 'action', // non-CRUD state-transition operations (trigger, suspend, replay, decision, test, etc.)\n 'publish', // publish/unpublish operations\n 'tree', // hierarchical/ancestor lookups\n 'export', // export to portable format\n 'import', // import from portable format\n] as const;\n\n/**\n * Valid slice name type for compile-time safety.\n */\nexport type ToolSliceName = typeof toolSliceNames[number];\n\n/**\n * All valid slice names including 'other' catch-all.\n * Tools with empty slices array are categorized as 'other'.\n */\nexport const allSliceNames: readonly string[] = [...toolSliceNames, 'other'];\n\n/**\n * Extended slice name type including 'other'.\n */\nexport type ExtendedSliceName = ToolSliceName | 'other';\n","/**\n * Tool Mode Registry\n *\n * Defines tool modes that group tools by domain/functionality.\n * Modes map to collections, allowing users to enable groups of related tools.\n *\n * This is the SINGLE SOURCE OF TRUTH for mode definitions in this project.\n */\n\nimport type { ToolModeDefinition } from \"@umbraco-cms/mcp-server-sdk\";\n\n/**\n * Tool mode definitions for this project.\n *\n * Each mode groups related tool collections together.\n * Users can enable modes in their config to include all tools in those collections.\n *\n * @example\n * ```typescript\n * // In server config\n * {\n * toolModes: ['content', 'media'] // Enables all tools in content and media collections\n * }\n * ```\n */\nexport const toolModes: ToolModeDefinition[] = [\n {\n name: 'umbraco-server',\n displayName: 'Umbraco Server',\n description: 'Server information and status from the Umbraco Management API',\n collections: ['umbraco-server']\n },\n {\n name: 'automate',\n displayName: 'Automate',\n description: 'Umbraco Automate: workflows, approvals, connections, runs, and related management tools',\n collections: [\n 'approvals',\n 'automations',\n 'catalogue',\n 'connections',\n 'metrics',\n 'runs',\n 'version-history',\n 'workspaces',\n ]\n },\n // Add your modes here as you build out your MCP server\n // {\n // name: 'content',\n // displayName: 'Content Management',\n // description: 'Document creation, editing, and versioning',\n // collections: ['document', 'document-version', 'document-blueprint']\n // },\n // {\n // name: 'media',\n // displayName: 'Media Management',\n // description: 'Media library and file operations',\n // collections: ['media', 'imaging', 'temporary-file']\n // }\n];\n\n/**\n * All mode definitions (alias for toolModes).\n */\nexport const allModes: ToolModeDefinition[] = [...toolModes];\n\n/**\n * All valid mode names for configuration validation.\n */\nexport const allModeNames: readonly string[] = toolModes.map(m => m.name);\n\n/**\n * Valid mode name type.\n */\nexport type ToolModeName = typeof allModeNames[number];\n","/**\n * Server Configuration\n *\n * This module demonstrates how to extend the base Umbraco MCP config\n * with custom configuration fields specific to your MCP server.\n *\n * Custom fields support:\n * - string: Simple string values\n * - boolean: True/false flags\n * - csv: Comma-separated values parsed into arrays\n * - csv-path: Comma-separated paths, resolved to absolute paths\n */\n\nimport {\n getServerConfig,\n type ConfigFieldDefinition,\n type UmbracoServerConfig,\n type GetServerConfigResult,\n} from \"@umbraco-cms/mcp-server-sdk\";\n\n// ============================================================================\n// Custom Config Interface\n// ============================================================================\n\n/**\n * Custom configuration specific to this MCP server.\n * Define your own fields here - they will be parsed from CLI args or env vars.\n */\nexport interface MyServerCustomConfig {\n /** Disable MCP server chaining (useful for testing or isolated deployments) */\n disableMcpChaining?: boolean;\n /**\n * Overrides the Umbraco major version this server targets (e.g. \"17\") for the\n * startup version-compatibility check: connecting to a different major warns\n * and blocks the first tool call until the user retries.\n *\n * Leave unset (the normal case) to use `UMBRACO_TARGET_MAJOR` from\n * `config/umbraco-target.generated.ts`, which `npm run generate` reads from\n * the connected instance's `server/information` endpoint — i.e. the Umbraco\n * version the tools were actually generated against. Set this only to\n * deliberately point the server at a different Umbraco major.\n */\n expectedUmbracoMajor?: string;\n}\n\n// ============================================================================\n// Custom Field Definitions\n// ============================================================================\n\n/**\n * Define additional config fields for this server.\n * Each field automatically gets:\n * - A CLI argument (--disable-mcp-chaining)\n * - An environment variable (DISABLE_MCP_CHAINING)\n * - Automatic parsing based on type\n */\nconst customFields: ConfigFieldDefinition[] = [\n {\n name: \"disableMcpChaining\",\n envVar: \"DISABLE_MCP_CHAINING\",\n cliFlag: \"disable-mcp-chaining\",\n type: \"boolean\",\n },\n {\n name: \"expectedUmbracoMajor\",\n envVar: \"UMBRACO_EXPECTED_MAJOR\",\n cliFlag: \"umbraco-expected-major\",\n type: \"string\",\n },\n];\n\n// ============================================================================\n// Config Loading\n// ============================================================================\n\nexport interface ServerConfig {\n /** Base Umbraco MCP configuration */\n umbraco: UmbracoServerConfig;\n /** Custom configuration for this server */\n custom: MyServerCustomConfig;\n /** CLI introspection flags */\n cliFlags: GetServerConfigResult[\"cliFlags\"];\n}\n\nlet cachedConfig: ServerConfig | null = null;\n\n/**\n * Load server configuration from CLI arguments and environment variables.\n *\n * @param isStdioMode - Whether the server is running in stdio mode (suppresses logging)\n * @returns Combined base and custom configuration\n *\n * @example\n * ```typescript\n * const { umbraco, custom } = loadServerConfig(true);\n *\n * // Access base Umbraco config\n * console.log(umbraco.auth.baseUrl);\n * console.log(umbraco.readonly);\n *\n * // Access custom config\n * if (custom.disableMcpChaining) {\n * skipChainedServers();\n * }\n * ```\n */\nexport async function loadServerConfig(isStdioMode: boolean): Promise<ServerConfig> {\n if (cachedConfig) {\n return cachedConfig;\n }\n\n const { config, custom, cliFlags } = await getServerConfig(isStdioMode, {\n additionalFields: customFields,\n });\n\n cachedConfig = {\n umbraco: config,\n custom: custom as MyServerCustomConfig,\n cliFlags,\n };\n\n return cachedConfig;\n}\n\n/**\n * Clear cached config (useful for testing)\n */\nexport function clearConfigCache(): void {\n cachedConfig = null;\n}\n\n/**\n * Get the custom field definitions (useful for testing/documentation)\n */\nexport function getCustomFieldDefinitions(): ConfigFieldDefinition[] {\n return [...customFields];\n}\n","// AUTO-GENERATED by @umbraco-cms/mcp-server-sdk's orval target-major transformer.\n// Do not edit by hand — regenerate via `npm run generate`.\n/**\n * The Umbraco major version this server's generated tools target.\n *\n * Read from the Umbraco instance this server's tools were generated against,\n * via `GET /umbraco/management/api/v1/server/information`.\n *\n * Reported version: 17.7.0+d64a209.\n *\n * Passed to `checkUmbracoVersion` at startup, which blocks tool execution when\n * the connected instance's major differs. Set `UMBRACO_EXPECTED_MAJOR` (or\n * `--umbraco-expected-major`) to override it at runtime when deliberately\n * pointing at a different Umbraco major.\n */\nexport const UMBRACO_TARGET_MAJOR = \"17\";\n","#!/usr/bin/env node\n/**\n * MCP Server Entry Point\n *\n * This file sets up and starts the MCP server.\n * Customize this to add your tool collections.\n */\n\nimport \"./load-env.js\";\nimport { McpServer, type ToolCallback } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n configureApiClient,\n initializeUmbracoFetch,\n createToolAnnotations,\n discoverProxiedTools,\n parseProxiedToolName,\n createCollectionConfigLoader,\n shouldIncludeTool,\n handleCliCommands,\n checkUmbracoVersion,\n configureVersionCheckHook,\n getVersionCheckMessage,\n registerToolCollection,\n UmbracoManagementClient,\n CAPTURE_RAW_HTTP_RESPONSE,\n SERVER_INFORMATION_PATH,\n useDraft202012ToolSchemas,\n getRegisteredOutputSchema,\n type CollectionConfiguration,\n type HttpResponse,\n} from \"@umbraco-cms/mcp-server-sdk\";\n\n// Import the Orval-generated API client\nimport { getUmbracoAutomateManagementAPI } from \"./umbraco-api/api/generated/umbracoAutomateManagementApi.js\";\n\n// Import tool collections\nimport umbracoServerCollection from \"./umbraco-api/tools/umbraco-server/index.js\";\nimport approvalsCollection from \"./umbraco-api/tools/approvals/index.js\";\nimport automationsCollection from \"./umbraco-api/tools/automations/index.js\";\nimport catalogueCollection from \"./umbraco-api/tools/catalogue/index.js\";\nimport connectionsCollection from \"./umbraco-api/tools/connections/index.js\";\nimport metricsCollection from \"./umbraco-api/tools/metrics/index.js\";\nimport runsCollection from \"./umbraco-api/tools/runs/index.js\";\nimport versionHistoryCollection from \"./umbraco-api/tools/version-history/index.js\";\nimport workspacesCollection from \"./umbraco-api/tools/workspaces/index.js\";\nimport { withLenientOutputSchemas } from \"./umbraco-api/tools/lenient-output-schemas.js\";\n\n// Import MCP client manager (for chaining to other MCP servers)\nimport { mcpClientManager } from \"./umbraco-api/mcp-client.js\";\n\n// Import MCP server chain configuration\nimport { mcpServers } from \"./config/mcp-servers.js\";\n\n// Import registries for tool filtering\nimport {\n allModes,\n allModeNames,\n allSliceNames,\n loadServerConfig,\n clearConfigCache,\n setUmbracoBaseUrl,\n UMBRACO_TARGET_MAJOR,\n} from \"./config/index.js\";\n\n// Configure the API client for use with toolkit helpers\n// This connects your generated Orval client to executeGetApiCall, executeVoidApiCall, etc.\nconfigureApiClient(() => getUmbracoAutomateManagementAPI());\n\n// ============================================================================\n// Tool Filtering Setup\n// ============================================================================\n\n// Clear config cache to ensure fresh config for each server start\nclearConfigCache();\n\n// Captured before loadServerConfig, so variables the MCP client passed in win over a .env in\n// the working directory. SDK 1.0.0-beta.48 no longer lets ./.env override them either\n// (Umbraco-MCP-Base#410; only an explicit --env file does), so this guards older SDKs only.\nconst startupAuth = {\n baseUrl: process.env.UMBRACO_BASE_URL,\n clientId: process.env.UMBRACO_CLIENT_ID,\n clientSecret: process.env.UMBRACO_CLIENT_SECRET,\n};\n\n// Load server configuration (includes filtering settings from env vars)\nconst serverConfig = await loadServerConfig(true);\n\n// Initialize the SDK's fetch client for real Umbraco API calls.\n// This enables the Orval-generated client to authenticate via client_credentials.\n// Precedence: --umbraco-* CLI flag, then an explicit --env file, then the environment\n// (which already wins over ./.env - see load-env.ts).\nconst { auth, configSources } = serverConfig.umbraco;\nconst resolveAuth = (field: keyof typeof startupAuth): string =>\n configSources[field] === \"cli\" || configSources.envFile === \"cli\"\n ? auth[field]\n : startupAuth[field] || auth[field] || \"\";\n// Same fallback as before, so introspection (--list-tools etc.) still works without a base URL.\nconst baseUrl = resolveAuth(\"baseUrl\") || \"https://localhost:44320\";\nconst clientId = resolveAuth(\"clientId\");\nconst clientSecret = resolveAuth(\"clientSecret\");\nif (clientId) {\n initializeUmbracoFetch({ baseUrl, clientId, clientSecret });\n setUmbracoBaseUrl(baseUrl);\n}\n\n// Create collection config loader with our registries\nconst configLoader = createCollectionConfigLoader({\n modeRegistry: allModes,\n allModeNames,\n allSliceNames,\n});\n\n// Load filtering configuration from server config\nconst filterConfig: CollectionConfiguration = configLoader.loadFromConfig(serverConfig.umbraco);\n\n// ============================================================================\n// CLI Introspection (runs before server start, exits immediately)\n// ============================================================================\n\n// Open output objects to unknown keys, so fields a newer Automate adds don't fail\n// client-side validation (see lenient-output-schemas.ts).\nconst collections = [\n umbracoServerCollection,\n approvalsCollection,\n automationsCollection,\n catalogueCollection,\n connectionsCollection,\n metricsCollection,\n runsCollection,\n versionHistoryCollection,\n workspacesCollection,\n].map(withLenientOutputSchemas);\n\n// handleCliCommands checks --list-tools, --describe-tool, --generate-context, --call.\n// If any flag is set it prints output and calls process.exit(0).\n// Otherwise it returns and the server continues to start.\nawait handleCliCommands(collections, {\n cliFlags: serverConfig.cliFlags,\n serverName: \"my-umbraco-mcp\",\n serverVersion: packageJson.version,\n filterConfig,\n serverConfig: serverConfig.umbraco,\n});\n\n// ============================================================================\n// Version Check\n// ============================================================================\n//\n// Verify the connected Umbraco major version matches the major version this\n// server's tools were generated against. `expectedUmbracoMajor` is a required\n// SDK field, so this can't be silently left off.\n//\n// The value comes from `UMBRACO_TARGET_MAJOR` in\n// `config/umbraco-target.generated.ts` — auto-generated by `npm run generate`,\n// which reads it from the Umbraco instance in `.env` (the spec cannot supply it:\n// every Umbraco spec hard-codes `info.version` to \"Latest\"). Regenerate against\n// a newer Umbraco and the constant follows automatically; there is nothing to\n// keep in sync by hand. `UMBRACO_EXPECTED_MAJOR` /\n// `--umbraco-expected-major` (see `config/server-config.ts`) overrides it at\n// runtime for a project deliberately targeting a different Umbraco major.\n//\n// It deliberately does *not* compare against this package's own version:\n// a new project starts at \"1.0.0\", which says nothing about which Umbraco\n// major it targets, so an implicit comparison falsely blocked the first tool\n// call of every new server (see Umbraco-MCP-Base#220).\n//\n// `checkUmbracoVersion` never throws and always logs a mismatch/error to\n// stderr (console.error — stdio-transport safe), but that alone isn't enough\n// to surface the warning to the user or pause tool execution. Two more calls\n// close that gap:\n// - `configureVersionCheckHook()` bridges the result into\n// `withPreExecutionCheck` (applied to every tool via\n// `withStandardDecorators`), so a mismatch blocks the first tool call\n// with the warning until the user deliberately retries. Safe to call\n// unconditionally — it never blocks anything when the versions match.\n// - `getVersionCheckMessage()` lets us fold the same warning into the\n// server's `instructions`, so it reaches the model/user directly rather\n// than only the server log.\n// Skipped when no client credentials are configured (matches the\n// `initializeUmbracoFetch` gate above) so CLI introspection / offline usage\n// never makes a live network call.\nif (clientId) {\n await checkUmbracoVersion({\n mcpVersion: packageJson.version,\n expectedUmbracoMajor: serverConfig.custom.expectedUmbracoMajor ?? UMBRACO_TARGET_MAJOR,\n client: {\n getServerInformation: async () => {\n const response = (await UmbracoManagementClient<{ version: string }>(\n { url: SERVER_INFORMATION_PATH, method: \"GET\" },\n CAPTURE_RAW_HTTP_RESPONSE,\n )) as unknown as HttpResponse<{ version: string }>;\n return { version: response.data.version };\n },\n },\n });\n configureVersionCheckHook();\n}\n\nconst versionCheckMessage = getVersionCheckMessage();\n\n// ============================================================================\n// MCP Server Setup\n// ============================================================================\n\n// Create MCP server.\n// Pass an optional `instructions` string in the second argument to send\n// server-level guidance to clients during `initialize`. Most clients fold\n// this into the model's system prompt, so it applies implicitly without\n// per-tool repetition. Mirror the same value in `worker.ts` so stdio and\n// hosted deployments behave consistently.\n//\n// Here it's used to surface a version-mismatch warning when one was detected\n// (null otherwise). Extend the string if you also want custom guidance, e.g.:\n// [versionCheckMessage, \"Refer to items by name, not by ID.\"].filter(Boolean).join(\"\\n\\n\")\nconst server = new McpServer(\n { name: \"my-umbraco-mcp\", version: packageJson.version },\n versionCheckMessage ? { instructions: versionCheckMessage } : undefined,\n);\n\n// ============================================================================\n// Register Tools with Filtering\n// ============================================================================\n\nlet registeredToolCount = 0;\n\nfor (const collection of collections) {\n const collectionName = collection.metadata.name;\n\n // Get tools for current user (pass user context if needed)\n const tools = collection.tools({});\n\n for (const tool of tools) {\n // Check if tool should be included based on filtering config\n if (!shouldIncludeTool(tool, { collectionName, config: filterConfig })) {\n continue;\n }\n\n // Build annotations from tool definition\n const annotations = createToolAnnotations(tool);\n\n // Record the owning collection so telemetry spans can be grouped by it.\n // Only this loop knows both the tool and its collection — the decorators\n // are applied in each tool's own file, before collections are assembled.\n registerToolCollection(tool.name, collectionName);\n\n // Register tool with MCP server using registerTool API\n server.registerTool(tool.name, {\n description: tool.description,\n inputSchema: tool.inputSchema,\n // In dry-run, a mutation tool returns a preview rather than its real\n // result, so its outputSchema must not be advertised (or enforced).\n outputSchema: getRegisteredOutputSchema(tool),\n annotations,\n }, tool.handler as ToolCallback<typeof tool.inputSchema>);\n\n registeredToolCount++;\n }\n}\n\n// Start the server\nasync function main() {\n // Discover and register proxied tools from chained MCP servers\n // Skip if chaining is disabled via config (DISABLE_MCP_CHAINING=true)\n const chainingEnabled = mcpServers.length > 0 && !serverConfig.custom.disableMcpChaining;\n\n if (chainingEnabled) {\n try {\n const proxiedTools = await discoverProxiedTools(mcpClientManager);\n\n for (const pt of proxiedTools) {\n // Register proxied tool with forwarding handler\n // Note: We don't pass inputSchema since validation happens on the chained server\n // and the MCP SDK expects Zod schemas, not raw JSON Schema objects\n server.registerTool(\n pt.prefixedName,\n {\n description: `[Proxied from ${pt.serverName}] ${pt.originalTool.description || \"No description\"}`,\n },\n async (args: Record<string, unknown>): Promise<CallToolResult> => {\n const { serverName, toolName } = parseProxiedToolName(pt.prefixedName);\n const result = await mcpClientManager.callTool(serverName, toolName, args);\n return result as CallToolResult;\n }\n );\n }\n\n if (proxiedTools.length > 0) {\n console.error(`Registered ${proxiedTools.length} proxied tool(s) from chained MCP servers`);\n }\n } catch (error) {\n console.error(\"Warning: Failed to discover proxied tools:\", error);\n // Continue without proxied tools - local tools still work\n }\n }\n\n // Called once, after every registerTool call above (main collections at\n // module load, chained tools just above) has completed — McpServer only\n // advertises the \"tools\" capability required to override ListTools at\n // all once at least one tool has actually been registered.\n useDraft202012ToolSchemas(server);\n\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error(`MCP Server started with ${registeredToolCount} tool(s) from ${collections.length} collection(s)`);\n}\n\n// Cleanup on shutdown\nprocess.on(\"SIGINT\", async () => {\n await mcpClientManager.disconnectAll();\n process.exit(0);\n});\n\nprocess.on(\"SIGTERM\", async () => {\n await mcpClientManager.disconnectAll();\n process.exit(0);\n});\n\nmain().catch((error) => {\n console.error(\"Failed to start MCP server:\", error);\n process.exit(1);\n});\n"]}
|