From 97aced5365af06ce9ac32f3e8700b2c371bc01cd Mon Sep 17 00:00:00 2001 From: Phil Whittaker Date: Mon, 15 Sep 2025 16:53:42 +0100 Subject: [PATCH 01/12] Prepare release 16.0.0-beta.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update package.json with new version and package name for beta release. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5279b9d..a0ca6c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@umbraco-mcp/umbraco-mcp-cms", - "version": "0.1.0-alpha.7", + "name": "@umbraco-cms/mcp-dev", + "version": "16.0.0-beta.1", "type": "module", "description": "A model context protocol (MCP) server for Umbraco CMS", "main": "index.js", From 70c83ae73a88003f4217097f11144f1011575d2b Mon Sep 17 00:00:00 2001 From: Phil Whittaker Date: Tue, 16 Sep 2025 09:41:18 +0100 Subject: [PATCH 02/12] Update repository information and branding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update LICENSE copyright to Umbraco - Update README.md with correct repository URLs and badges - Update package.json repository, bugs, and homepage URLs to point to new Umbraco organization repository 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- LICENSE | 2 +- README.md | 2 +- package.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 60ac9c6..ef3cb91 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Matthew-Wise +Copyright (c) 2025-present Umbraco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9ed1175..0fc9cac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Umbraco MCP ![GitHub License](https://img.shields.io/github/license/matthew-wise/umbraco-mcp?style=plastic&link=https%3A%2F%2Fgithub.com%2FMatthew-Wise%2Fumbraco-mcp%3Ftab%3DMIT-1-ov-file%23readme) +# Umbraco MCP ![GitHub License](https://img.shields.io/github/license/umbraco/Umbraco-CMS-MCP-Dev?style=plastic&link=https%3A%2F%2Fgithub.com%2Fumbraco%2FUmbraco-CMS-MCP-Dev%2Fblob%2Fmain%2FLICENSE) An MCP (Model Context Protocol) server for [Umbraco CMS](https://umbraco.com/) it provides access to key parts of the Management API enabling you to do back office tasks with your agent. diff --git a/package.json b/package.json index a0ca6c1..a4f5268 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/Matthew-Wise/umbraco-mcp.git" + "url": "git+https://github.com/umbraco/Umbraco-CMS-MCP-Dev" }, "keywords": [ "Umbraco", @@ -43,9 +43,9 @@ "author": "", "license": "MIT", "bugs": { - "url": "https://github.com/Matthew-Wise/umbraco-mcp/issues" + "url": "https://github.com/umbraco/Umbraco-CMS-MCP-Dev/issues" }, - "homepage": "https://github.com/Matthew-Wise/umbraco-mcp#readme", + "homepage": "https://github.com/umbraco/Umbraco-CMS-MCP-Dev#readme", "dependencies": { "@modelcontextprotocol/sdk": "^1.9.0", "@types/uuid": "^10.0.0", From bf8e07ca1b7a164f31f46a9b5303a15b29597284 Mon Sep 17 00:00:00 2001 From: Phil Whittaker Date: Tue, 16 Sep 2025 11:21:36 +0100 Subject: [PATCH 03/12] Add dynamic npm tagging to Azure DevOps pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extract version from package.json in tarball during publish - Automatically determine npm tag based on version string: - *alpha* → alpha tag - *beta* → beta tag - *rc* → rc tag - otherwise → latest tag - Update display name to reflect dynamic tagging behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- build/azure-pipelines.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 9cf1262..08f31a4 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -71,8 +71,25 @@ stages: # Setup temp npm project to load in defaults from the local .npmrc npm init -y - # Find the first .tgz file in the current directory and publish it + # Find the first .tgz file in the current directory files=( ./*.tgz ) - npm publish "${files[0]}" - displayName: Push to npm + + # Extract version from package.json in the tarball + tar -tf "${files[0]}" | grep package/package.json | head -1 | xargs tar -xf "${files[0]}" --strip-components=1 + version=$(node -p "require('./package.json').version") + + # Determine tag based on version + if [[ "${version}" == *"alpha"* ]]; then + tag="alpha" + elif [[ "${version}" == *"beta"* ]]; then + tag="beta" + elif [[ "${version}" == *"rc"* ]]; then + tag="rc" + else + tag="latest" + fi + + echo "Publishing version ${version} with tag ${tag}" + npm publish "${files[0]}" --tag $tag + displayName: Push to npm with dynamic tagging workingDirectory: $(Pipeline.Workspace)/npm-package \ No newline at end of file From 206e7fa7199b02eb35800252aecde911f0066392 Mon Sep 17 00:00:00 2001 From: Phil Whittaker Date: Tue, 16 Sep 2025 11:23:37 +0100 Subject: [PATCH 04/12] Update README with correct package name and beta tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace @umbraco-mcp/umbraco-mcp-cms@alpha with @umbraco-cms/mcp-dev@beta - Update all npx installation commands throughout README - Ensure consistency with new package name and release tag 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0fc9cac..c683cfc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Once you have this information head back into Claude desktop app and head to Set "mcpServers": { "umbraco-mcp": { "command": "npx", - "args": ["@umbraco-mcp/umbraco-mcp-cms@alpha"], + "args": ["@umbraco-cms/mcp-dev@beta"], "env": { "NODE_TLS_REJECT_UNAUTHORIZED": "0", "UMBRACO_CLIENT_ID": "umbraco-back-office-mcp", @@ -62,7 +62,7 @@ Restart Claude and try it out with a simple prompt such as `Tell me the GUID of Use the Claude Code CLI to add the Umbraco MCP server: ```bash -claude mcp add umbraco-mcp npx @umbraco-mcp/umbraco-mcp-cms@alpha +claude mcp add umbraco-mcp npx @umbraco-cms/mcp-dev@beta ``` Or configure environment variables and scope: @@ -71,7 +71,7 @@ Or configure environment variables and scope: npm install -g @anthropic-ai/claude-code # Add with environment variables -claude mcp add umbraco-mcp --env UMBRACO_CLIENT_ID="your-id" --env UMBRACO_CLIENT_SECRET="your-secret" --env UMBRACO_BASE_URL="https://your-domain.com" --env NODE_TLS_REJECT_UNAUTHORIZED="0" --env UMBRACO_INCLUDE_TOOL_COLLECTIONS="culture,document,media" -- npx @umbraco-mcp/umbraco-mcp-cms@alpha +claude mcp add umbraco-mcp --env UMBRACO_CLIENT_ID="your-id" --env UMBRACO_CLIENT_SECRET="your-secret" --env UMBRACO_BASE_URL="https://your-domain.com" --env NODE_TLS_REJECT_UNAUTHORIZED="0" --env UMBRACO_INCLUDE_TOOL_COLLECTIONS="culture,document,media" -- npx @umbraco-cms/mcp-dev@beta # Verify installation claude mcp list @@ -99,7 +99,7 @@ Follow the MCP [install guide](https://code.visualstudio.com/docs/copilot/custom "umbraco-mcp": { "type": "stdio", "command": "npx", - "args": ["@umbraco-mcp/umbraco-mcp-cms@alpha"], + "args": ["@umbraco-cms/mcp-dev@beta"], "env": { "UMBRACO_CLIENT_ID": "", "UMBRACO_CLIENT_SECRET": "", @@ -127,7 +127,7 @@ Add the following to the config file and update the env variables. "mcpServers": { "umbraco-mcp": { "command": "npx", - "args": ["@umbraco-mcp/umbraco-mcp-cms@alpha"], + "args": ["@umbraco-cms/mcp-dev@beta"], "env": { "UMBRACO_CLIENT_ID": "", "UMBRACO_CLIENT_SECRET": "", From 37262095c5257dbeece8560f19c942a4e01e6889 Mon Sep 17 00:00:00 2001 From: Phil Whittaker Date: Tue, 16 Sep 2025 13:01:22 +0100 Subject: [PATCH 05/12] Fix npm publish error by adding --access public flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves "402 Payment Required" error when publishing scoped package. Scoped packages (@organization/package) are private by default and require the --access public flag to publish as public packages. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 08f31a4..10b2a51 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -90,6 +90,6 @@ stages: fi echo "Publishing version ${version} with tag ${tag}" - npm publish "${files[0]}" --tag $tag + npm publish "${files[0]}" --tag $tag --access public displayName: Push to npm with dynamic tagging workingDirectory: $(Pipeline.Workspace)/npm-package \ No newline at end of file From 59cfc17e3590f248970e51556831a7adbb91df12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 07:22:12 +0000 Subject: [PATCH 06/12] Initial plan From 9463617156fdb0b44b0bfe22c6968d1460d86485 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 07:25:06 +0000 Subject: [PATCH 07/12] Initial exploration and analysis Co-authored-by: thebuilder <3764345+thebuilder@users.noreply.github.com> --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d09f442..4fb46d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@umbraco-mcp/umbraco-mcp-cms", - "version": "0.1.0-alpha.7", + "name": "@umbraco-cms/mcp-dev", + "version": "16.0.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@umbraco-mcp/umbraco-mcp-cms", - "version": "0.1.0-alpha.7", + "name": "@umbraco-cms/mcp-dev", + "version": "16.0.0-beta.1", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.9.0", From f00465efb54d28da331cee08c1ce3cc2620fd835 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 07:27:38 +0000 Subject: [PATCH 08/12] Implement multiple culture support for create-document tool Co-authored-by: thebuilder <3764345+thebuilder@users.noreply.github.com> --- .../__tests__/create-document.test.ts | 45 ++++++++++++++++++ .../tools/document/post/create-document.ts | 46 +++++++++++++++---- 2 files changed, 83 insertions(+), 8 deletions(-) diff --git a/src/umb-management-api/tools/document/__tests__/create-document.test.ts b/src/umb-management-api/tools/document/__tests__/create-document.test.ts index 21a7d1b..c04c134 100644 --- a/src/umb-management-api/tools/document/__tests__/create-document.test.ts +++ b/src/umb-management-api/tools/document/__tests__/create-document.test.ts @@ -74,4 +74,49 @@ describe("create-document", () => { }; expect(norm).toMatchSnapshot(); }); + + it("should create a document with specific cultures", async () => { + // Create document with specific cultures + const docModel = { + documentTypeId: ROOT_DOCUMENT_TYPE_ID, + name: TEST_DOCUMENT_NAME, + cultures: ["en-US", "da-DK"], + values: [], + }; + + const result = await CreateDocumentTool().handler(docModel, { + signal: new AbortController().signal, + }); + + expect(result).toMatchSnapshot(); + + const item = await DocumentTestHelper.findDocument(TEST_DOCUMENT_NAME); + expect(item).toBeDefined(); + // Should have variants for both cultures + expect(item!.variants).toHaveLength(2); + const cultures = item!.variants.map(v => v.culture).sort(); + expect(cultures).toEqual(["da-DK", "en-US"]); + }); + + it("should create a document with empty cultures array (null culture)", async () => { + // Create document with empty cultures array - should behave like original + const docModel = { + documentTypeId: ROOT_DOCUMENT_TYPE_ID, + name: TEST_DOCUMENT_NAME, + cultures: [], + values: [], + }; + + const result = await CreateDocumentTool().handler(docModel, { + signal: new AbortController().signal, + }); + + expect(result).toMatchSnapshot(); + + const item = await DocumentTestHelper.findDocument(TEST_DOCUMENT_NAME); + expect(item).toBeDefined(); + // Should have single variant with null culture + expect(item!.variants).toHaveLength(1); + expect(item!.variants[0].culture).toBeNull(); + }); }); diff --git a/src/umb-management-api/tools/document/post/create-document.ts b/src/umb-management-api/tools/document/post/create-document.ts index 59b89d2..88fa709 100644 --- a/src/umb-management-api/tools/document/post/create-document.ts +++ b/src/umb-management-api/tools/document/post/create-document.ts @@ -10,6 +10,7 @@ const createDocumentSchema = z.object({ documentTypeId: z.string().uuid("Must be a valid document type type UUID"), parentId: z.string().uuid("Must be a valid document UUID").optional(), name: z.string(), + cultures: z.array(z.string()).optional().describe("Array of culture codes. If not provided, will fetch available cultures from Umbraco. If empty array provided, will create without culture (null culture)."), values: z .array( z.object({ @@ -25,7 +26,11 @@ const createDocumentSchema = z.object({ const CreateDocumentTool = CreateUmbracoTool( "create-document", - `Creates a document, + `Creates a document with support for multiple cultures. + + If cultures parameter is provided, a variant will be created for each culture code. + If cultures parameter is not provided, the tool will automatically fetch available cultures from Umbraco and create variants for all of them. + If an empty cultures array is provided, a single variant with null culture will be created (original behavior). Always follow these requirements when creating documents exactly, do not deviate in any way. @@ -633,6 +638,37 @@ const CreateDocumentTool = CreateUmbracoTool( const documentId = uuidv4(); + // Determine cultures to use + let culturesToUse: (string | null)[] = []; + + if (model.cultures === undefined) { + // If cultures not provided, fetch available cultures from Umbraco + try { + const cultureResponse = await client.getCulture({ take: 100 }); + culturesToUse = cultureResponse.items.map(culture => culture.name); + // If no cultures available, fallback to null culture + if (culturesToUse.length === 0) { + culturesToUse = [null]; + } + } catch (error) { + // If fetching cultures fails, fallback to null culture + culturesToUse = [null]; + } + } else if (model.cultures.length === 0) { + // If empty array provided, use null culture (original behavior) + culturesToUse = [null]; + } else { + // Use provided cultures + culturesToUse = model.cultures; + } + + // Create variants for each culture + const variants = culturesToUse.map(culture => ({ + culture, + name: model.name, + segment: null, + })); + const payload: CreateDocumentRequestModel = { id: documentId, documentType: { @@ -645,13 +681,7 @@ const CreateDocumentTool = CreateUmbracoTool( : undefined, template: null, values: model.values, - variants: [ - { - culture: null, - name: model.name, - segment: null, - }, - ], + variants, }; const response = await client.postDocument(payload); From d5d5ac58a8cfa70804f4d0f25b705fd5ae259777 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 07:28:58 +0000 Subject: [PATCH 09/12] Final implementation with documentation and verification Co-authored-by: thebuilder <3764345+thebuilder@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e74f1a7..2774bc4 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ dist **/.gemini/settings.json **/.qwen/settings.json **/.roo/mcp.json +/tmp/ From 436e29f3e0bb9b49f276afac2b26382075999d81 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 08:00:38 +0000 Subject: [PATCH 10/12] Remove legacy null culture behavior for empty cultures array Co-authored-by: thebuilder <3764345+thebuilder@users.noreply.github.com> --- .../tools/document/__tests__/create-document.test.ts | 10 +++++----- .../tools/document/post/create-document.ts | 10 +++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/umb-management-api/tools/document/__tests__/create-document.test.ts b/src/umb-management-api/tools/document/__tests__/create-document.test.ts index c04c134..ff9d27d 100644 --- a/src/umb-management-api/tools/document/__tests__/create-document.test.ts +++ b/src/umb-management-api/tools/document/__tests__/create-document.test.ts @@ -98,8 +98,8 @@ describe("create-document", () => { expect(cultures).toEqual(["da-DK", "en-US"]); }); - it("should create a document with empty cultures array (null culture)", async () => { - // Create document with empty cultures array - should behave like original + it("should create a document with empty cultures array (auto-fetch behavior)", async () => { + // Create document with empty cultures array - should behave same as no cultures parameter const docModel = { documentTypeId: ROOT_DOCUMENT_TYPE_ID, name: TEST_DOCUMENT_NAME, @@ -115,8 +115,8 @@ describe("create-document", () => { const item = await DocumentTestHelper.findDocument(TEST_DOCUMENT_NAME); expect(item).toBeDefined(); - // Should have single variant with null culture - expect(item!.variants).toHaveLength(1); - expect(item!.variants[0].culture).toBeNull(); + // Should fetch cultures and create variants (same as when cultures parameter is omitted) + // The exact number of variants depends on available cultures in the test environment + expect(item!.variants.length).toBeGreaterThanOrEqual(1); }); }); diff --git a/src/umb-management-api/tools/document/post/create-document.ts b/src/umb-management-api/tools/document/post/create-document.ts index 88fa709..2a394a3 100644 --- a/src/umb-management-api/tools/document/post/create-document.ts +++ b/src/umb-management-api/tools/document/post/create-document.ts @@ -10,7 +10,7 @@ const createDocumentSchema = z.object({ documentTypeId: z.string().uuid("Must be a valid document type type UUID"), parentId: z.string().uuid("Must be a valid document UUID").optional(), name: z.string(), - cultures: z.array(z.string()).optional().describe("Array of culture codes. If not provided, will fetch available cultures from Umbraco. If empty array provided, will create without culture (null culture)."), + cultures: z.array(z.string()).optional().describe("Array of culture codes. If not provided, will fetch available cultures from Umbraco."), values: z .array( z.object({ @@ -30,7 +30,6 @@ const CreateDocumentTool = CreateUmbracoTool( If cultures parameter is provided, a variant will be created for each culture code. If cultures parameter is not provided, the tool will automatically fetch available cultures from Umbraco and create variants for all of them. - If an empty cultures array is provided, a single variant with null culture will be created (original behavior). Always follow these requirements when creating documents exactly, do not deviate in any way. @@ -641,8 +640,8 @@ const CreateDocumentTool = CreateUmbracoTool( // Determine cultures to use let culturesToUse: (string | null)[] = []; - if (model.cultures === undefined) { - // If cultures not provided, fetch available cultures from Umbraco + if (model.cultures === undefined || model.cultures.length === 0) { + // If cultures not provided or empty array, fetch available cultures from Umbraco try { const cultureResponse = await client.getCulture({ take: 100 }); culturesToUse = cultureResponse.items.map(culture => culture.name); @@ -654,9 +653,6 @@ const CreateDocumentTool = CreateUmbracoTool( // If fetching cultures fails, fallback to null culture culturesToUse = [null]; } - } else if (model.cultures.length === 0) { - // If empty array provided, use null culture (original behavior) - culturesToUse = [null]; } else { // Use provided cultures culturesToUse = model.cultures; From c9efe0d9818564a528f9080831c54c1301e16908 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Fri, 26 Sep 2025 10:04:58 +0200 Subject: [PATCH 11/12] undo changes to .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2774bc4..e74f1a7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,3 @@ dist **/.gemini/settings.json **/.qwen/settings.json **/.roo/mcp.json -/tmp/ From 06cc29dcf1a8f141c54c4996d11cd6bb18c81cf9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Sep 2025 08:29:50 +0000 Subject: [PATCH 12/12] Remove auto-fetch functionality, revert to original behavior when no cultures provided Co-authored-by: thebuilder <3764345+thebuilder@users.noreply.github.com> --- .../document/__tests__/create-document.test.ts | 10 +++++----- .../tools/document/post/create-document.ts | 18 ++++-------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/umb-management-api/tools/document/__tests__/create-document.test.ts b/src/umb-management-api/tools/document/__tests__/create-document.test.ts index ff9d27d..06d69c7 100644 --- a/src/umb-management-api/tools/document/__tests__/create-document.test.ts +++ b/src/umb-management-api/tools/document/__tests__/create-document.test.ts @@ -98,8 +98,8 @@ describe("create-document", () => { expect(cultures).toEqual(["da-DK", "en-US"]); }); - it("should create a document with empty cultures array (auto-fetch behavior)", async () => { - // Create document with empty cultures array - should behave same as no cultures parameter + it("should create a document with empty cultures array (null culture)", async () => { + // Create document with empty cultures array - should behave like original (null culture) const docModel = { documentTypeId: ROOT_DOCUMENT_TYPE_ID, name: TEST_DOCUMENT_NAME, @@ -115,8 +115,8 @@ describe("create-document", () => { const item = await DocumentTestHelper.findDocument(TEST_DOCUMENT_NAME); expect(item).toBeDefined(); - // Should fetch cultures and create variants (same as when cultures parameter is omitted) - // The exact number of variants depends on available cultures in the test environment - expect(item!.variants.length).toBeGreaterThanOrEqual(1); + // Should have single variant with null culture (original behavior) + expect(item!.variants).toHaveLength(1); + expect(item!.variants[0].culture).toBeNull(); }); }); diff --git a/src/umb-management-api/tools/document/post/create-document.ts b/src/umb-management-api/tools/document/post/create-document.ts index 2a394a3..a81a3d5 100644 --- a/src/umb-management-api/tools/document/post/create-document.ts +++ b/src/umb-management-api/tools/document/post/create-document.ts @@ -10,7 +10,7 @@ const createDocumentSchema = z.object({ documentTypeId: z.string().uuid("Must be a valid document type type UUID"), parentId: z.string().uuid("Must be a valid document UUID").optional(), name: z.string(), - cultures: z.array(z.string()).optional().describe("Array of culture codes. If not provided, will fetch available cultures from Umbraco."), + cultures: z.array(z.string()).optional().describe("Array of culture codes. If not provided or empty array, will create single variant with null culture."), values: z .array( z.object({ @@ -29,7 +29,7 @@ const CreateDocumentTool = CreateUmbracoTool( `Creates a document with support for multiple cultures. If cultures parameter is provided, a variant will be created for each culture code. - If cultures parameter is not provided, the tool will automatically fetch available cultures from Umbraco and create variants for all of them. + If cultures parameter is not provided or is an empty array, will create a single variant with null culture (original behavior). Always follow these requirements when creating documents exactly, do not deviate in any way. @@ -641,18 +641,8 @@ const CreateDocumentTool = CreateUmbracoTool( let culturesToUse: (string | null)[] = []; if (model.cultures === undefined || model.cultures.length === 0) { - // If cultures not provided or empty array, fetch available cultures from Umbraco - try { - const cultureResponse = await client.getCulture({ take: 100 }); - culturesToUse = cultureResponse.items.map(culture => culture.name); - // If no cultures available, fallback to null culture - if (culturesToUse.length === 0) { - culturesToUse = [null]; - } - } catch (error) { - // If fetching cultures fails, fallback to null culture - culturesToUse = [null]; - } + // If cultures not provided or empty array, use original behavior (null culture) + culturesToUse = [null]; } else { // Use provided cultures culturesToUse = model.cultures;