@umbraco-cms/mcp-dev 17.6.11 → 17.6.13

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;var __create = Object.create;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -4649,35 +4649,16 @@ var getTemporaryFileAPI = () => ({
4649
4649
  const formData = new FormData();
4650
4650
  formData.append("Id", postTemporaryFileBody2.Id);
4651
4651
  const file = postTemporaryFileBody2.File;
4652
- console.log("[temp-file] incoming file:", {
4653
- typeofFile: typeof file,
4654
- isBuffer: Buffer.isBuffer(file),
4655
- ctorName: _optionalChain([file, 'optionalAccess', _ => _.constructor, 'optionalAccess', _2 => _2.name]),
4656
- hasByteLength: typeof _optionalChain([file, 'optionalAccess', _3 => _3.byteLength]),
4657
- hasLength: typeof _optionalChain([file, 'optionalAccess', _4 => _4.length]),
4658
- keys: file ? Object.keys(file).slice(0, 10) : []
4659
- });
4660
4652
  const buffer = Buffer.isBuffer(file) ? file : await readStreamToBuffer(file);
4661
- console.log("[temp-file] buffer:", { length: buffer.byteLength });
4662
4653
  const bytes = new Uint8Array(buffer.byteLength);
4663
4654
  bytes.set(buffer);
4664
4655
  const blob = new Blob([bytes]);
4665
- console.log("[temp-file] blob:", { size: blob.size, type: blob.type, fileName: postTemporaryFileBody2.FileName });
4666
4656
  formData.append("File", blob, postTemporaryFileBody2.FileName);
4667
- const entries = [];
4668
- for (const [k, v] of formData.entries()) {
4669
- entries.push({
4670
- name: k,
4671
- valueKind: typeof v === "string" ? "string" : _nullishCoalesce(_optionalChain([v, 'optionalAccess', _5 => _5.constructor, 'optionalAccess', _6 => _6.name]), () => ( typeof v)),
4672
- valueSize: typeof v === "string" ? v.length : _nullishCoalesce(_optionalChain([v, 'optionalAccess', _7 => _7.size]), () => ( void 0))
4673
- });
4674
- }
4675
- console.log("[temp-file] formData entries:", entries);
4676
4657
  return _mcpserversdk.UmbracoManagementClient.call(void 0,
4677
4658
  {
4678
4659
  url: `/umbraco/management/api/v1/temporary-file`,
4679
4660
  method: "POST",
4680
- headers: _optionalChain([options, 'optionalAccess', _8 => _8.headers]),
4661
+ headers: _optionalChain([options, 'optionalAccess', _ => _.headers]),
4681
4662
  data: formData
4682
4663
  },
4683
4664
  options
@@ -4739,7 +4720,7 @@ function setUmbracoVersion(version) {
4739
4720
  umbracoVersion = _nullishCoalesce(version, () => ( null));
4740
4721
  }
4741
4722
  function isUmbracoAtLeast(major, minor, requestVersion) {
4742
- const version = _nullishCoalesce(_nullishCoalesce(requestVersion, () => ( _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _9 => _9[_mcpserversdk.UMBRACO_VERSION_CONTEXT_KEY]]))), () => ( umbracoVersion));
4723
+ const version = _nullishCoalesce(_nullishCoalesce(requestVersion, () => ( _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _2 => _2[_mcpserversdk.UMBRACO_VERSION_CONTEXT_KEY]]))), () => ( umbracoVersion));
4743
4724
  if (!version) return false;
4744
4725
  const [maj, min] = version.split(".").map((n) => parseInt(n, 10));
4745
4726
  if (Number.isNaN(maj) || Number.isNaN(min)) return false;
@@ -12554,12 +12535,23 @@ var get_data_type_configuration_default = _mcpserversdk.withStandardDecorators.c
12554
12535
 
12555
12536
  // src/umbraco-api/tools/data-type/get/get-data-type-schema-modern.ts
12556
12537
 
12538
+
12539
+
12540
+
12541
+
12557
12542
  async function getDataTypeSchemaFromApi(id) {
12558
12543
  const client = UmbracoManagementClient3.getClient();
12559
12544
  const response = await client.getDataTypeByIdSchema(
12560
12545
  id,
12561
12546
  _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE
12562
12547
  );
12548
+ if (typeof _optionalChain([response, 'optionalAccess', _3 => _3.status]) !== "number") {
12549
+ console.warn(
12550
+ "[get-data-type-schema-modern] API response had no numeric status; treating as success. Did the generated client's CAPTURE_RAW_HTTP_RESPONSE wiring change?"
12551
+ );
12552
+ } else if (response.status < 200 || response.status >= 300) {
12553
+ throw new (0, _mcpserversdk.UmbracoApiError)(_mcpserversdk.toProblemDetails.call(void 0, response));
12554
+ }
12563
12555
  return _nullishCoalesce(response.data, () => ( {}));
12564
12556
  }
12565
12557
 
@@ -12942,7 +12934,7 @@ async function synthesizeDataTypeSchema(id) {
12942
12934
  const client = UmbracoManagementClient3.getClient();
12943
12935
  const dataType = await client.getDataTypeById(id);
12944
12936
  const template = findTemplateByEditorAlias(dataType.editorAlias);
12945
- const valueTypeName = _nullishCoalesce(VALUE_TYPE_BY_EDITOR_ALIAS[dataType.editorAlias], () => ( (_optionalChain([template, 'optionalAccess', _10 => _10.value]) !== void 0 ? "JSON" : null)));
12937
+ const valueTypeName = _nullishCoalesce(VALUE_TYPE_BY_EDITOR_ALIAS[dataType.editorAlias], () => ( (_optionalChain([template, 'optionalAccess', _4 => _4.value]) !== void 0 ? "JSON" : null)));
12946
12938
  const jsonSchema = {
12947
12939
  $schema: "https://json-schema.org/draft/2020-12/schema",
12948
12940
  title: dataType.name,
@@ -12950,8 +12942,8 @@ async function synthesizeDataTypeSchema(id) {
12950
12942
  dataTypeId: dataType.id,
12951
12943
  editorAlias: dataType.editorAlias,
12952
12944
  editorUiAlias: dataType.editorUiAlias,
12953
- example: _optionalChain([template, 'optionalAccess', _11 => _11.value]),
12954
- notes: _optionalChain([template, 'optionalAccess', _12 => _12._notes])
12945
+ example: _optionalChain([template, 'optionalAccess', _5 => _5.value]),
12946
+ notes: _optionalChain([template, 'optionalAccess', _6 => _6._notes])
12955
12947
  };
12956
12948
  return { valueTypeName, jsonSchema };
12957
12949
  }
@@ -13072,7 +13064,7 @@ var CopyDataTypeTool = {
13072
13064
  validateStatus: () => true
13073
13065
  });
13074
13066
  if (response.status === 201) {
13075
- const location = _optionalChain([response, 'access', _13 => _13.headers, 'optionalAccess', _14 => _14.location]) || "";
13067
+ const location = _optionalChain([response, 'access', _7 => _7.headers, 'optionalAccess', _8 => _8.location]) || "";
13076
13068
  const newId = location.split("/").pop() || "";
13077
13069
  const output = {
13078
13070
  message: "Data type copied successfully",
@@ -13146,6 +13138,11 @@ var move_data_type_default = _mcpserversdk.withStandardDecorators.call(void 0, M
13146
13138
 
13147
13139
 
13148
13140
 
13141
+
13142
+ var inputSchema = _zod.z.object({
13143
+ ...getDataTypeByIdReferencedByParams.shape,
13144
+ ...getDataTypeByIdReferencedByQueryParams.shape
13145
+ });
13149
13146
  var GetReferencesDataTypeTool = {
13150
13147
  name: "get-references-data-type",
13151
13148
  description: `Gets the document types and properties that use a specific data type.
@@ -13159,16 +13156,20 @@ var GetReferencesDataTypeTool = {
13159
13156
 
13160
13157
  Returns a detailed list with content type information (id, type, name, icon) and all properties
13161
13158
  (name, alias) that use the specified data type.
13159
+
13160
+ Results are paginated (20 per page by default). Check the returned "total" against the number of
13161
+ "items" returned - if total is greater, call again with "cursor" set to the returned "nextCursor"
13162
+ to page through the remaining references so the list is complete before acting on it.
13162
13163
  `,
13163
- inputSchema: getDataTypeByIdReferencedByParams.shape,
13164
+ inputSchema: inputSchema.shape,
13164
13165
  outputSchema: getDataTypeByIdReferencedByResponse.shape,
13165
13166
  annotations: {
13166
13167
  readOnlyHint: true
13167
13168
  },
13168
13169
  slices: ["references"],
13169
- handler: (async ({ id }) => {
13170
+ handler: (async ({ id, skip, take }) => {
13170
13171
  return _mcpserversdk.executeGetApiCall.call(void 0,
13171
- (client) => client.getDataTypeByIdReferencedBy(id, void 0, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
13172
+ (client) => client.getDataTypeByIdReferencedBy(id, { skip, take }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
13172
13173
  );
13173
13174
  })
13174
13175
  };
@@ -13554,7 +13555,7 @@ var DataTypeCollection = {
13554
13555
  tools.push(get_data_type_batch_default);
13555
13556
  tools.push(get_data_type_configuration_default);
13556
13557
  tools.push(get_data_type_schema_default);
13557
- if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _15 => _15.umbracoVersion]))) {
13558
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _9 => _9.umbracoVersion]))) {
13558
13559
  tools.push(get_data_type_schemas_default);
13559
13560
  }
13560
13561
  }
@@ -13713,7 +13714,7 @@ var CreateDictionaryItemTool = {
13713
13714
  validateStatus: () => true
13714
13715
  });
13715
13716
  if (response.status === 201) {
13716
- const locationHeader = _optionalChain([response, 'access', _16 => _16.headers, 'optionalAccess', _17 => _17["location"]]) || _optionalChain([response, 'access', _18 => _18.headers, 'optionalAccess', _19 => _19["Location"]]);
13717
+ const locationHeader = _optionalChain([response, 'access', _10 => _10.headers, 'optionalAccess', _11 => _11["location"]]) || _optionalChain([response, 'access', _12 => _12.headers, 'optionalAccess', _13 => _13["Location"]]);
13717
13718
  let createdId = model.id || "";
13718
13719
  if (locationHeader) {
13719
13720
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -14511,7 +14512,7 @@ var get_document_notifications_default = _mcpserversdk.withStandardDecorators.ca
14511
14512
 
14512
14513
 
14513
14514
 
14514
- var inputSchema = _zod.z.object({
14515
+ var inputSchema2 = _zod.z.object({
14515
14516
  ...getDocumentByIdPublicAccessParams.shape,
14516
14517
  ...getDocumentByIdPublicAccessQueryParams.shape
14517
14518
  });
@@ -14520,7 +14521,7 @@ var GetDocumentPublicAccessTool = {
14520
14521
  description: `Gets the public access settings for a document by Id.
14521
14522
  Set includeAncestors=true to also resolve protection inherited from an ancestor
14522
14523
  (the response's isProtectedByAncestor field reflects this).`,
14523
- inputSchema: inputSchema.shape,
14524
+ inputSchema: inputSchema2.shape,
14524
14525
  outputSchema: getDocumentByIdPublicAccessResponse.shape,
14525
14526
  annotations: {
14526
14527
  readOnlyHint: true
@@ -14541,14 +14542,14 @@ var get_document_public_access_default = _mcpserversdk.withStandardDecorators.ca
14541
14542
 
14542
14543
 
14543
14544
 
14544
- var inputSchema2 = {
14545
+ var inputSchema3 = {
14545
14546
  id: getDocumentByIdAuditLogParams.shape.id,
14546
14547
  ...getDocumentByIdAuditLogQueryParams.shape
14547
14548
  };
14548
14549
  var GetDocumentAuditLogTool = {
14549
14550
  name: "get-document-audit-log",
14550
14551
  description: "Fetches the audit log for a document by Id.",
14551
- inputSchema: inputSchema2,
14552
+ inputSchema: inputSchema3,
14552
14553
  outputSchema: getDocumentByIdAuditLogResponse.shape,
14553
14554
  annotations: {
14554
14555
  readOnlyHint: true
@@ -14588,6 +14589,32 @@ var GetDocumentPublishTool = {
14588
14589
  };
14589
14590
  var get_document_publish_default = _mcpserversdk.withStandardDecorators.call(void 0, GetDocumentPublishTool);
14590
14591
 
14592
+ // src/umbraco-api/tools/document/get/get-document-publish-with-descendants-result.ts
14593
+
14594
+
14595
+
14596
+
14597
+
14598
+ var GetDocumentPublishWithDescendantsResultTool = {
14599
+ name: "get-document-publish-with-descendants-result",
14600
+ description: `Gets the status/result of an in-progress or previously-polled publish-with-descendants operation by Id and taskId.
14601
+ Use this to follow up after publish-document-with-descendants reports the publish is still running, or returned an error.
14602
+ Returns isComplete: true once the publish has finished. If some descendants failed to publish, this returns an error result carrying the failed branch items.`,
14603
+ inputSchema: getDocumentByIdPublishWithDescendantsResultByTaskIdParams.shape,
14604
+ outputSchema: getDocumentByIdPublishWithDescendantsResultByTaskIdResponse.shape,
14605
+ annotations: {
14606
+ readOnlyHint: true
14607
+ },
14608
+ slices: ["publish"],
14609
+ enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Publish),
14610
+ handler: (async ({ id, taskId }) => {
14611
+ return _mcpserversdk.executeGetApiCall.call(void 0,
14612
+ (client) => client.getDocumentByIdPublishWithDescendantsResultByTaskId(id, taskId, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
14613
+ );
14614
+ })
14615
+ };
14616
+ var get_document_publish_with_descendants_result_default = _mcpserversdk.withStandardDecorators.call(void 0, GetDocumentPublishWithDescendantsResultTool);
14617
+
14591
14618
  // src/umbraco-api/tools/document/get/get-document-configuration.ts
14592
14619
 
14593
14620
 
@@ -14650,12 +14677,23 @@ var get_document_urls_default = _mcpserversdk.withStandardDecorators.call(void 0
14650
14677
 
14651
14678
  // src/umbraco-api/tools/document/get/get-document-type-schema-modern.ts
14652
14679
 
14680
+
14681
+
14682
+
14683
+
14653
14684
  async function getDocumentTypeSchemaFromApi(id) {
14654
14685
  const client = UmbracoManagementClient3.getClient();
14655
14686
  const response = await client.getDocumentTypeByIdSchema(
14656
14687
  id,
14657
14688
  _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE
14658
14689
  );
14690
+ if (typeof _optionalChain([response, 'optionalAccess', _14 => _14.status]) !== "number") {
14691
+ console.warn(
14692
+ "[get-document-type-schema-modern] API response had no numeric status; treating as success. Did the generated client's CAPTURE_RAW_HTTP_RESPONSE wiring change?"
14693
+ );
14694
+ } else if (response.status < 200 || response.status >= 300) {
14695
+ throw new (0, _mcpserversdk.UmbracoApiError)(_mcpserversdk.toProblemDetails.call(void 0, response));
14696
+ }
14659
14697
  return { schema: response.data };
14660
14698
  }
14661
14699
 
@@ -14673,8 +14711,8 @@ function buildPropertyEntry(prop, dataType, template) {
14673
14711
  editorAlias: dataType.editorAlias,
14674
14712
  dataTypeId: dataType.id,
14675
14713
  dataTypeName: dataType.name,
14676
- example: _optionalChain([template, 'optionalAccess', _20 => _20.value]),
14677
- notes: _optionalChain([template, 'optionalAccess', _21 => _21._notes])
14714
+ example: _optionalChain([template, 'optionalAccess', _15 => _15.value]),
14715
+ notes: _optionalChain([template, 'optionalAccess', _16 => _16._notes])
14678
14716
  };
14679
14717
  }
14680
14718
  async function synthesizeDocumentTypeSchema(id) {
@@ -14755,7 +14793,7 @@ var search_document_default = _mcpserversdk.withStandardDecorators.call(void 0,
14755
14793
 
14756
14794
 
14757
14795
 
14758
- var inputSchema3 = _zod.z.object({
14796
+ var inputSchema4 = _zod.z.object({
14759
14797
  ...getCollectionDocumentByIdParams.shape,
14760
14798
  ...getCollectionDocumentByIdQueryParams.shape
14761
14799
  });
@@ -14763,7 +14801,7 @@ var GetCollectionDocumentByIdTool = {
14763
14801
  name: "get-collection-document-by-id",
14764
14802
  description: `Get a collection of document items
14765
14803
  Use this to retrieve a filtered and paginated collection of document items based on various criteria like data type, ordering, and filtering.`,
14766
- inputSchema: inputSchema3.shape,
14804
+ inputSchema: inputSchema4.shape,
14767
14805
  outputSchema: getCollectionDocumentByIdResponse.shape,
14768
14806
  annotations: {
14769
14807
  readOnlyHint: true
@@ -14842,7 +14880,7 @@ var get_document_are_referenced_default = _mcpserversdk.withStandardDecorators.c
14842
14880
 
14843
14881
 
14844
14882
 
14845
- var inputSchema4 = _zod.z.object({
14883
+ var inputSchema5 = _zod.z.object({
14846
14884
  ...getDocumentByIdReferencedByParams.shape,
14847
14885
  ...getDocumentByIdReferencedByQueryParams.shape
14848
14886
  });
@@ -14850,7 +14888,7 @@ var GetDocumentByIdReferencedByTool = {
14850
14888
  name: "get-document-by-id-referenced-by",
14851
14889
  description: `Get items that reference a specific document item
14852
14890
  Use this to find all content, documents, or other items that are currently referencing a specific document item.`,
14853
- inputSchema: inputSchema4.shape,
14891
+ inputSchema: inputSchema5.shape,
14854
14892
  outputSchema: getDocumentByIdReferencedByResponse.shape,
14855
14893
  annotations: {
14856
14894
  readOnlyHint: true
@@ -14871,7 +14909,7 @@ var get_document_by_id_referenced_by_default = _mcpserversdk.withStandardDecorat
14871
14909
 
14872
14910
 
14873
14911
 
14874
- var inputSchema5 = _zod.z.object({
14912
+ var inputSchema6 = _zod.z.object({
14875
14913
  ...getDocumentByIdReferencedDescendantsParams.shape,
14876
14914
  ...getDocumentByIdReferencedDescendantsQueryParams.shape
14877
14915
  });
@@ -14884,7 +14922,7 @@ var GetDocumentByIdReferencedDescendantsTool = {
14884
14922
  \u2022 Impact analysis: Before deleting a document folder, see what content would be affected
14885
14923
  \u2022 Dependency tracking: Find all content using documents from a specific folder hierarchy
14886
14924
  \u2022 Content auditing: Identify which descendant document items are actually being used`,
14887
- inputSchema: inputSchema5.shape,
14925
+ inputSchema: inputSchema6.shape,
14888
14926
  outputSchema: getDocumentByIdReferencedDescendantsResponse.shape,
14889
14927
  annotations: {
14890
14928
  readOnlyHint: true
@@ -14905,7 +14943,7 @@ var get_document_by_id_referenced_descendants_default = _mcpserversdk.withStanda
14905
14943
 
14906
14944
 
14907
14945
 
14908
- var inputSchema6 = _zod.z.object({
14946
+ var inputSchema7 = _zod.z.object({
14909
14947
  ...getDocumentByIdAvailableSegmentOptionsParams.shape,
14910
14948
  ...getDocumentByIdAvailableSegmentOptionsQueryParams.shape
14911
14949
  });
@@ -14919,7 +14957,7 @@ var GetDocumentAvailableSegmentOptionsTool = {
14919
14957
  \u2022 Understanding what content variations are available for a document
14920
14958
  \u2022 Determining which segments can be used when creating or editing document content
14921
14959
  \u2022 Viewing segment names, aliases, and associated cultures`,
14922
- inputSchema: inputSchema6.shape,
14960
+ inputSchema: inputSchema7.shape,
14923
14961
  outputSchema: getDocumentByIdAvailableSegmentOptionsResponse.shape,
14924
14962
  annotations: {
14925
14963
  readOnlyHint: true
@@ -14988,14 +15026,14 @@ var get_recycle_bin_document_referenced_by_default = _mcpserversdk.withStandardD
14988
15026
 
14989
15027
 
14990
15028
 
14991
- var inputSchema7 = {
15029
+ var inputSchema8 = {
14992
15030
  id: postDocumentByIdPublicAccessParams.shape.id,
14993
15031
  data: _zod.z.object(postDocumentByIdPublicAccessBody.shape)
14994
15032
  };
14995
15033
  var PostDocumentPublicAccessTool = {
14996
15034
  name: "post-document-public-access",
14997
15035
  description: "Adds public access settings to a document by Id.",
14998
- inputSchema: inputSchema7,
15036
+ inputSchema: inputSchema8,
14999
15037
  slices: ["public-access"],
15000
15038
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.PublicAccess),
15001
15039
  handler: (async (model) => {
@@ -15076,7 +15114,7 @@ var CopyDocumentTool = {
15076
15114
  validateStatus: () => true
15077
15115
  });
15078
15116
  if (response.status === 201) {
15079
- const location = _optionalChain([response, 'access', _22 => _22.headers, 'optionalAccess', _23 => _23.location]) || "";
15117
+ const location = _optionalChain([response, 'access', _17 => _17.headers, 'optionalAccess', _18 => _18.location]) || "";
15080
15118
  const newId = location.split("/").pop() || "";
15081
15119
  const output = { id: newId };
15082
15120
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -15220,7 +15258,7 @@ var CreateDocumentTool = {
15220
15258
  template = { id: model.templateId };
15221
15259
  } else {
15222
15260
  const docType = await client.getDocumentTypeById(model.documentTypeId);
15223
- template = _optionalChain([docType, 'access', _24 => _24.defaultTemplate, 'optionalAccess', _25 => _25.id]) ? { id: docType.defaultTemplate.id } : null;
15261
+ template = _optionalChain([docType, 'access', _19 => _19.defaultTemplate, 'optionalAccess', _20 => _20.id]) ? { id: docType.defaultTemplate.id } : null;
15224
15262
  }
15225
15263
  const payload = {
15226
15264
  id: documentId,
@@ -15398,7 +15436,7 @@ var CreateAndPublishDocumentTool = {
15398
15436
  template = { id: model.templateId };
15399
15437
  } else {
15400
15438
  const docType = await client.getDocumentTypeById(model.documentTypeId);
15401
- template = _optionalChain([docType, 'access', _26 => _26.defaultTemplate, 'optionalAccess', _27 => _27.id]) ? { id: docType.defaultTemplate.id } : null;
15439
+ template = _optionalChain([docType, 'access', _21 => _21.defaultTemplate, 'optionalAccess', _22 => _22.id]) ? { id: docType.defaultTemplate.id } : null;
15402
15440
  }
15403
15441
  const payload = {
15404
15442
  id: documentId,
@@ -15436,14 +15474,14 @@ var create_and_publish_document_default = _mcpserversdk.withStandardDecorators.c
15436
15474
 
15437
15475
 
15438
15476
 
15439
- var inputSchema8 = {
15477
+ var inputSchema9 = {
15440
15478
  id: putDocumentByIdPublicAccessParams.shape.id,
15441
15479
  data: _zod.z.object(putDocumentByIdPublicAccessBody.shape)
15442
15480
  };
15443
15481
  var PutDocumentPublicAccessTool = {
15444
15482
  name: "put-document-public-access",
15445
15483
  description: "Updates public access settings for a document by Id.",
15446
- inputSchema: inputSchema8,
15484
+ inputSchema: inputSchema9,
15447
15485
  annotations: {
15448
15486
  idempotentHint: true
15449
15487
  },
@@ -15464,7 +15502,7 @@ var put_document_public_access_default = _mcpserversdk.withStandardDecorators.ca
15464
15502
 
15465
15503
 
15466
15504
 
15467
- var inputSchema9 = {
15505
+ var inputSchema10 = {
15468
15506
  id: putDocumentByIdDomainsParams.shape.id,
15469
15507
  data: _zod.z.object(putDocumentByIdDomainsBody.shape)
15470
15508
  };
@@ -15472,7 +15510,7 @@ var PutDocumentDomainsTool = {
15472
15510
  name: "put-document-domains",
15473
15511
  description: `Updates the domains assigned to a document by Id. Default value of the defaultIsoCode is null.
15474
15512
  Domain isoCode in the domains array should be in the format of 'en-US' amd be a valid domain name from the Umbraco instance.`,
15475
- inputSchema: inputSchema9,
15513
+ inputSchema: inputSchema10,
15476
15514
  annotations: {
15477
15515
  idempotentHint: true
15478
15516
  },
@@ -15493,14 +15531,14 @@ var put_document_domains_default = _mcpserversdk.withStandardDecorators.call(voi
15493
15531
 
15494
15532
 
15495
15533
 
15496
- var inputSchema10 = {
15534
+ var inputSchema11 = {
15497
15535
  id: putDocumentByIdNotificationsParams.shape.id,
15498
15536
  data: _zod.z.object(putDocumentByIdNotificationsBody.shape)
15499
15537
  };
15500
15538
  var PutDocumentNotificationsTool = {
15501
15539
  name: "put-document-notifications",
15502
15540
  description: "Updates the notifications for a document by Id.",
15503
- inputSchema: inputSchema10,
15541
+ inputSchema: inputSchema11,
15504
15542
  annotations: {
15505
15543
  idempotentHint: true
15506
15544
  },
@@ -15518,15 +15556,18 @@ var put_document_notifications_default = _mcpserversdk.withStandardDecorators.ca
15518
15556
 
15519
15557
 
15520
15558
 
15521
- var inputSchema11 = {
15559
+
15560
+
15561
+
15562
+ var inputSchema12 = {
15522
15563
  id: _zod.z.string().uuid(),
15523
15564
  data: _zod.z.object(putDocumentByIdPublishWithDescendantsBody.shape)
15524
15565
  };
15525
15566
  var PublishDocumentWithDescendantsTool = {
15526
15567
  name: "publish-document-with-descendants",
15527
15568
  description: `Publishes a document and its descendants by Id. This is an asynchronous operation that may take time for large document trees.
15528
- The tool will poll for completion and return the final result when finished.`,
15529
- inputSchema: inputSchema11,
15569
+ The tool polls for completion for up to 60 seconds. If the publish is still running or ambiguous when that limit is reached, follow up with get-document-publish-with-descendants-result using the returned taskId.`,
15570
+ inputSchema: inputSchema12,
15530
15571
  annotations: {},
15531
15572
  slices: ["publish"],
15532
15573
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Publish),
@@ -15552,12 +15593,25 @@ var PublishDocumentWithDescendantsTool = {
15552
15593
  while (attempts < maxAttempts) {
15553
15594
  attempts++;
15554
15595
  await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
15596
+ let statusResponse;
15555
15597
  try {
15556
- const statusResponse = await client.getDocumentByIdPublishWithDescendantsResultByTaskId(
15598
+ statusResponse = await client.getDocumentByIdPublishWithDescendantsResultByTaskId(
15557
15599
  model.id,
15558
- initialResponse.taskId
15600
+ initialResponse.taskId,
15601
+ _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE
15559
15602
  );
15560
- if (statusResponse.isComplete) {
15603
+ } catch (error) {
15604
+ return _mcpserversdk.createToolResultError.call(void 0, {
15605
+ type: "Error",
15606
+ title: "Failed to poll publish-with-descendants status",
15607
+ detail: error instanceof Error ? error.message : String(error),
15608
+ status: 500,
15609
+ taskId: initialResponse.taskId
15610
+ });
15611
+ }
15612
+ if (statusResponse.status >= 200 && statusResponse.status < 300) {
15613
+ const data = statusResponse.data;
15614
+ if (_optionalChain([data, 'optionalAccess', _23 => _23.isComplete])) {
15561
15615
  return {
15562
15616
  content: [
15563
15617
  {
@@ -15567,29 +15621,22 @@ var PublishDocumentWithDescendantsTool = {
15567
15621
  ]
15568
15622
  };
15569
15623
  }
15570
- } catch (error) {
15571
- return {
15572
- content: [
15573
- {
15574
- type: "text",
15575
- text: JSON.stringify({
15576
- status: "error",
15577
- taskId: initialResponse.taskId,
15578
- message: `Failed to poll status: ${error}. You can manually check status using taskId.`
15579
- })
15580
- }
15581
- ]
15582
- };
15624
+ continue;
15583
15625
  }
15626
+ return _mcpserversdk.createToolResultError.call(void 0, {
15627
+ ..._mcpserversdk.toProblemDetails.call(void 0, statusResponse),
15628
+ documentId: model.id,
15629
+ taskId: initialResponse.taskId
15630
+ });
15584
15631
  }
15585
15632
  return {
15586
15633
  content: [
15587
15634
  {
15588
15635
  type: "text",
15589
15636
  text: JSON.stringify({
15590
- status: "timeout",
15637
+ status: "in-progress",
15591
15638
  taskId: initialResponse.taskId,
15592
- message: "Publish operation timed out after 1 minute. The operation may still be running. Use the taskId to check status manually."
15639
+ message: `Publishing is still in progress after 60 seconds. Use get-document-publish-with-descendants-result with id "${model.id}" and taskId "${initialResponse.taskId}" to check whether it has finished.`
15593
15640
  })
15594
15641
  }
15595
15642
  ]
@@ -15605,14 +15652,14 @@ var publish_document_with_descendants_default = _mcpserversdk.withStandardDecora
15605
15652
 
15606
15653
 
15607
15654
 
15608
- var inputSchema12 = {
15655
+ var inputSchema13 = {
15609
15656
  id: _zod.z.string().uuid(),
15610
15657
  data: _zod.z.object(putDocumentByIdUnpublishBody.shape)
15611
15658
  };
15612
15659
  var UnpublishDocumentTool = {
15613
15660
  name: "unpublish-document",
15614
15661
  description: "Unpublishes a document by Id.",
15615
- inputSchema: inputSchema12,
15662
+ inputSchema: inputSchema13,
15616
15663
  annotations: {},
15617
15664
  slices: ["publish"],
15618
15665
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Unpublish),
@@ -15653,7 +15700,7 @@ var sort_document_default = _mcpserversdk.withStandardDecorators.call(void 0, So
15653
15700
 
15654
15701
 
15655
15702
 
15656
- var inputSchema13 = {
15703
+ var inputSchema14 = {
15657
15704
  id: putDocumentByIdSortChildrenParams.shape.id,
15658
15705
  data: _zod.z.object(putDocumentByIdSortChildrenBody.shape)
15659
15706
  };
@@ -15664,7 +15711,7 @@ var SortDocumentChildrenTool = {
15664
15711
  This is DIFFERENT from sort-document: sort-document reorders children according to an explicit list of ids and sort orders you provide, whereas sort-document-children sorts every child of {id} automatically by the chosen field and direction - no explicit ordering is required.
15665
15712
 
15666
15713
  When sorting by Name, an optional culture selects which variant name to sort by; the culture is not validated, so children that do not vary by it (or an unrecognised culture) fall back to the invariant name.`,
15667
- inputSchema: inputSchema13,
15714
+ inputSchema: inputSchema14,
15668
15715
  annotations: {},
15669
15716
  slices: ["sort"],
15670
15717
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Sort),
@@ -15708,14 +15755,14 @@ var sort_document_root_children_default = _mcpserversdk.withStandardDecorators.c
15708
15755
 
15709
15756
 
15710
15757
 
15711
- var inputSchema14 = {
15758
+ var inputSchema15 = {
15712
15759
  id: _zod.z.string().uuid(),
15713
15760
  data: _zod.z.object(putDocumentByIdMoveBody.shape)
15714
15761
  };
15715
15762
  var MoveDocumentTool = {
15716
15763
  name: "move-document",
15717
15764
  description: "Move a document to a new location",
15718
- inputSchema: inputSchema14,
15765
+ inputSchema: inputSchema15,
15719
15766
  annotations: {},
15720
15767
  slices: ["move"],
15721
15768
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Move),
@@ -15734,7 +15781,7 @@ var move_document_default = _mcpserversdk.withStandardDecorators.call(void 0, Mo
15734
15781
 
15735
15782
 
15736
15783
 
15737
- var inputSchema15 = {
15784
+ var inputSchema16 = {
15738
15785
  id: _zod.z.string().uuid(),
15739
15786
  data: _zod.z.object(putDocumentByIdPublishBody.shape)
15740
15787
  };
@@ -15744,7 +15791,7 @@ var PublishDocumentTool = {
15744
15791
  This function bypasses approval workflows and publishes directly to the live site.
15745
15792
  When the culture is not provided, the default culture is null.
15746
15793
  When the schedule is not provided, the default schedule is null.`,
15747
- inputSchema: inputSchema15,
15794
+ inputSchema: inputSchema16,
15748
15795
  annotations: {},
15749
15796
  slices: ["publish"],
15750
15797
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Publish),
@@ -15832,7 +15879,7 @@ var move_to_recycle_bin_default = _mcpserversdk.withStandardDecorators.call(void
15832
15879
 
15833
15880
 
15834
15881
 
15835
- var inputSchema16 = {
15882
+ var inputSchema17 = {
15836
15883
  id: putDocumentByIdParams.shape.id,
15837
15884
  data: _zod.z.object(putDocumentByIdBody.shape),
15838
15885
  confirmClearValues: _zod.z.boolean().optional().describe(
@@ -15859,21 +15906,21 @@ var UpdateDocumentTool = {
15859
15906
  Always include the full, unmodified "values" array from the document you just read unless you
15860
15907
  intend to clear every property. If the document currently has values, an empty "values" array is
15861
15908
  rejected unless "confirmClearValues" is set to true.`,
15862
- inputSchema: inputSchema16,
15909
+ inputSchema: inputSchema17,
15863
15910
  annotations: {
15864
15911
  idempotentHint: true
15865
15912
  },
15866
15913
  slices: ["update"],
15867
15914
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Update),
15868
15915
  handler: (async (model) => {
15869
- const incomingValues = _optionalChain([model, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.values]);
15916
+ const incomingValues = _optionalChain([model, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.values]);
15870
15917
  if (Array.isArray(incomingValues) && incomingValues.length === 0 && !model.confirmClearValues) {
15871
15918
  const client = UmbracoManagementClient3.getClient();
15872
15919
  let currentDocument;
15873
15920
  try {
15874
15921
  currentDocument = await client.getDocumentById(model.id);
15875
15922
  } catch (error) {
15876
- const status = _optionalChain([error, 'optionalAccess', _30 => _30.response, 'optionalAccess', _31 => _31.status]);
15923
+ const status = _optionalChain([error, 'optionalAccess', _26 => _26.response, 'optionalAccess', _27 => _27.status]);
15877
15924
  if (status !== 404) {
15878
15925
  throw error;
15879
15926
  }
@@ -15899,7 +15946,7 @@ var update_document_default = _mcpserversdk.withStandardDecorators.call(void 0,
15899
15946
 
15900
15947
 
15901
15948
 
15902
- var inputSchema17 = {
15949
+ var inputSchema18 = {
15903
15950
  id: putDocumentByIdUpdateAndPublishParams.shape.id,
15904
15951
  data: _zod.z.object(putDocumentByIdUpdateAndPublishBody.shape)
15905
15952
  };
@@ -15920,7 +15967,7 @@ var UpdateAndPublishDocumentTool = {
15920
15967
  - Always read the current document value first
15921
15968
  - Only update the required values
15922
15969
  - Don't miss any properties from the original document`,
15923
- inputSchema: inputSchema17,
15970
+ inputSchema: inputSchema18,
15924
15971
  annotations: {
15925
15972
  idempotentHint: true
15926
15973
  },
@@ -15942,20 +15989,25 @@ async function getAllDocumentTypeProperties(documentTypeId) {
15942
15989
  const client = UmbracoManagementClient3.getClient();
15943
15990
  const visitedIds = /* @__PURE__ */ new Set();
15944
15991
  const properties = [];
15945
- async function resolveDocumentType(docTypeId) {
15992
+ const rootDocType = await client.getDocumentTypeById(documentTypeId);
15993
+ const rootVariesByCulture = rootDocType.variesByCulture;
15994
+ const rootVariesBySegment = rootDocType.variesBySegment;
15995
+ async function resolveDocumentType(docTypeId, preloaded) {
15946
15996
  if (visitedIds.has(docTypeId)) {
15947
15997
  return;
15948
15998
  }
15949
15999
  visitedIds.add(docTypeId);
15950
- const docType = await client.getDocumentTypeById(docTypeId);
16000
+ const docType = await _asyncNullishCoalesce(preloaded, async () => ( await client.getDocumentTypeById(docTypeId)));
15951
16001
  for (const prop of docType.properties) {
15952
16002
  if (!properties.some((p) => p.alias === prop.alias)) {
15953
16003
  properties.push({
15954
16004
  alias: prop.alias,
15955
16005
  name: prop.name,
15956
16006
  dataTypeId: prop.dataType.id,
15957
- variesByCulture: prop.variesByCulture,
15958
- variesBySegment: prop.variesBySegment
16007
+ // AND with the root document type's own flag: a composition's property can't
16008
+ // vary more than the document type it's actually used on.
16009
+ variesByCulture: prop.variesByCulture && rootVariesByCulture,
16010
+ variesBySegment: prop.variesBySegment && rootVariesBySegment
15959
16011
  });
15960
16012
  }
15961
16013
  }
@@ -15963,7 +16015,7 @@ async function getAllDocumentTypeProperties(documentTypeId) {
15963
16015
  await resolveDocumentType(composition.documentType.id);
15964
16016
  }
15965
16017
  }
15966
- await resolveDocumentType(documentTypeId);
16018
+ await resolveDocumentType(documentTypeId, rootDocType);
15967
16019
  return properties;
15968
16020
  }
15969
16021
  function validateCultureSegment(prop, def) {
@@ -16303,7 +16355,7 @@ var UpdateDocumentPropertiesTool = {
16303
16355
  const docTypeProps = await getDocumentTypeProperties();
16304
16356
  const propsToValidate = allPropertiesToValidate.map((p) => {
16305
16357
  const def = docTypeProps.find((d) => d.alias === p.alias);
16306
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _32 => _32.dataTypeId]), () => ( "")) };
16358
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _28 => _28.dataTypeId]), () => ( "")) };
16307
16359
  }).filter((p) => p.dataTypeId);
16308
16360
  if (propsToValidate.length > 0) {
16309
16361
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -16705,7 +16757,7 @@ var UpdateBlockPropertyTool = {
16705
16757
  if (!isUmbracoAtLeast(17, 4) && elementTypeProperties.length > 0) {
16706
16758
  const propsToValidate = update.properties.map((p) => {
16707
16759
  const def = elementTypeProperties.find((d) => d.alias === p.alias);
16708
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _33 => _33.dataTypeId]), () => ( "")) };
16760
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _29 => _29.dataTypeId]), () => ( "")) };
16709
16761
  }).filter((p) => p.dataTypeId);
16710
16762
  if (propsToValidate.length > 0) {
16711
16763
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -17037,14 +17089,14 @@ function removeRteBlockElement(markup, contentKey) {
17037
17089
  return markup.slice(0, start) + markup.slice(end);
17038
17090
  }
17039
17091
  function getBlockTypeConfigurations(dataTypeValues) {
17040
- const blocks = _optionalChain([dataTypeValues, 'optionalAccess', _34 => _34.find, 'call', _35 => _35((v) => v.alias === "blocks"), 'optionalAccess', _36 => _36.value]);
17092
+ const blocks = _optionalChain([dataTypeValues, 'optionalAccess', _30 => _30.find, 'call', _31 => _31((v) => v.alias === "blocks"), 'optionalAccess', _32 => _32.value]);
17041
17093
  return Array.isArray(blocks) ? blocks : [];
17042
17094
  }
17043
17095
  function findBlockTypeConfiguration(configs, contentElementTypeKey) {
17044
17096
  return configs.find((c) => c.contentElementTypeKey === contentElementTypeKey);
17045
17097
  }
17046
17098
  function findAreaConfiguration(configs, parentContentTypeKey, areaKey) {
17047
- return _optionalChain([findBlockTypeConfiguration, 'call', _37 => _37(configs, parentContentTypeKey), 'optionalAccess', _38 => _38.areas, 'optionalAccess', _39 => _39.find, 'call', _40 => _40((a) => a.key === areaKey)]);
17099
+ return _optionalChain([findBlockTypeConfiguration, 'call', _33 => _33(configs, parentContentTypeKey), 'optionalAccess', _34 => _34.areas, 'optionalAccess', _35 => _35.find, 'call', _36 => _36((a) => a.key === areaKey)]);
17048
17100
  }
17049
17101
  function checkAllowedInArea(blockConfig, area) {
17050
17102
  if (blockConfig.allowInAreas === false) {
@@ -17186,7 +17238,7 @@ var createDocumentBlockSchema = {
17186
17238
  properties: _zod.z.array(blockPropertyValueSchema).optional().describe("Content property values for the new block"),
17187
17239
  settings: _zod.z.object({
17188
17240
  properties: _zod.z.array(blockPropertyValueSchema).describe("Settings property values")
17189
- }).optional().describe("Settings for the new block; the settings element type comes from the data type configuration"),
17241
+ }).optional().describe("Settings for the new block; the settings element type comes from the data type configuration. When the block type has a settings element type, a settings entry is always created (empty if this is omitted), as the backoffice does"),
17190
17242
  placement: placementSchema.optional().describe("Where to place the block relative to siblings (default: append)"),
17191
17243
  grid: gridSchema.optional().describe("BlockGrid-only layout options. Rejected for BlockList/RichText properties")
17192
17244
  };
@@ -17210,7 +17262,7 @@ async function validateBlockProperties(elementTypeKey, properties, label) {
17210
17262
  if (!isUmbracoAtLeast(17, 4) && definitions.length > 0) {
17211
17263
  const propsToValidate = properties.map((p) => {
17212
17264
  const def = definitions.find((d) => d.alias === p.alias);
17213
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _41 => _41.dataTypeId]), () => ( "")) };
17265
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _37 => _37.dataTypeId]), () => ( "")) };
17214
17266
  }).filter((p) => p.dataTypeId);
17215
17267
  if (propsToValidate.length > 0) {
17216
17268
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -17253,15 +17305,15 @@ var CreateDocumentBlockTool = {
17253
17305
  const { kind, container, blockConfigs } = ctx;
17254
17306
  const placement = _nullishCoalesce(model.placement, () => ( { position: "append" }));
17255
17307
  const contentProperties = _nullishCoalesce(model.properties, () => ( []));
17256
- const settingsProperties = _nullishCoalesce(_optionalChain([model, 'access', _42 => _42.settings, 'optionalAccess', _43 => _43.properties]), () => ( []));
17308
+ const settingsProperties = _nullishCoalesce(_optionalChain([model, 'access', _38 => _38.settings, 'optionalAccess', _39 => _39.properties]), () => ( []));
17257
17309
  if (model.grid && kind !== "BlockGrid") {
17258
17310
  throw new (0, _mcpserversdk.ToolValidationError)({
17259
17311
  title: "grid options not supported",
17260
17312
  detail: `'grid' only applies to BlockGrid properties; '${model.propertyAlias}' is a ${kind} property`
17261
17313
  });
17262
17314
  }
17263
- const areaKey = _optionalChain([model, 'access', _44 => _44.grid, 'optionalAccess', _45 => _45.areaKey]);
17264
- const parentContentKey = _optionalChain([model, 'access', _46 => _46.grid, 'optionalAccess', _47 => _47.parentContentKey]);
17315
+ const areaKey = _optionalChain([model, 'access', _40 => _40.grid, 'optionalAccess', _41 => _41.areaKey]);
17316
+ const parentContentKey = _optionalChain([model, 'access', _42 => _42.grid, 'optionalAccess', _43 => _43.parentContentKey]);
17265
17317
  if (!!areaKey !== !!parentContentKey) {
17266
17318
  throw new (0, _mcpserversdk.ToolValidationError)({
17267
17319
  title: "Incomplete area target",
@@ -17311,7 +17363,7 @@ var CreateDocumentBlockTool = {
17311
17363
  title: "Area not found",
17312
17364
  detail: `Area '${key}' is not configured for block type '${parentBlock.contentTypeKey}'`,
17313
17365
  extensions: {
17314
- availableAreas: (_nullishCoalesce(_optionalChain([findBlockTypeConfiguration, 'call', _48 => _48(blockConfigs, parentBlock.contentTypeKey), 'optionalAccess', _49 => _49.areas]), () => ( []))).map((a) => ({ key: a.key, alias: _nullishCoalesce(a.alias, () => ( null)) }))
17366
+ availableAreas: (_nullishCoalesce(_optionalChain([findBlockTypeConfiguration, 'call', _44 => _44(blockConfigs, parentBlock.contentTypeKey), 'optionalAccess', _45 => _45.areas]), () => ( []))).map((a) => ({ key: a.key, alias: _nullishCoalesce(a.alias, () => ( null)) }))
17315
17367
  }
17316
17368
  });
17317
17369
  }
@@ -17333,7 +17385,7 @@ var CreateDocumentBlockTool = {
17333
17385
  detail: `No block with contentKey '${placement.contentKey}' exists in property '${model.propertyAlias}'`
17334
17386
  });
17335
17387
  }
17336
- if (areaKey && (sibling.areaKey !== areaKey || _optionalChain([sibling, 'access', _50 => _50.parent, 'optionalAccess', _51 => _51.contentKey]) !== parentContentKey)) {
17388
+ if (areaKey && (sibling.areaKey !== areaKey || _optionalChain([sibling, 'access', _46 => _46.parent, 'optionalAccess', _47 => _47.contentKey]) !== parentContentKey)) {
17337
17389
  throw new (0, _mcpserversdk.ToolValidationError)({
17338
17390
  title: "Sibling not in target area",
17339
17391
  detail: `Block '${placement.contentKey}' is not in area '${areaKey}' of block '${parentContentKey}'`
@@ -17374,12 +17426,12 @@ var CreateDocumentBlockTool = {
17374
17426
  }
17375
17427
  }
17376
17428
  const contentKey = _uuid.v4.call(void 0, );
17377
- const settingsKey = model.settings ? _uuid.v4.call(void 0, ) : null;
17429
+ const settingsKey = blockConfig.settingsElementTypeKey ? _uuid.v4.call(void 0, ) : null;
17378
17430
  const layoutEntry = buildLayoutEntry(kind, {
17379
17431
  contentKey,
17380
17432
  settingsKey,
17381
- columnSpan: _optionalChain([model, 'access', _52 => _52.grid, 'optionalAccess', _53 => _53.columnSpan]),
17382
- rowSpan: _optionalChain([model, 'access', _54 => _54.grid, 'optionalAccess', _55 => _55.rowSpan]),
17433
+ columnSpan: _optionalChain([model, 'access', _48 => _48.grid, 'optionalAccess', _49 => _49.columnSpan]),
17434
+ rowSpan: _optionalChain([model, 'access', _50 => _50.grid, 'optionalAccess', _51 => _51.rowSpan]),
17383
17435
  areaKeys: (_nullishCoalesce(blockConfig.areas, () => ( []))).map((a) => a.key)
17384
17436
  });
17385
17437
  const elementType = await client.getDocumentTypeById(model.contentTypeKey);
@@ -17735,11 +17787,12 @@ var DocumentCollection = {
17735
17787
  if (AuthorizationPolicies.TreeAccessDocuments(user)) {
17736
17788
  tools.push(get_document_by_id_default);
17737
17789
  tools.push(get_document_publish_default);
17790
+ tools.push(get_document_publish_with_descendants_result_default);
17738
17791
  tools.push(get_document_configuration_default);
17739
17792
  tools.push(get_document_type_schema_default);
17740
17793
  tools.push(copy_document_default);
17741
17794
  tools.push(create_document_default);
17742
- if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _56 => _56.umbracoVersion]))) {
17795
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _52 => _52.umbracoVersion]))) {
17743
17796
  tools.push(create_and_publish_document_default);
17744
17797
  }
17745
17798
  tools.push(post_document_public_access_default);
@@ -17756,13 +17809,13 @@ var DocumentCollection = {
17756
17809
  tools.push(publish_document_default);
17757
17810
  tools.push(publish_document_with_descendants_default);
17758
17811
  tools.push(sort_document_default);
17759
- if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _57 => _57.umbracoVersion]))) {
17812
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _53 => _53.umbracoVersion]))) {
17760
17813
  tools.push(sort_document_children_default);
17761
17814
  tools.push(sort_document_root_children_default);
17762
17815
  }
17763
17816
  tools.push(unpublish_document_default);
17764
17817
  tools.push(update_document_default);
17765
- if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _58 => _58.umbracoVersion]))) {
17818
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _54 => _54.umbracoVersion]))) {
17766
17819
  tools.push(update_and_publish_document_default);
17767
17820
  }
17768
17821
  tools.push(update_document_properties_default);
@@ -18098,7 +18151,7 @@ var CopyDocumentTypeTool = {
18098
18151
  validateStatus: () => true
18099
18152
  });
18100
18153
  if (response.status === 201) {
18101
- const location = _optionalChain([response, 'access', _59 => _59.headers, 'optionalAccess', _60 => _60.location]) || "";
18154
+ const location = _optionalChain([response, 'access', _55 => _55.headers, 'optionalAccess', _56 => _56.location]) || "";
18102
18155
  const newId = location.split("/").pop() || "";
18103
18156
  const output = { id: newId };
18104
18157
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -19829,14 +19882,14 @@ var create_language_default = _mcpserversdk.withStandardDecorators.call(void 0,
19829
19882
 
19830
19883
 
19831
19884
 
19832
- var inputSchema18 = {
19885
+ var inputSchema19 = {
19833
19886
  isoCode: putLanguageByIsoCodeParams.shape.isoCode,
19834
19887
  data: _zod.z.object(putLanguageByIsoCodeBody.shape)
19835
19888
  };
19836
19889
  var UpdateLanguageTool = {
19837
19890
  name: "update-language",
19838
19891
  description: "Updates an existing language by ISO code",
19839
- inputSchema: inputSchema18,
19892
+ inputSchema: inputSchema19,
19840
19893
  annotations: {
19841
19894
  idempotentHint: true
19842
19895
  },
@@ -20296,6 +20349,11 @@ async function validateFilePath(filePath, allowedPaths) {
20296
20349
 
20297
20350
 
20298
20351
 
20352
+
20353
+
20354
+
20355
+
20356
+
20299
20357
  var BASE64_MAX_BYTES = 10 * 1024;
20300
20358
  function getExtensionFromMimeType(mimeType) {
20301
20359
  if (!mimeType) return void 0;
@@ -20304,19 +20362,47 @@ function getExtensionFromMimeType(mimeType) {
20304
20362
  return extension ? `.${extension}` : void 0;
20305
20363
  }
20306
20364
  function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
20307
- const isSvg = _optionalChain([filePath, 'optionalAccess', _61 => _61.toLowerCase, 'call', _62 => _62(), 'access', _63 => _63.endsWith, 'call', _64 => _64(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _65 => _65.toLowerCase, 'call', _66 => _66(), 'access', _67 => _67.endsWith, 'call', _68 => _68(".svg")]) || fileName.toLowerCase().endsWith(".svg");
20308
- if (isSvg && mediaTypeName === _mcpserversdk.MEDIA_TYPE_IMAGE) {
20365
+ const isSvg = _optionalChain([filePath, 'optionalAccess', _57 => _57.toLowerCase, 'call', _58 => _58(), 'access', _59 => _59.endsWith, 'call', _60 => _60(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _61 => _61.toLowerCase, 'call', _62 => _62(), 'access', _63 => _63.endsWith, 'call', _64 => _64(".svg")]) || fileName.toLowerCase().endsWith(".svg");
20366
+ if (isSvg && mediaTypeName.toLowerCase() === _mcpserversdk.MEDIA_TYPE_IMAGE.toLowerCase()) {
20309
20367
  console.warn(`SVG detected - using ${_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS} media type instead of ${_mcpserversdk.MEDIA_TYPE_IMAGE}`);
20310
20368
  return _mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS;
20311
20369
  }
20312
20370
  return mediaTypeName;
20313
20371
  }
20372
+ var BUILT_IN_MEDIA_TYPES = {
20373
+ [_mcpserversdk.MEDIA_TYPE_IMAGE.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_IMAGE, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.Image, fallbackToFile: false },
20374
+ [_mcpserversdk.MEDIA_TYPE_FILE.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_FILE, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.File, fallbackToFile: false },
20375
+ [_mcpserversdk.MEDIA_TYPE_VIDEO.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_VIDEO, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.Video, fallbackToFile: true },
20376
+ [_mcpserversdk.MEDIA_TYPE_AUDIO.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_AUDIO, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.Audio, fallbackToFile: true },
20377
+ [_mcpserversdk.MEDIA_TYPE_ARTICLE.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_ARTICLE, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.Article, fallbackToFile: true },
20378
+ [_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS.toLowerCase()]: { name: _mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS, alias: _mcpserversdk.MEDIA_TYPE_ALIASES.VectorGraphics, fallbackToFile: true }
20379
+ };
20380
+ function getSubstitutedMediaType(requestedName, resolved) {
20381
+ return requestedName.toLowerCase() === resolved.name.toLowerCase() ? void 0 : requestedName;
20382
+ }
20383
+ function getMediaTypeWarning(result) {
20384
+ return result.substitutedFor ? `This site has no '${result.substitutedFor}' media type, so '${result.mediaTypeName}' was used instead.` : void 0;
20385
+ }
20386
+ function formatMediaCreatedMessage(result) {
20387
+ return result.substitutedFor ? `Media "${result.name}" created as '${result.mediaTypeName}' \u2014 this site has no '${result.substitutedFor}' media type.` : `Media "${result.name}" created successfully`;
20388
+ }
20314
20389
  async function fetchMediaTypeId(client, mediaTypeName) {
20315
- const standardTypeKey = Object.keys(_mcpserversdk.STANDARD_MEDIA_TYPES).find(
20316
- (key) => key.toLowerCase() === mediaTypeName.toLowerCase()
20317
- );
20318
- if (standardTypeKey) {
20319
- return _mcpserversdk.STANDARD_MEDIA_TYPES[standardTypeKey];
20390
+ const builtIn = BUILT_IN_MEDIA_TYPES[mediaTypeName.toLowerCase()];
20391
+ if (builtIn) {
20392
+ const id = await _mcpserversdk.resolveMediaTypeId.call(void 0, builtIn.alias);
20393
+ if (id) {
20394
+ return { id, name: builtIn.name };
20395
+ }
20396
+ if (builtIn.fallbackToFile) {
20397
+ const fileId = await _mcpserversdk.resolveMediaTypeId.call(void 0, _mcpserversdk.MEDIA_TYPE_ALIASES.File);
20398
+ if (fileId) {
20399
+ console.warn(`Media type '${builtIn.name}' not found on this site - using ${_mcpserversdk.MEDIA_TYPE_FILE} instead`);
20400
+ return { id: fileId, name: _mcpserversdk.MEDIA_TYPE_FILE };
20401
+ }
20402
+ }
20403
+ throw new Error(
20404
+ `Media type '${builtIn.name}' (alias '${builtIn.alias}') not found on this site` + (builtIn.fallbackToFile ? `, and no '${_mcpserversdk.MEDIA_TYPE_FILE}' media type to fall back to` : "")
20405
+ );
20320
20406
  }
20321
20407
  const response = await client.getItemMediaTypeSearch({ query: mediaTypeName });
20322
20408
  const mediaType = response.items.find(
@@ -20328,7 +20414,7 @@ async function fetchMediaTypeId(client, mediaTypeName) {
20328
20414
  `Media type '${mediaTypeName}' not found. Available types: ${availableTypes || "None found"}`
20329
20415
  );
20330
20416
  }
20331
- return mediaType.id;
20417
+ return { id: mediaType.id, name: mediaType.name };
20332
20418
  }
20333
20419
  function getEditorAlias(mediaTypeName) {
20334
20420
  return mediaTypeName === _mcpserversdk.MEDIA_TYPE_IMAGE ? "Umbraco.ImageCropper" : "Umbraco.UploadField";
@@ -20442,7 +20528,7 @@ async function uploadMediaFile(client, params) {
20442
20528
  params.name,
20443
20529
  params.mediaTypeName
20444
20530
  );
20445
- const mediaTypeId = await fetchMediaTypeId(client, validatedMediaTypeName);
20531
+ const mediaType = await fetchMediaTypeId(client, validatedMediaTypeName);
20446
20532
  const { data, filename } = await createFilePayload(
20447
20533
  params.sourceType,
20448
20534
  params.filePath,
@@ -20458,14 +20544,14 @@ async function uploadMediaFile(client, params) {
20458
20544
  });
20459
20545
  } catch (error) {
20460
20546
  const err = error;
20461
- const errorData = _optionalChain([err, 'access', _69 => _69.response, 'optionalAccess', _70 => _70.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
20462
- throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _71 => _71.response, 'optionalAccess', _72 => _72.status]) || "Unknown error"} - ${errorData}`);
20547
+ const errorData = _optionalChain([err, 'access', _65 => _65.response, 'optionalAccess', _66 => _66.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
20548
+ throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _67 => _67.response, 'optionalAccess', _68 => _68.status]) || "Unknown error"} - ${errorData}`);
20463
20549
  }
20464
- const valueStructure = buildValueStructure(validatedMediaTypeName, params.temporaryFileId);
20550
+ const valueStructure = buildValueStructure(mediaType.name, params.temporaryFileId);
20465
20551
  let response;
20466
20552
  try {
20467
20553
  response = await client.postMedia({
20468
- mediaType: { id: mediaTypeId },
20554
+ mediaType: { id: mediaType.id },
20469
20555
  variants: [
20470
20556
  {
20471
20557
  culture: null,
@@ -20479,12 +20565,12 @@ async function uploadMediaFile(client, params) {
20479
20565
  }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE);
20480
20566
  } catch (error) {
20481
20567
  const err = error;
20482
- throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _73 => _73.response, 'optionalAccess', _74 => _74.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _75 => _75.response, 'optionalAccess', _76 => _76.data])) || err.message}`);
20568
+ throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _69 => _69.response, 'optionalAccess', _70 => _70.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _71 => _71.response, 'optionalAccess', _72 => _72.data])) || err.message}`);
20483
20569
  }
20484
20570
  if (response.status < 200 || response.status >= 300) {
20485
20571
  throw new Error(`Request failed with status code ${response.status}`);
20486
20572
  }
20487
- const locationHeader = _optionalChain([response, 'access', _77 => _77.headers, 'optionalAccess', _78 => _78.location]) || _optionalChain([response, 'access', _79 => _79.headers, 'optionalAccess', _80 => _80.Location]);
20573
+ const locationHeader = _optionalChain([response, 'access', _73 => _73.headers, 'optionalAccess', _74 => _74.location]) || _optionalChain([response, 'access', _75 => _75.headers, 'optionalAccess', _76 => _76.Location]);
20488
20574
  if (!locationHeader) {
20489
20575
  throw new Error("No Location header in response - cannot determine created media ID");
20490
20576
  }
@@ -20493,7 +20579,12 @@ async function uploadMediaFile(client, params) {
20493
20579
  throw new Error(`Could not extract ID from Location header: ${locationHeader}`);
20494
20580
  }
20495
20581
  const mediaId = idMatch[1];
20496
- return { name: params.name, id: mediaId };
20582
+ return {
20583
+ name: params.name,
20584
+ id: mediaId,
20585
+ mediaTypeName: mediaType.name,
20586
+ substitutedFor: getSubstitutedMediaType(validatedMediaTypeName, mediaType)
20587
+ };
20497
20588
  }
20498
20589
 
20499
20590
  // src/umbraco-api/tools/media/post/helpers/source-type-helpers.ts
@@ -20516,7 +20607,7 @@ function buildSourceTypeSection(allowFilePath, otherSources) {
20516
20607
 
20517
20608
 
20518
20609
  function isStreamingUploadAvailable() {
20519
- return _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _81 => _81.umbracoAuth]) !== void 0;
20610
+ return _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _77 => _77.umbracoAuth]) !== void 0;
20520
20611
  }
20521
20612
  async function resolveAuth() {
20522
20613
  const { accessToken, baseUrl } = await _mcpserversdk.getSessionUmbracoAuth.call(void 0, );
@@ -20524,7 +20615,7 @@ async function resolveAuth() {
20524
20615
  }
20525
20616
  function ensureExtension(name, contentType, urlPath) {
20526
20617
  if (name.includes(".")) return name;
20527
- const fromUrl = _optionalChain([urlPath, 'access', _82 => _82.match, 'call', _83 => _83(/\.([a-z0-9]{1,8})$/i), 'optionalAccess', _84 => _84[0]]);
20618
+ const fromUrl = _optionalChain([urlPath, 'access', _78 => _78.match, 'call', _79 => _79(/\.([a-z0-9]{1,8})$/i), 'optionalAccess', _80 => _80[0]]);
20528
20619
  if (fromUrl) return `${name}${fromUrl}`;
20529
20620
  if (contentType) {
20530
20621
  const subtype = contentType.split(";")[0].split("/")[1];
@@ -20542,7 +20633,7 @@ async function streamingUploadFromUrl(params) {
20542
20633
  params.name,
20543
20634
  params.mediaTypeName
20544
20635
  );
20545
- const [mediaTypeId, auth] = await Promise.all([
20636
+ const [mediaType, auth] = await Promise.all([
20546
20637
  fetchMediaTypeId(client, validatedMediaTypeName),
20547
20638
  resolveAuth()
20548
20639
  ]);
@@ -20617,10 +20708,10 @@ Content-Type: ${sourceContentType}\r
20617
20708
  `Umbraco temporary-file POST failed: HTTP ${tempResp.status} ${tempResp.statusText} - ${errBody}`
20618
20709
  );
20619
20710
  }
20620
- const valueStructure = buildValueStructure(validatedMediaTypeName, temporaryFileId);
20711
+ const valueStructure = buildValueStructure(mediaType.name, temporaryFileId);
20621
20712
  const response = await client.postMedia(
20622
20713
  {
20623
- mediaType: { id: mediaTypeId },
20714
+ mediaType: { id: mediaType.id },
20624
20715
  variants: [{ culture: null, segment: null, name: params.name }],
20625
20716
  values: [valueStructure],
20626
20717
  parent: params.parentId ? { id: params.parentId } : null
@@ -20630,25 +20721,32 @@ Content-Type: ${sourceContentType}\r
20630
20721
  if (response.status < 200 || response.status >= 300) {
20631
20722
  throw new Error(`postMedia failed with status ${response.status}`);
20632
20723
  }
20633
- const locationHeader = _nullishCoalesce(_optionalChain([response, 'access', _85 => _85.headers, 'optionalAccess', _86 => _86.location]), () => ( _optionalChain([response, 'access', _87 => _87.headers, 'optionalAccess', _88 => _88.Location])));
20634
- const idMatch = _optionalChain([locationHeader, 'optionalAccess', _89 => _89.match, 'call', _90 => _90(/\/([a-f0-9-]{36})$/i)]);
20724
+ const locationHeader = _nullishCoalesce(_optionalChain([response, 'access', _81 => _81.headers, 'optionalAccess', _82 => _82.location]), () => ( _optionalChain([response, 'access', _83 => _83.headers, 'optionalAccess', _84 => _84.Location])));
20725
+ const idMatch = _optionalChain([locationHeader, 'optionalAccess', _85 => _85.match, 'call', _86 => _86(/\/([a-f0-9-]{36})$/i)]);
20635
20726
  if (!idMatch) {
20636
20727
  throw new Error(
20637
20728
  `Could not extract media id from Location header: ${_nullishCoalesce(locationHeader, () => ( "(missing)"))}`
20638
20729
  );
20639
20730
  }
20640
- return { name: params.name, id: idMatch[1] };
20731
+ return {
20732
+ name: params.name,
20733
+ id: idMatch[1],
20734
+ mediaTypeName: mediaType.name,
20735
+ substitutedFor: getSubstitutedMediaType(validatedMediaTypeName, mediaType)
20736
+ };
20641
20737
  } finally {
20642
20738
  clearTimeout(overallTimeout);
20643
20739
  }
20644
20740
  }
20645
20741
  async function streamingUploadToToolResult(params) {
20646
20742
  try {
20647
- const { name, id } = await streamingUploadFromUrl(params);
20743
+ const result = await streamingUploadFromUrl(params);
20744
+ const warning = getMediaTypeWarning(result);
20648
20745
  return _mcpserversdk.createToolResult.call(void 0, {
20649
- message: `Media "${name}" created successfully`,
20650
- name,
20651
- id
20746
+ message: formatMediaCreatedMessage(result),
20747
+ name: result.name,
20748
+ id: result.id,
20749
+ ...warning ? { warning } : {}
20652
20750
  });
20653
20751
  } catch (error) {
20654
20752
  return _mcpserversdk.createToolResultError.call(void 0, {
@@ -20678,7 +20776,9 @@ var fileObjectSchema = _zod.z.object({
20678
20776
  var createMediaOutputSchema = _zod.z.object({
20679
20777
  message: _zod.z.string(),
20680
20778
  name: _zod.z.string(),
20681
- id: _zod.z.string().guid()
20779
+ id: _zod.z.string().guid(),
20780
+ /** Set only when the site lacks the requested media type and another was used (e.g. Video → File). */
20781
+ warning: _zod.z.string().optional()
20682
20782
  });
20683
20783
  function createCreateMediaTool(options) {
20684
20784
  const sourceTypeValues = options.allowFilePath ? ["filePath", "url", "file", "base64"] : ["url", "file", "base64"];
@@ -20736,7 +20836,7 @@ ${filePathSection}
20736
20836
  let effectiveSourceType;
20737
20837
  let effectiveFileUrl = model.fileUrl;
20738
20838
  if (model.sourceType === "file") {
20739
- if (!_optionalChain([model, 'access', _91 => _91.file, 'optionalAccess', _92 => _92.download_url])) {
20839
+ if (!_optionalChain([model, 'access', _87 => _87.file, 'optionalAccess', _88 => _88.download_url])) {
20740
20840
  return _mcpserversdk.createToolResultError.call(void 0, {
20741
20841
  detail: "Error creating media: sourceType is 'file' but no file object was provided. ChatGPT's connector should inject this automatically when a file is attached \u2014 if it didn't, the user has nothing attached or your client doesn't support openai/fileParams."
20742
20842
  });
@@ -20762,7 +20862,7 @@ ${filePathSection}
20762
20862
  try {
20763
20863
  const client = UmbracoManagementClient3.getClient();
20764
20864
  const temporaryFileId = _uuid.v4.call(void 0, );
20765
- const { name: actualName, id } = await uploadMediaFile(client, {
20865
+ const result = await uploadMediaFile(client, {
20766
20866
  sourceType: effectiveSourceType,
20767
20867
  name: model.name,
20768
20868
  mediaTypeName: model.mediaTypeName,
@@ -20772,10 +20872,12 @@ ${filePathSection}
20772
20872
  parentId: model.parentId,
20773
20873
  temporaryFileId
20774
20874
  });
20875
+ const warning = getMediaTypeWarning(result);
20775
20876
  return _mcpserversdk.createToolResult.call(void 0, {
20776
- message: `Media "${actualName}" created successfully`,
20777
- name: actualName,
20778
- id
20877
+ message: formatMediaCreatedMessage(result),
20878
+ name: result.name,
20879
+ id: result.id,
20880
+ ...warning ? { warning } : {}
20779
20881
  });
20780
20882
  } catch (error) {
20781
20883
  return _mcpserversdk.createToolResultError.call(void 0, {
@@ -20808,9 +20910,15 @@ var createMediaMultipleOutputSchema = _zod.z.object({
20808
20910
  success: _zod.z.boolean(),
20809
20911
  name: _zod.z.string(),
20810
20912
  id: _zod.z.string().guid().optional(),
20811
- error: _zod.z.string().optional()
20913
+ error: _zod.z.string().optional(),
20914
+ /** Set only when the site lacks the requested media type and another was used (e.g. Video → File). */
20915
+ warning: _zod.z.string().optional()
20812
20916
  }))
20813
20917
  });
20918
+ function toSuccessResult(upload) {
20919
+ const warning = getMediaTypeWarning(upload);
20920
+ return { success: true, name: upload.name, id: upload.id, ...warning ? { warning } : {} };
20921
+ }
20814
20922
  var fileObjectSchema2 = _zod.z.object({
20815
20923
  download_url: _zod.z.string().describe("Temporary URL the host provides to fetch the file bytes"),
20816
20924
  file_id: _zod.z.string().describe("Persistent file identifier from the host"),
@@ -20885,7 +20993,7 @@ ${filePathSection}
20885
20993
  let effectiveSourceType;
20886
20994
  let effectiveFileUrl = file.fileUrl;
20887
20995
  if (model.sourceType === "file") {
20888
- if (!_optionalChain([file, 'access', _93 => _93.file, 'optionalAccess', _94 => _94.download_url])) {
20996
+ if (!_optionalChain([file, 'access', _89 => _89.file, 'optionalAccess', _90 => _90.download_url])) {
20889
20997
  return {
20890
20998
  success: false,
20891
20999
  name: file.name,
@@ -20905,16 +21013,16 @@ ${filePathSection}
20905
21013
  error: "fileUrl is required when sourceType is 'url'."
20906
21014
  };
20907
21015
  }
20908
- const { name: actualName2, id: mediaId2 } = await streamingUploadFromUrl({
21016
+ const upload2 = await streamingUploadFromUrl({
20909
21017
  sourceUrl: effectiveFileUrl,
20910
21018
  name: file.name,
20911
21019
  mediaTypeName,
20912
21020
  parentId: model.parentId
20913
21021
  });
20914
- return { success: true, name: actualName2, id: mediaId2 };
21022
+ return toSuccessResult(upload2);
20915
21023
  }
20916
21024
  const temporaryFileId = _uuid.v4.call(void 0, );
20917
- const { name: actualName, id: mediaId } = await uploadMediaFile(client, {
21025
+ const upload = await uploadMediaFile(client, {
20918
21026
  sourceType: effectiveSourceType,
20919
21027
  name: file.name,
20920
21028
  mediaTypeName,
@@ -20924,7 +21032,7 @@ ${filePathSection}
20924
21032
  parentId: model.parentId,
20925
21033
  temporaryFileId
20926
21034
  });
20927
- return { success: true, name: actualName, id: mediaId };
21035
+ return toSuccessResult(upload);
20928
21036
  } catch (error) {
20929
21037
  return { success: false, name: file.name, error: error.message };
20930
21038
  }
@@ -20951,6 +21059,7 @@ var create_media_multiple_default = createCreateMediaMultipleTool({ allowFilePat
20951
21059
 
20952
21060
 
20953
21061
 
21062
+
20954
21063
  var createMediaFolderSchema = _zod.z.object({
20955
21064
  name: _zod.z.string().describe("The name of the folder"),
20956
21065
  parentId: _zod.z.string().uuid().optional().describe("Parent folder ID. If not provided, the folder will be created at the root of the media library.")
@@ -20969,6 +21078,12 @@ var CreateMediaFolderTool = {
20969
21078
  handler: (async (model) => {
20970
21079
  try {
20971
21080
  const client = UmbracoManagementClient3.getClient();
21081
+ const folderMediaTypeId = await _mcpserversdk.resolveMediaTypeId.call(void 0, _mcpserversdk.MEDIA_TYPE_ALIASES.Folder);
21082
+ if (!folderMediaTypeId) {
21083
+ return _mcpserversdk.createToolResultError.call(void 0, {
21084
+ detail: `Error creating media folder: no media type with alias '${_mcpserversdk.MEDIA_TYPE_ALIASES.Folder}' was found on this Umbraco site.`
21085
+ });
21086
+ }
20972
21087
  const response = await client.postMedia({
20973
21088
  values: [],
20974
21089
  variants: [
@@ -20979,12 +21094,12 @@ var CreateMediaFolderTool = {
20979
21094
  }
20980
21095
  ],
20981
21096
  parent: model.parentId ? { id: model.parentId } : null,
20982
- mediaType: { id: _mcpserversdk.FOLDER_MEDIA_TYPE_ID }
21097
+ mediaType: { id: folderMediaTypeId }
20983
21098
  }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE);
20984
21099
  if (response.status < 200 || response.status >= 300) {
20985
21100
  throw new Error(`Request failed with status code ${response.status}`);
20986
21101
  }
20987
- const locationHeader = _optionalChain([response, 'access', _95 => _95.headers, 'optionalAccess', _96 => _96.location]) || _optionalChain([response, 'access', _97 => _97.headers, 'optionalAccess', _98 => _98.Location]);
21102
+ const locationHeader = _optionalChain([response, 'access', _91 => _91.headers, 'optionalAccess', _92 => _92.location]) || _optionalChain([response, 'access', _93 => _93.headers, 'optionalAccess', _94 => _94.Location]);
20988
21103
  if (!locationHeader) {
20989
21104
  throw new Error("No Location header in response - cannot determine created folder ID");
20990
21105
  }
@@ -21058,7 +21173,7 @@ var get_media_by_id_default = _mcpserversdk.withStandardDecorators.call(void 0,
21058
21173
 
21059
21174
 
21060
21175
 
21061
- var inputSchema19 = {
21176
+ var inputSchema20 = {
21062
21177
  id: putMediaByIdParams.shape.id,
21063
21178
  data: _zod.z.object(putMediaByIdBody.shape)
21064
21179
  };
@@ -21068,7 +21183,7 @@ var UpdateMediaTool = {
21068
21183
  Always read the current media value first and only update the required values.
21069
21184
  Don't miss any properties from the original media that you are updating.
21070
21185
  This cannot be used for moving media to a new folder. Use the move endpoint to do that.`,
21071
- inputSchema: inputSchema19,
21186
+ inputSchema: inputSchema20,
21072
21187
  annotations: {
21073
21188
  idempotentHint: true
21074
21189
  },
@@ -21154,14 +21269,14 @@ var validate_media_default = _mcpserversdk.withStandardDecorators.call(void 0, V
21154
21269
 
21155
21270
 
21156
21271
 
21157
- var inputSchema20 = {
21272
+ var inputSchema21 = {
21158
21273
  id: putMediaByIdValidateParams.shape.id,
21159
21274
  data: _zod.z.object(putMediaByIdValidateBody.shape)
21160
21275
  };
21161
21276
  var ValidateMediaUpdateTool = {
21162
21277
  name: "validate-media-update",
21163
21278
  description: "Validates media data before updating an existing media item by Id",
21164
- inputSchema: inputSchema20,
21279
+ inputSchema: inputSchema21,
21165
21280
  annotations: { readOnlyHint: true },
21166
21281
  slices: ["validate"],
21167
21282
  handler: (async (model) => {
@@ -21201,7 +21316,7 @@ var sort_media_default = _mcpserversdk.withStandardDecorators.call(void 0, SortM
21201
21316
 
21202
21317
 
21203
21318
 
21204
- var inputSchema21 = {
21319
+ var inputSchema22 = {
21205
21320
  id: putMediaByIdSortChildrenParams.shape.id,
21206
21321
  data: _zod.z.object(putMediaByIdSortChildrenBody.shape)
21207
21322
  };
@@ -21210,7 +21325,7 @@ var SortMediaChildrenTool = {
21210
21325
  description: `Sorts the children of the media item identified by Id by a system field (Name, CreateDate or UpdateDate) in the given direction (Ascending or Descending).
21211
21326
 
21212
21327
  This is DIFFERENT from sort-media: sort-media reorders children according to an explicit list of ids and sort orders you provide, whereas sort-media-children sorts every child of {id} automatically by the chosen field and direction - no explicit ordering is required.`,
21213
- inputSchema: inputSchema21,
21328
+ inputSchema: inputSchema22,
21214
21329
  annotations: {},
21215
21330
  slices: ["sort"],
21216
21331
  handler: (async (model) => {
@@ -21275,14 +21390,14 @@ var get_media_by_id_array_default = _mcpserversdk.withStandardDecorators.call(vo
21275
21390
 
21276
21391
 
21277
21392
 
21278
- var inputSchema22 = {
21393
+ var inputSchema23 = {
21279
21394
  id: putMediaByIdMoveParams.shape.id,
21280
21395
  data: _zod.z.object(putMediaByIdMoveBody.shape)
21281
21396
  };
21282
21397
  var MoveMediaTool = {
21283
21398
  name: "move-media",
21284
21399
  description: "Move a media item to a new location",
21285
- inputSchema: inputSchema22,
21400
+ inputSchema: inputSchema23,
21286
21401
  annotations: {
21287
21402
  idempotentHint: true
21288
21403
  },
@@ -21418,14 +21533,14 @@ var get_root_default6 = _mcpserversdk.withStandardDecorators.call(void 0, GetMed
21418
21533
 
21419
21534
 
21420
21535
 
21421
- var inputSchema23 = {
21536
+ var inputSchema24 = {
21422
21537
  id: getMediaByIdAuditLogParams.shape.id,
21423
21538
  ...getMediaByIdAuditLogQueryParams.shape
21424
21539
  };
21425
21540
  var GetMediaAuditLogTool = {
21426
21541
  name: "get-media-audit-log",
21427
21542
  description: "Fetches the audit log for a media item by Id.",
21428
- inputSchema: inputSchema23,
21543
+ inputSchema: inputSchema24,
21429
21544
  outputSchema: getMediaByIdAuditLogResponse.shape,
21430
21545
  annotations: { readOnlyHint: true },
21431
21546
  slices: ["audit"],
@@ -21640,7 +21755,7 @@ var get_media_are_referenced_default = _mcpserversdk.withStandardDecorators.call
21640
21755
 
21641
21756
 
21642
21757
 
21643
- var inputSchema24 = _zod.z.object({
21758
+ var inputSchema25 = _zod.z.object({
21644
21759
  ...getMediaByIdReferencedByParams.shape,
21645
21760
  ...getMediaByIdReferencedByQueryParams.shape
21646
21761
  }).shape;
@@ -21648,7 +21763,7 @@ var GetMediaByIdReferencedByTool = {
21648
21763
  name: "get-media-by-id-referenced-by",
21649
21764
  description: `Get items that reference a specific media item
21650
21765
  Use this to find all content, documents, or other items that are currently referencing a specific media item.`,
21651
- inputSchema: inputSchema24,
21766
+ inputSchema: inputSchema25,
21652
21767
  outputSchema: getMediaByIdReferencedByResponse.shape,
21653
21768
  annotations: { readOnlyHint: true },
21654
21769
  slices: ["references"],
@@ -21667,7 +21782,7 @@ var get_media_by_id_referenced_by_default = _mcpserversdk.withStandardDecorators
21667
21782
 
21668
21783
 
21669
21784
 
21670
- var inputSchema25 = _zod.z.object({
21785
+ var inputSchema26 = _zod.z.object({
21671
21786
  ...getMediaByIdReferencedDescendantsParams.shape,
21672
21787
  ...getMediaByIdReferencedDescendantsQueryParams.shape
21673
21788
  }).shape;
@@ -21680,7 +21795,7 @@ var GetMediaByIdReferencedDescendantsTool = {
21680
21795
  \u2022 Impact analysis: Before deleting a media folder, see what content would be affected
21681
21796
  \u2022 Dependency tracking: Find all content using media from a specific folder hierarchy
21682
21797
  \u2022 Content auditing: Identify which descendant media items are actually being used`,
21683
- inputSchema: inputSchema25,
21798
+ inputSchema: inputSchema26,
21684
21799
  outputSchema: getMediaByIdReferencedDescendantsResponse.shape,
21685
21800
  annotations: { readOnlyHint: true },
21686
21801
  slices: ["references"],
@@ -21819,7 +21934,7 @@ var MediaCollection = {
21819
21934
  tools.push(validate_media_default);
21820
21935
  tools.push(validate_media_default2);
21821
21936
  tools.push(sort_media_default);
21822
- if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _99 => _99.umbracoVersion]))) {
21937
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _95 => _95.umbracoVersion]))) {
21823
21938
  tools.push(sort_media_children_default);
21824
21939
  tools.push(sort_media_root_children_default);
21825
21940
  }
@@ -21840,7 +21955,7 @@ var MediaCollection = {
21840
21955
  tools.push(get_collection_media_default);
21841
21956
  tools.push(get_recycle_bin_media_referenced_by_default);
21842
21957
  tools.push(get_recycle_bin_media_original_parent_default);
21843
- if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _100 => _100.umbracoVersion]))) {
21958
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _96 => _96.umbracoVersion]))) {
21844
21959
  tools.push(get_media_type_schema_default);
21845
21960
  }
21846
21961
  }
@@ -21898,7 +22013,7 @@ var get_media_type_by_id_default = _mcpserversdk.withStandardDecorators.call(voi
21898
22013
 
21899
22014
 
21900
22015
 
21901
- var inputSchema26 = _zod.z.object({
22016
+ var inputSchema27 = _zod.z.object({
21902
22017
  ids: _zod.z.array(_zod.z.string())
21903
22018
  });
21904
22019
  var outputSchema35 = _zod.z.object({
@@ -21907,7 +22022,7 @@ var outputSchema35 = _zod.z.object({
21907
22022
  var GetMediaTypeByIdsTool = {
21908
22023
  name: "get-media-type-by-ids",
21909
22024
  description: "Gets media types by ids",
21910
- inputSchema: inputSchema26.shape,
22025
+ inputSchema: inputSchema27.shape,
21911
22026
  outputSchema: outputSchema35.shape,
21912
22027
  annotations: { readOnlyHint: true },
21913
22028
  slices: ["list"],
@@ -22020,13 +22135,13 @@ var get_media_type_allowed_at_root_default = _mcpserversdk.withStandardDecorator
22020
22135
 
22021
22136
 
22022
22137
 
22023
- var inputSchema27 = getMediaTypeByIdAllowedChildrenParams.merge(
22138
+ var inputSchema28 = getMediaTypeByIdAllowedChildrenParams.merge(
22024
22139
  getMediaTypeByIdAllowedChildrenQueryParams
22025
22140
  );
22026
22141
  var GetMediaTypeAllowedChildrenTool = {
22027
22142
  name: "get-media-type-allowed-children",
22028
22143
  description: "Gets the media types that are allowed as children of a media type",
22029
- inputSchema: inputSchema27.shape,
22144
+ inputSchema: inputSchema28.shape,
22030
22145
  outputSchema: getMediaTypeByIdAllowedChildrenResponse.shape,
22031
22146
  annotations: { readOnlyHint: true },
22032
22147
  slices: ["configuration"],
@@ -22274,7 +22389,7 @@ var CreateMediaTypeFolderTool = {
22274
22389
  validateStatus: () => true
22275
22390
  });
22276
22391
  if (response.status === 201) {
22277
- const locationHeader = _optionalChain([response, 'access', _101 => _101.headers, 'optionalAccess', _102 => _102["location"]]) || _optionalChain([response, 'access', _103 => _103.headers, 'optionalAccess', _104 => _104["Location"]]);
22392
+ const locationHeader = _optionalChain([response, 'access', _97 => _97.headers, 'optionalAccess', _98 => _98["location"]]) || _optionalChain([response, 'access', _99 => _99.headers, 'optionalAccess', _100 => _100["Location"]]);
22278
22393
  let createdId = model.id || "";
22279
22394
  if (locationHeader) {
22280
22395
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22326,14 +22441,14 @@ var delete_folder_default4 = _mcpserversdk.withStandardDecorators.call(void 0, D
22326
22441
 
22327
22442
 
22328
22443
 
22329
- var inputSchema28 = _zod.z.object({
22444
+ var inputSchema29 = _zod.z.object({
22330
22445
  id: putMediaTypeFolderByIdParams.shape.id,
22331
22446
  data: _zod.z.object(putMediaTypeFolderByIdBody.shape)
22332
22447
  });
22333
22448
  var UpdateMediaTypeFolderTool = {
22334
22449
  name: "update-media-type-folder",
22335
22450
  description: "Updates a media type folder by Id",
22336
- inputSchema: inputSchema28.shape,
22451
+ inputSchema: inputSchema29.shape,
22337
22452
  annotations: { idempotentHint: true },
22338
22453
  slices: ["update", "folders"],
22339
22454
  handler: (async (model) => {
@@ -22408,7 +22523,7 @@ var CreateMediaTypeTool = {
22408
22523
  validateStatus: () => true
22409
22524
  });
22410
22525
  if (response.status === 201) {
22411
- const locationHeader = _optionalChain([response, 'access', _105 => _105.headers, 'optionalAccess', _106 => _106["location"]]) || _optionalChain([response, 'access', _107 => _107.headers, 'optionalAccess', _108 => _108["Location"]]);
22526
+ const locationHeader = _optionalChain([response, 'access', _101 => _101.headers, 'optionalAccess', _102 => _102["location"]]) || _optionalChain([response, 'access', _103 => _103.headers, 'optionalAccess', _104 => _104["Location"]]);
22412
22527
  let createdId = model.id || "";
22413
22528
  if (locationHeader) {
22414
22529
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22438,7 +22553,7 @@ var create_media_type_default = _mcpserversdk.withStandardDecorators.call(void 0
22438
22553
 
22439
22554
 
22440
22555
 
22441
- var inputSchema29 = _zod.z.object({
22556
+ var inputSchema30 = _zod.z.object({
22442
22557
  id: _zod.z.string().uuid(),
22443
22558
  data: _zod.z.object(postMediaTypeByIdCopyBody.shape)
22444
22559
  });
@@ -22449,7 +22564,7 @@ var copyMediaTypeOutputSchema = _zod.z.object({
22449
22564
  var CopyMediaTypeTool = {
22450
22565
  name: "copy-media-type",
22451
22566
  description: "Copy a media type to a new location",
22452
- inputSchema: inputSchema29.shape,
22567
+ inputSchema: inputSchema30.shape,
22453
22568
  outputSchema: copyMediaTypeOutputSchema.shape,
22454
22569
  slices: ["copy"],
22455
22570
  handler: (async (model) => {
@@ -22459,7 +22574,7 @@ var CopyMediaTypeTool = {
22459
22574
  validateStatus: () => true
22460
22575
  });
22461
22576
  if (response.status === 201) {
22462
- const locationHeader = _optionalChain([response, 'access', _109 => _109.headers, 'optionalAccess', _110 => _110["location"]]) || _optionalChain([response, 'access', _111 => _111.headers, 'optionalAccess', _112 => _112["Location"]]);
22577
+ const locationHeader = _optionalChain([response, 'access', _105 => _105.headers, 'optionalAccess', _106 => _106["location"]]) || _optionalChain([response, 'access', _107 => _107.headers, 'optionalAccess', _108 => _108["Location"]]);
22463
22578
  let createdId = "";
22464
22579
  if (locationHeader) {
22465
22580
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22514,14 +22629,14 @@ var get_media_type_available_compositions_default = _mcpserversdk.withStandardDe
22514
22629
 
22515
22630
 
22516
22631
 
22517
- var inputSchema30 = _zod.z.object({
22632
+ var inputSchema31 = _zod.z.object({
22518
22633
  id: putMediaTypeByIdParams.shape.id,
22519
22634
  data: _zod.z.object(putMediaTypeByIdBody.shape)
22520
22635
  });
22521
22636
  var UpdateMediaTypeTool = {
22522
22637
  name: "update-media-type",
22523
22638
  description: "Updates a media type by Id",
22524
- inputSchema: inputSchema30.shape,
22639
+ inputSchema: inputSchema31.shape,
22525
22640
  annotations: { idempotentHint: true },
22526
22641
  slices: ["update"],
22527
22642
  handler: (async (model) => {
@@ -22539,14 +22654,14 @@ var update_media_type_default = _mcpserversdk.withStandardDecorators.call(void 0
22539
22654
 
22540
22655
 
22541
22656
 
22542
- var inputSchema31 = _zod.z.object({
22657
+ var inputSchema32 = _zod.z.object({
22543
22658
  id: _zod.z.string().uuid(),
22544
22659
  data: _zod.z.object(putMediaTypeByIdMoveBody.shape)
22545
22660
  });
22546
22661
  var MoveMediaTypeTool = {
22547
22662
  name: "move-media-type",
22548
22663
  description: "Move a media type to a new location",
22549
- inputSchema: inputSchema31.shape,
22664
+ inputSchema: inputSchema32.shape,
22550
22665
  annotations: { idempotentHint: true },
22551
22666
  slices: ["move"],
22552
22667
  handler: (async (model) => {
@@ -22669,7 +22784,7 @@ var CreateMemberTool = {
22669
22784
  validateStatus: () => true
22670
22785
  });
22671
22786
  if (response.status === 201) {
22672
- const locationHeader = _optionalChain([response, 'access', _113 => _113.headers, 'optionalAccess', _114 => _114["location"]]) || _optionalChain([response, 'access', _115 => _115.headers, 'optionalAccess', _116 => _116["Location"]]);
22787
+ const locationHeader = _optionalChain([response, 'access', _109 => _109.headers, 'optionalAccess', _110 => _110["location"]]) || _optionalChain([response, 'access', _111 => _111.headers, 'optionalAccess', _112 => _112["Location"]]);
22673
22788
  let createdId = model.id || "";
22674
22789
  if (locationHeader) {
22675
22790
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22742,14 +22857,14 @@ var delete_member_default = _mcpserversdk.withStandardDecorators.call(void 0, De
22742
22857
 
22743
22858
 
22744
22859
 
22745
- var inputSchema32 = _zod.z.object({
22860
+ var inputSchema33 = _zod.z.object({
22746
22861
  id: putMemberByIdParams.shape.id,
22747
22862
  data: _zod.z.object(putMemberByIdBody.shape)
22748
22863
  });
22749
22864
  var UpdateMemberTool = {
22750
22865
  name: "update-member",
22751
22866
  description: "Updates a member by Id",
22752
- inputSchema: inputSchema32.shape,
22867
+ inputSchema: inputSchema33.shape,
22753
22868
  annotations: { idempotentHint: true },
22754
22869
  slices: ["update"],
22755
22870
  handler: (async (model) => {
@@ -22767,7 +22882,7 @@ var update_member_default = _mcpserversdk.withStandardDecorators.call(void 0, Up
22767
22882
 
22768
22883
 
22769
22884
 
22770
- var inputSchema33 = _zod.z.object({
22885
+ var inputSchema34 = _zod.z.object({
22771
22886
  id: putMemberByIdValidateParams.shape.id,
22772
22887
  data: _zod.z.object(putMemberByIdValidateBody.shape)
22773
22888
  });
@@ -22775,7 +22890,7 @@ var ValidateMemberUpdateTool = {
22775
22890
  name: "validate-member-update",
22776
22891
  description: `Validates member data before updating using the Umbraco API.
22777
22892
  Use this endpoint to validate member data structure, properties, and business rules before attempting to update an existing member.`,
22778
- inputSchema: inputSchema33.shape,
22893
+ inputSchema: inputSchema34.shape,
22779
22894
  annotations: { readOnlyHint: true },
22780
22895
  slices: ["validate"],
22781
22896
  handler: (async (model) => {
@@ -22835,12 +22950,12 @@ var get_member_are_referenced_default = _mcpserversdk.withStandardDecorators.cal
22835
22950
 
22836
22951
 
22837
22952
 
22838
- var inputSchema34 = getMemberByIdReferencedByParams.merge(getMemberByIdReferencedByQueryParams);
22953
+ var inputSchema35 = getMemberByIdReferencedByParams.merge(getMemberByIdReferencedByQueryParams);
22839
22954
  var GetMemberByIdReferencedByTool = {
22840
22955
  name: "get-member-by-id-referenced-by",
22841
22956
  description: `Get items that reference a specific member
22842
22957
  Use this to find all content, documents, or other items that are currently referencing a specific member account.`,
22843
- inputSchema: inputSchema34.shape,
22958
+ inputSchema: inputSchema35.shape,
22844
22959
  outputSchema: getMemberByIdReferencedByResponse.shape,
22845
22960
  annotations: { readOnlyHint: true },
22846
22961
  slices: ["references"],
@@ -22858,12 +22973,12 @@ var get_member_by_id_referenced_by_default = _mcpserversdk.withStandardDecorator
22858
22973
 
22859
22974
 
22860
22975
 
22861
- var inputSchema35 = getMemberByIdReferencedDescendantsParams.merge(getMemberByIdReferencedDescendantsQueryParams);
22976
+ var inputSchema36 = getMemberByIdReferencedDescendantsParams.merge(getMemberByIdReferencedDescendantsQueryParams);
22862
22977
  var GetMemberByIdReferencedDescendantsTool = {
22863
22978
  name: "get-member-by-id-referenced-descendants",
22864
22979
  description: `Get descendant references for a member
22865
22980
  Use this to find all descendant references that are being referenced for a specific member account.`,
22866
- inputSchema: inputSchema35.shape,
22981
+ inputSchema: inputSchema36.shape,
22867
22982
  outputSchema: getMemberByIdReferencedDescendantsResponse.shape,
22868
22983
  annotations: { readOnlyHint: true },
22869
22984
  slices: ["references"],
@@ -22976,7 +23091,7 @@ var MemberCollection = {
22976
23091
  tools.push(get_member_are_referenced_default);
22977
23092
  tools.push(get_member_by_id_referenced_by_default);
22978
23093
  tools.push(get_member_by_id_referenced_descendants_default);
22979
- if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _117 => _117.umbracoVersion]))) {
23094
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _113 => _113.umbracoVersion]))) {
22980
23095
  tools.push(get_member_type_schema_default);
22981
23096
  }
22982
23097
  }
@@ -23129,14 +23244,14 @@ var create_member_group_default = _mcpserversdk.withStandardDecorators.call(void
23129
23244
 
23130
23245
 
23131
23246
 
23132
- var inputSchema36 = {
23247
+ var inputSchema37 = {
23133
23248
  id: putMemberGroupByIdParams.shape.id,
23134
23249
  data: _zod.z.object(putMemberGroupByIdBody.shape)
23135
23250
  };
23136
23251
  var UpdateMemberGroupTool = {
23137
23252
  name: "update-member-group",
23138
23253
  description: "Updates a member group by Id",
23139
- inputSchema: inputSchema36,
23254
+ inputSchema: inputSchema37,
23140
23255
  annotations: {
23141
23256
  idempotentHint: true
23142
23257
  },
@@ -23220,7 +23335,7 @@ var CreateMemberTypeTool = {
23220
23335
  validateStatus: () => true
23221
23336
  });
23222
23337
  if (response.status === 201) {
23223
- const locationHeader = _optionalChain([response, 'access', _118 => _118.headers, 'optionalAccess', _119 => _119["location"]]) || _optionalChain([response, 'access', _120 => _120.headers, 'optionalAccess', _121 => _121["Location"]]);
23338
+ const locationHeader = _optionalChain([response, 'access', _114 => _114.headers, 'optionalAccess', _115 => _115["location"]]) || _optionalChain([response, 'access', _116 => _116.headers, 'optionalAccess', _117 => _117["Location"]]);
23224
23339
  let createdId = model.id || "";
23225
23340
  if (locationHeader) {
23226
23341
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -23345,14 +23460,14 @@ var delete_member_type_default = _mcpserversdk.withStandardDecorators.call(void
23345
23460
 
23346
23461
 
23347
23462
 
23348
- var inputSchema37 = _zod.z.object({
23463
+ var inputSchema38 = _zod.z.object({
23349
23464
  id: putMemberTypeByIdParams.shape.id,
23350
23465
  data: _zod.z.object(putMemberTypeByIdBody.shape)
23351
23466
  });
23352
23467
  var UpdateMemberTypeTool = {
23353
23468
  name: "update-member-type",
23354
23469
  description: "Updates a member type by id",
23355
- inputSchema: inputSchema37.shape,
23470
+ inputSchema: inputSchema38.shape,
23356
23471
  annotations: { idempotentHint: true },
23357
23472
  slices: ["update"],
23358
23473
  handler: (async (model) => {
@@ -23370,7 +23485,7 @@ var update_member_type_default = _mcpserversdk.withStandardDecorators.call(void
23370
23485
 
23371
23486
 
23372
23487
 
23373
- var inputSchema38 = _zod.z.object({
23488
+ var inputSchema39 = _zod.z.object({
23374
23489
  id: _zod.z.string().uuid()
23375
23490
  });
23376
23491
  var copyMemberTypeOutputSchema = _zod.z.object({
@@ -23380,7 +23495,7 @@ var copyMemberTypeOutputSchema = _zod.z.object({
23380
23495
  var CopyMemberTypeTool = {
23381
23496
  name: "copy-member-type",
23382
23497
  description: "Copy a member type to a new location",
23383
- inputSchema: inputSchema38.shape,
23498
+ inputSchema: inputSchema39.shape,
23384
23499
  outputSchema: copyMemberTypeOutputSchema.shape,
23385
23500
  slices: ["copy"],
23386
23501
  handler: (async (model) => {
@@ -23390,7 +23505,7 @@ var CopyMemberTypeTool = {
23390
23505
  validateStatus: () => true
23391
23506
  });
23392
23507
  if (response.status === 201) {
23393
- const locationHeader = _optionalChain([response, 'access', _122 => _122.headers, 'optionalAccess', _123 => _123["location"]]) || _optionalChain([response, 'access', _124 => _124.headers, 'optionalAccess', _125 => _125["Location"]]);
23508
+ const locationHeader = _optionalChain([response, 'access', _118 => _118.headers, 'optionalAccess', _119 => _119["location"]]) || _optionalChain([response, 'access', _120 => _120.headers, 'optionalAccess', _121 => _121["Location"]]);
23394
23509
  let createdId = "";
23395
23510
  if (locationHeader) {
23396
23511
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -23750,7 +23865,7 @@ var CreatePartialViewTool = {
23750
23865
  validateStatus: () => true
23751
23866
  });
23752
23867
  if (response.status === 201) {
23753
- const locationHeader = _optionalChain([response, 'access', _126 => _126.headers, 'optionalAccess', _127 => _127["location"]]) || _optionalChain([response, 'access', _128 => _128.headers, 'optionalAccess', _129 => _129["Location"]]);
23868
+ const locationHeader = _optionalChain([response, 'access', _122 => _122.headers, 'optionalAccess', _123 => _123["location"]]) || _optionalChain([response, 'access', _124 => _124.headers, 'optionalAccess', _125 => _125["Location"]]);
23754
23869
  let createdPath = "";
23755
23870
  if (locationHeader) {
23756
23871
  const pathMatch = locationHeader.match(/partial-view\/(.+)$/);
@@ -23797,7 +23912,7 @@ var CreatePartialViewFolderTool = {
23797
23912
  validateStatus: () => true
23798
23913
  });
23799
23914
  if (response.status === 201) {
23800
- const locationHeader = _optionalChain([response, 'access', _130 => _130.headers, 'optionalAccess', _131 => _131["location"]]) || _optionalChain([response, 'access', _132 => _132.headers, 'optionalAccess', _133 => _133["Location"]]);
23915
+ const locationHeader = _optionalChain([response, 'access', _126 => _126.headers, 'optionalAccess', _127 => _127["location"]]) || _optionalChain([response, 'access', _128 => _128.headers, 'optionalAccess', _129 => _129["Location"]]);
23801
23916
  let createdPath = "";
23802
23917
  if (locationHeader) {
23803
23918
  const pathMatch = locationHeader.match(/partial-view\/folder\/(.+)$/);
@@ -24198,14 +24313,20 @@ var PropertyTypeCollection = {
24198
24313
  var GetAllRedirectsTool = {
24199
24314
  name: "get-all-redirects",
24200
24315
  description: `Gets all redirects from the Umbraco server.
24201
- Returns a list of redirects with their details.`,
24202
- inputSchema: {},
24316
+
24317
+ Returns a list of redirects with their details. Use "filter" to search redirects by original or
24318
+ destination URL.
24319
+
24320
+ Results are paginated (100 per page by default). Check the returned "total" against the number of
24321
+ "items" returned - if total is greater, call again with "cursor" set to the returned "nextCursor"
24322
+ to page through the remaining redirects.`,
24323
+ inputSchema: getRedirectManagementQueryParams.shape,
24203
24324
  outputSchema: getRedirectManagementResponse.shape,
24204
24325
  annotations: { readOnlyHint: true },
24205
24326
  slices: ["list"],
24206
- handler: (async () => {
24327
+ handler: (async (params) => {
24207
24328
  return _mcpserversdk.executeGetApiCall.call(void 0,
24208
- (client) => client.getRedirectManagement(void 0, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
24329
+ (client) => client.getRedirectManagement(params, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
24209
24330
  );
24210
24331
  })
24211
24332
  };
@@ -24624,7 +24745,7 @@ var CreateScriptTool = {
24624
24745
  validateStatus: () => true
24625
24746
  });
24626
24747
  if (response.status === 201) {
24627
- const locationHeader = _optionalChain([response, 'access', _134 => _134.headers, 'optionalAccess', _135 => _135["location"]]) || _optionalChain([response, 'access', _136 => _136.headers, 'optionalAccess', _137 => _137["Location"]]);
24748
+ const locationHeader = _optionalChain([response, 'access', _130 => _130.headers, 'optionalAccess', _131 => _131["location"]]) || _optionalChain([response, 'access', _132 => _132.headers, 'optionalAccess', _133 => _133["Location"]]);
24628
24749
  let createdPath = "";
24629
24750
  if (locationHeader) {
24630
24751
  const pathMatch = locationHeader.match(/script\/(.+)$/);
@@ -24671,7 +24792,7 @@ var CreateScriptFolderTool = {
24671
24792
  validateStatus: () => true
24672
24793
  });
24673
24794
  if (response.status === 201) {
24674
- const locationHeader = _optionalChain([response, 'access', _138 => _138.headers, 'optionalAccess', _139 => _139["location"]]) || _optionalChain([response, 'access', _140 => _140.headers, 'optionalAccess', _141 => _141["Location"]]);
24795
+ const locationHeader = _optionalChain([response, 'access', _134 => _134.headers, 'optionalAccess', _135 => _135["location"]]) || _optionalChain([response, 'access', _136 => _136.headers, 'optionalAccess', _137 => _137["Location"]]);
24675
24796
  let createdPath = "";
24676
24797
  if (locationHeader) {
24677
24798
  const pathMatch = locationHeader.match(/script\/folder\/(.+)$/);
@@ -25268,7 +25389,7 @@ var CreateStylesheetTool = {
25268
25389
  validateStatus: () => true
25269
25390
  });
25270
25391
  if (response.status === 201) {
25271
- const locationHeader = _optionalChain([response, 'access', _142 => _142.headers, 'optionalAccess', _143 => _143["location"]]) || _optionalChain([response, 'access', _144 => _144.headers, 'optionalAccess', _145 => _145["Location"]]);
25392
+ const locationHeader = _optionalChain([response, 'access', _138 => _138.headers, 'optionalAccess', _139 => _139["location"]]) || _optionalChain([response, 'access', _140 => _140.headers, 'optionalAccess', _141 => _141["Location"]]);
25272
25393
  let createdPath = "";
25273
25394
  if (locationHeader) {
25274
25395
  const pathMatch = locationHeader.match(/stylesheet\/(.+)$/);
@@ -25315,7 +25436,7 @@ var CreateStylesheetFolderTool = {
25315
25436
  validateStatus: () => true
25316
25437
  });
25317
25438
  if (response.status === 201) {
25318
- const locationHeader = _optionalChain([response, 'access', _146 => _146.headers, 'optionalAccess', _147 => _147["location"]]) || _optionalChain([response, 'access', _148 => _148.headers, 'optionalAccess', _149 => _149["Location"]]);
25439
+ const locationHeader = _optionalChain([response, 'access', _142 => _142.headers, 'optionalAccess', _143 => _143["location"]]) || _optionalChain([response, 'access', _144 => _144.headers, 'optionalAccess', _145 => _145["Location"]]);
25319
25440
  let createdPath = "";
25320
25441
  if (locationHeader) {
25321
25442
  const pathMatch = locationHeader.match(/stylesheet\/folder\/(.+)$/);
@@ -25679,7 +25800,7 @@ var CreateTemplateTool = {
25679
25800
  validateStatus: () => true
25680
25801
  });
25681
25802
  if (response.status === 201) {
25682
- const locationHeader = _optionalChain([response, 'access', _150 => _150.headers, 'optionalAccess', _151 => _151["location"]]) || _optionalChain([response, 'access', _152 => _152.headers, 'optionalAccess', _153 => _153["Location"]]);
25803
+ const locationHeader = _optionalChain([response, 'access', _146 => _146.headers, 'optionalAccess', _147 => _147["location"]]) || _optionalChain([response, 'access', _148 => _148.headers, 'optionalAccess', _149 => _149["Location"]]);
25683
25804
  let createdId = "";
25684
25805
  if (locationHeader) {
25685
25806
  const idMatch = locationHeader.match(/template\/([a-f0-9-]+)$/i);
@@ -26493,14 +26614,14 @@ var get_user_batch_default = _mcpserversdk.withStandardDecorators.call(void 0, G
26493
26614
 
26494
26615
 
26495
26616
 
26496
- var inputSchema39 = _zod.z.object({
26617
+ var inputSchema40 = _zod.z.object({
26497
26618
  ...postUserAvatarByIdParams.shape,
26498
26619
  ...postUserAvatarByIdBody.shape
26499
26620
  });
26500
26621
  var UploadUserAvatarByIdTool = {
26501
26622
  name: "upload-user-avatar-by-id",
26502
26623
  description: "Uploads an avatar for a specific user by ID (admin only or self-service)",
26503
- inputSchema: inputSchema39.shape,
26624
+ inputSchema: inputSchema40.shape,
26504
26625
  slices: ["update"],
26505
26626
  handler: (async ({ id, file }) => {
26506
26627
  return _mcpserversdk.executeVoidApiCall.call(void 0,
@@ -26621,7 +26742,7 @@ var UserCollection = {
26621
26742
  tools.push(get_item_user_default);
26622
26743
  tools.push(get_user_configuration_default);
26623
26744
  tools.push(get_user_by_id_calculate_start_nodes_default);
26624
- if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _154 => _154.umbracoVersion]))) {
26745
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _150 => _150.umbracoVersion]))) {
26625
26746
  tools.push(get_user_batch_default);
26626
26747
  }
26627
26748
  tools.push(upload_user_avatar_by_id_default);
@@ -26655,7 +26776,7 @@ var CreateUserDataTool = {
26655
26776
  validateStatus: () => true
26656
26777
  });
26657
26778
  if (response.status === 201) {
26658
- const locationHeader = _optionalChain([response, 'access', _155 => _155.headers, 'optionalAccess', _156 => _156["location"]]) || _optionalChain([response, 'access', _157 => _157.headers, 'optionalAccess', _158 => _158["Location"]]);
26779
+ const locationHeader = _optionalChain([response, 'access', _151 => _151.headers, 'optionalAccess', _152 => _152["location"]]) || _optionalChain([response, 'access', _153 => _153.headers, 'optionalAccess', _154 => _154["Location"]]);
26659
26780
  let createdId = "";
26660
26781
  if (locationHeader) {
26661
26782
  const idMatch = locationHeader.match(/user-data\/([a-f0-9-]+)$/i);
@@ -26893,7 +27014,7 @@ var CreateUserGroupTool = {
26893
27014
  validateStatus: () => true
26894
27015
  });
26895
27016
  if (response.status === 201) {
26896
- const locationHeader = _optionalChain([response, 'access', _159 => _159.headers, 'optionalAccess', _160 => _160["location"]]) || _optionalChain([response, 'access', _161 => _161.headers, 'optionalAccess', _162 => _162["Location"]]);
27017
+ const locationHeader = _optionalChain([response, 'access', _155 => _155.headers, 'optionalAccess', _156 => _156["location"]]) || _optionalChain([response, 'access', _157 => _157.headers, 'optionalAccess', _158 => _158["Location"]]);
26897
27018
  let createdId = "";
26898
27019
  if (locationHeader) {
26899
27020
  const idMatch = locationHeader.match(/user-group\/([a-f0-9-]+)$/i);
@@ -27191,7 +27312,7 @@ var CreateWebhookTool = {
27191
27312
  validateStatus: () => true
27192
27313
  });
27193
27314
  if (response.status === 201) {
27194
- const locationHeader = _optionalChain([response, 'access', _163 => _163.headers, 'optionalAccess', _164 => _164["location"]]) || _optionalChain([response, 'access', _165 => _165.headers, 'optionalAccess', _166 => _166["Location"]]);
27315
+ const locationHeader = _optionalChain([response, 'access', _159 => _159.headers, 'optionalAccess', _160 => _160["location"]]) || _optionalChain([response, 'access', _161 => _161.headers, 'optionalAccess', _162 => _162["Location"]]);
27195
27316
  let createdId = "";
27196
27317
  if (locationHeader) {
27197
27318
  const idMatch = locationHeader.match(/webhook\/([a-f0-9-]+)$/i);
@@ -27220,16 +27341,25 @@ var create_webhook_default = _mcpserversdk.withStandardDecorators.call(void 0, C
27220
27341
 
27221
27342
 
27222
27343
 
27344
+
27345
+ var inputSchema41 = _zod.z.object({
27346
+ ...getWebhookByIdLogsParams.shape,
27347
+ ...getWebhookByIdLogsQueryParams.shape
27348
+ });
27223
27349
  var GetWebhookLogsTool = {
27224
27350
  name: "get-webhook-logs",
27225
- description: "Gets logs for a specific webhook",
27226
- inputSchema: getWebhookByIdLogsParams.shape,
27351
+ description: `Gets logs for a specific webhook.
27352
+
27353
+ Results are paginated (100 per page by default). Check the returned "total" against the number of
27354
+ "items" returned - if total is greater, call again with "cursor" set to the returned "nextCursor"
27355
+ to page through the remaining logs.`,
27356
+ inputSchema: inputSchema41.shape,
27227
27357
  outputSchema: getWebhookByIdLogsResponse.shape,
27228
27358
  annotations: { readOnlyHint: true },
27229
27359
  slices: ["read"],
27230
- handler: (async ({ id }) => {
27360
+ handler: (async ({ id, skip, take }) => {
27231
27361
  return _mcpserversdk.executeGetApiCall.call(void 0,
27232
- (client) => client.getWebhookByIdLogs(id, void 0, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
27362
+ (client) => client.getWebhookByIdLogs(id, { skip, take }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
27233
27363
  );
27234
27364
  })
27235
27365
  };
@@ -27427,4 +27557,4 @@ var allSliceNames = [...toolSliceNames, "other"];
27427
27557
 
27428
27558
 
27429
27559
  exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.UmbracoManagementClient = UmbracoManagementClient3; exports.setAllowFilePathUploads = setAllowFilePathUploads; exports.setUmbracoVersion = setUmbracoVersion; exports.availableCollections = availableCollections; exports.allModes = allModes; exports.allModeNames = allModeNames; exports.allSliceNames = allSliceNames;
27430
- //# sourceMappingURL=chunk-WAZSHKMB.cjs.map
27560
+ //# sourceMappingURL=chunk-KGS2P7IA.cjs.map