@umbraco-cms/mcp-editor 17.6.0-beta.5 → 18.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { randomUUID } from 'crypto';
10
10
 
11
11
  // package.json
12
12
  var package_default = {
13
- version: "17.6.0-beta.5"};
13
+ version: "18.0.0-beta.7"};
14
14
 
15
15
  // src/auth/chained-deps.generated.ts
16
16
  var CHAINED_DEPS = {
@@ -28,6 +28,7 @@ var CHAINED_DEPS = {
28
28
  "bulk-unpublish": ["get-document-by-id", "unpublish-document"],
29
29
  "cancel-schedule": ["get-document-by-id", "publish-document"],
30
30
  "copy-variant": ["get-document-by-id", "update-document"],
31
+ "create-and-publish-page": ["create-and-publish-document", "get-data-types-by-id-array", "get-document-type-by-id"],
31
32
  "create-blueprint": ["create-document-blueprint-from-document", "get-document-blueprint-root", "get-document-by-id"],
32
33
  "create-dictionary": ["create-dictionary"],
33
34
  "create-language": ["create-language"],
@@ -101,7 +102,7 @@ var CHAINED_DEPS = {
101
102
  "restore-media": ["get-media-by-id", "restore-media-from-recycle-bin"],
102
103
  "restore-page": ["get-document-by-id"],
103
104
  "rollback-page": ["create-document-version-rollback", "get-document-by-id", "get-document-version", "get-user-by-id"],
104
- "save-and-publish": ["get-document-by-id", "publish-document", "publish-document-with-descendants", "update-document-properties"],
105
+ "save-and-publish": ["get-document-by-id", "publish-document", "publish-document-with-descendants", "update-and-publish-document", "update-document-properties"],
105
106
  "schedule-publish": ["get-document-by-id", "publish-document"],
106
107
  "search-content": ["search-document"],
107
108
  "search-dictionary": ["find-dictionary"],
@@ -121,8 +122,7 @@ var CHAINED_DEPS = {
121
122
 
122
123
  // src/config/mcp-servers.ts
123
124
  async function buildServers() {
124
- const isWorkersRuntime = typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers";
125
- if (isWorkersRuntime || typeof process === "undefined" || !process.env) return [];
125
+ if (typeof process === "undefined" || !process.env) return [];
126
126
  const useMockChain = process.env.USE_MOCK_MCP_CHAIN === "true";
127
127
  if (useMockChain) {
128
128
  const path2 = await import('path');
@@ -212,21 +212,7 @@ function extractInnerProblemDetails(result) {
212
212
  };
213
213
  }
214
214
  async function chainCms(toolName, args) {
215
- let result;
216
- try {
217
- result = await mcpClientManager.callTool("cms", toolName, args);
218
- } catch (error) {
219
- const message = error instanceof Error ? error.message : String(error);
220
- return {
221
- ok: false,
222
- errorResult: createToolResultError({
223
- type: "Error",
224
- title: "Chained tool call failed",
225
- status: 500,
226
- detail: `Chained CMS tool "${toolName}" failed: ${message}`
227
- })
228
- };
229
- }
215
+ const result = await mcpClientManager.callTool("cms", toolName, args);
230
216
  if (result.isError) {
231
217
  const inner = extractInnerProblemDetails(result);
232
218
  return { ok: false, errorResult: createToolResultError(inner) };
@@ -721,43 +707,151 @@ var tool5 = {
721
707
  }
722
708
  };
723
709
  var get_document_type_default = withStandardDecorators(tool5);
724
- var inputSchema6 = {
725
- id: z.string().uuid().describe("The ID of the page to inspect"),
726
- propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
727
- };
728
- var outputSchema6 = z.object({
729
- id: z.string(),
730
- name: z.string(),
731
- previewUrl: previewUrlSchema,
732
- blockProperties: z.array(z.object({
733
- propertyAlias: z.string().describe("The document property containing these blocks"),
710
+
711
+ // src/umbraco-api/tools/helpers/block-builder.ts
712
+ async function resolveBlockEditorAliases(contentTypeKey) {
713
+ const docTypeResult = await chainCms("get-document-type-by-id", { id: contentTypeKey });
714
+ if (!docTypeResult.ok) return { ok: false, errorResult: docTypeResult.errorResult };
715
+ const dataTypeIds = Array.from(new Set(docTypeResult.data.properties.map((p) => p.dataType.id)));
716
+ if (dataTypeIds.length === 0) {
717
+ return { ok: true, editorAliasByAlias: /* @__PURE__ */ new Map() };
718
+ }
719
+ const dataTypesResult = await chainCms("get-data-types-by-id-array", { id: dataTypeIds });
720
+ if (!dataTypesResult.ok) return { ok: false, errorResult: dataTypesResult.errorResult };
721
+ const editorAliasByDataTypeId = new Map(
722
+ dataTypesResult.data.items.map((dt) => [dt.id, dt.editorAlias])
723
+ );
724
+ const editorAliasByAlias = /* @__PURE__ */ new Map();
725
+ for (const prop of docTypeResult.data.properties) {
726
+ const editorAlias = editorAliasByDataTypeId.get(prop.dataType.id);
727
+ if (editorAlias) editorAliasByAlias.set(prop.alias, editorAlias);
728
+ }
729
+ return { ok: true, editorAliasByAlias };
730
+ }
731
+ function buildBlockEntry(contentKey, contentTypeKey, values, editorAliasByAlias, culture, segment) {
732
+ return {
733
+ key: contentKey,
734
+ contentTypeKey,
735
+ values: values.map((v) => ({
736
+ editorAlias: editorAliasByAlias.get(v.alias) ?? "",
737
+ culture,
738
+ segment,
739
+ alias: v.alias,
740
+ value: v.value
741
+ }))
742
+ };
743
+ }
744
+ function insertAtPosition(list, item, position, matchAnchor) {
745
+ if (position.mode === "append") return { ok: true, list: [...list, item] };
746
+ if (position.mode === "prepend") return { ok: true, list: [item, ...list] };
747
+ const anchorIndex = list.findIndex(matchAnchor);
748
+ if (anchorIndex === -1) return { ok: false, reason: "anchor-not-found" };
749
+ const insertIndex = position.mode === "before" ? anchorIndex : anchorIndex + 1;
750
+ const next = [...list];
751
+ next.splice(insertIndex, 0, item);
752
+ return { ok: true, list: next };
753
+ }
754
+ function isBlockListOrGridValue(value) {
755
+ return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
756
+ }
757
+ function isRteWithBlocks(value) {
758
+ return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && value.blocks !== null && typeof value.blocks === "object" && Array.isArray(value.blocks?.contentData);
759
+ }
760
+ function exposeEntry(contentKey, culture, segment) {
761
+ return { contentKey, culture, segment };
762
+ }
763
+ function removeBlockFromContainer(container, contentKey, layoutKey, newLayoutList, doomedSettingsKey) {
764
+ return {
765
+ ...container,
766
+ layout: { ...container.layout ?? {}, [layoutKey]: [...newLayoutList] },
767
+ contentData: (container.contentData ?? []).filter((entry) => entry.key !== contentKey),
768
+ settingsData: doomedSettingsKey ? (container.settingsData ?? []).filter((entry) => entry.key !== doomedSettingsKey) : container.settingsData ?? [],
769
+ expose: (container.expose ?? []).filter((entry) => entry.contentKey !== contentKey)
770
+ };
771
+ }
772
+
773
+ // src/umbraco-api/tools/helpers/block-inspector.ts
774
+ function blockPropertiesSchema(editTool) {
775
+ return z.array(z.object({
776
+ propertyAlias: z.string().describe("The property containing these blocks"),
734
777
  editorAlias: z.string().optional(),
735
778
  blocks: z.array(z.object({
736
- contentKey: z.string().describe("The block's unique key \u2014 use this with edit-block"),
779
+ contentKey: z.string().describe(`The block's unique key \u2014 use this with ${editTool}`),
737
780
  contentTypeKey: z.string().describe("The block's element type ID"),
781
+ settingsKey: z.string().optional().describe("The key of the block's settings entry. Absent when the block has no settings."),
738
782
  properties: z.array(z.object({
739
783
  alias: z.string(),
740
784
  value: z.any()
741
785
  }))
742
786
  }))
743
- }))
744
- });
745
- function isBlockListOrGridValue(value) {
746
- return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
747
- }
748
- function isRteWithBlocks(value) {
749
- return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && value.blocks !== null && typeof value.blocks === "object" && Array.isArray(value.blocks?.contentData);
787
+ }));
750
788
  }
751
789
  function extractBlocks(contentData) {
752
790
  return contentData.map((block) => ({
753
- contentKey: block.key ?? "",
754
- contentTypeKey: block.contentTypeKey ?? "",
755
- properties: Array.isArray(block.values) ? block.values.map((v) => ({ alias: v.alias ?? "", value: v.value })) : []
791
+ contentKey: block?.key ?? "",
792
+ contentTypeKey: block?.contentTypeKey ?? "",
793
+ properties: Array.isArray(block?.values) ? block.values.map((v) => ({ alias: v?.alias ?? "", value: v?.value })) : []
756
794
  }));
757
795
  }
796
+ function findSettingsKey(container, contentKey) {
797
+ const layout = container?.layout;
798
+ if (!layout || typeof layout !== "object") return void 0;
799
+ return searchLayout(Object.values(layout), contentKey);
800
+ }
801
+ function searchLayout(entries, contentKey) {
802
+ for (const entry of entries) {
803
+ if (Array.isArray(entry)) {
804
+ const found = searchLayout(entry, contentKey);
805
+ if (found) return found;
806
+ continue;
807
+ }
808
+ if (!entry || typeof entry !== "object") continue;
809
+ const candidate = entry;
810
+ if (candidate.contentKey === contentKey) {
811
+ return typeof candidate.settingsKey === "string" && candidate.settingsKey.length > 0 ? candidate.settingsKey : void 0;
812
+ }
813
+ for (const nested of [candidate.areas, candidate.items]) {
814
+ if (Array.isArray(nested)) {
815
+ const found = searchLayout(nested, contentKey);
816
+ if (found) return found;
817
+ }
818
+ }
819
+ }
820
+ return void 0;
821
+ }
822
+ function collectBlockProperties(values, propertyAlias) {
823
+ const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
824
+ return filtered.filter((v) => isBlockListOrGridValue(v.value) || isRteWithBlocks(v.value)).map((v) => {
825
+ const value = v.value;
826
+ const container = isRteWithBlocks(value) ? value.blocks : value;
827
+ return {
828
+ propertyAlias: v.alias,
829
+ editorAlias: isRteWithBlocks(value) ? "Umbraco.RichText" : v.editorAlias ?? void 0,
830
+ blocks: withSettingsKeys(extractBlocks(container.contentData), container)
831
+ };
832
+ });
833
+ }
834
+ function withSettingsKeys(blocks, container) {
835
+ return blocks.map((block) => {
836
+ const settingsKey = findSettingsKey(container, block.contentKey);
837
+ return settingsKey ? { ...block, settingsKey } : block;
838
+ });
839
+ }
840
+
841
+ // src/umbraco-api/tools/content/get/inspect-blocks.ts
842
+ var inputSchema6 = {
843
+ id: z.string().uuid().describe("The ID of the page to inspect"),
844
+ propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
845
+ };
846
+ var outputSchema6 = z.object({
847
+ id: z.string(),
848
+ name: z.string(),
849
+ previewUrl: previewUrlSchema,
850
+ blockProperties: blockPropertiesSchema("edit-block")
851
+ });
758
852
  var tool6 = {
759
853
  name: "inspect-blocks",
760
- description: "Inspect the block structure of a content page. Shows each block's type, unique key, and property values. Use this to understand how content is structured inside BlockList, BlockGrid, or Rich Text properties before using edit-block to make changes.",
854
+ description: "Inspect the block structure of a content page. Shows each block's type, unique key, and property values. Use this to understand how content is structured inside BlockList, BlockGrid, or Rich Text properties before using edit-block to make changes. Content pages only \u2014 for blocks on a Library element use inspect-element-blocks instead.",
761
855
  inputSchema: inputSchema6,
762
856
  outputSchema: outputSchema6,
763
857
  slices: ["read"],
@@ -766,28 +860,11 @@ var tool6 = {
766
860
  const result = await chainCms("get-document-by-id", { id });
767
861
  if (!result.ok) return result.errorResult;
768
862
  const doc = result.data;
769
- const allValues = doc.values ?? [];
770
- const filtered = propertyAlias ? allValues.filter((v) => v.alias === propertyAlias) : allValues;
771
- const blockProperties = filtered.filter((v) => isBlockListOrGridValue(v.value) || isRteWithBlocks(v.value)).map((v) => {
772
- const value = v.value;
773
- if (isRteWithBlocks(value)) {
774
- return {
775
- propertyAlias: v.alias,
776
- editorAlias: "Umbraco.RichText",
777
- blocks: extractBlocks(value.blocks.contentData)
778
- };
779
- }
780
- return {
781
- propertyAlias: v.alias,
782
- editorAlias: v.editorAlias ?? void 0,
783
- blocks: extractBlocks(value.contentData)
784
- };
785
- });
786
863
  return createToolResult({
787
864
  id: doc.id,
788
865
  name: doc.variants?.[0]?.name ?? "Unknown",
789
866
  previewUrl: buildPreviewUrl(doc.id),
790
- blockProperties
867
+ blockProperties: collectBlockProperties(doc.values ?? [], propertyAlias)
791
868
  });
792
869
  }
793
870
  };
@@ -1115,7 +1192,8 @@ ${aliases.join("\n")}`
1115
1192
  const schemaResult = await chainCms("get-data-type-schema", { id: match.id });
1116
1193
  if (!schemaResult.ok) return schemaResult.errorResult;
1117
1194
  return createToolResult({
1118
- message: JSON.stringify(schemaResult.data, null, 2),
1195
+ message: `Value-shape template for ${editorAlias}:
1196
+ ${JSON.stringify(schemaResult.data, null, 2)}`,
1119
1197
  editorAlias
1120
1198
  });
1121
1199
  }
@@ -1165,13 +1243,13 @@ async function validateDocumentState(id, doc) {
1165
1243
  culture: v.culture ?? null,
1166
1244
  segment: v.segment ?? null
1167
1245
  }));
1168
- const ancestorsResult = await chainCms("get-document-ancestors", { descendantId: id });
1169
- const parent = ancestorsResult.ok ? (ancestorsResult.data.items ?? []).find((item) => item.id === id)?.parent ?? null : null;
1246
+ const itemResult = await chainCms("get-item-document", { id: [id] });
1247
+ const parent = itemResult.ok ? itemResult.data.items[0]?.parent ?? null : null;
1170
1248
  const result = await chainCms("validate-document", {
1171
1249
  id,
1172
1250
  documentType: { id: target.documentType.id },
1173
1251
  template: target.template ? { id: target.template.id } : null,
1174
- parent,
1252
+ parent: parent ? { id: parent.id } : null,
1175
1253
  values,
1176
1254
  variants
1177
1255
  });
@@ -1442,70 +1520,6 @@ var tool13 = {
1442
1520
  }
1443
1521
  };
1444
1522
  var duplicate_page_default = withStandardDecorators(tool13);
1445
-
1446
- // src/umbraco-api/tools/helpers/block-builder.ts
1447
- async function resolveBlockEditorAliases(contentTypeKey) {
1448
- const docTypeResult = await chainCms("get-document-type-by-id", { id: contentTypeKey });
1449
- if (!docTypeResult.ok) return { ok: false, errorResult: docTypeResult.errorResult };
1450
- const dataTypeIds = Array.from(new Set(docTypeResult.data.properties.map((p) => p.dataType.id)));
1451
- if (dataTypeIds.length === 0) {
1452
- return { ok: true, editorAliasByAlias: /* @__PURE__ */ new Map() };
1453
- }
1454
- const dataTypesResult = await chainCms("get-data-types-by-id-array", { id: dataTypeIds });
1455
- if (!dataTypesResult.ok) return { ok: false, errorResult: dataTypesResult.errorResult };
1456
- const editorAliasByDataTypeId = new Map(
1457
- dataTypesResult.data.items.map((dt) => [dt.id, dt.editorAlias])
1458
- );
1459
- const editorAliasByAlias = /* @__PURE__ */ new Map();
1460
- for (const prop of docTypeResult.data.properties) {
1461
- const editorAlias = editorAliasByDataTypeId.get(prop.dataType.id);
1462
- if (editorAlias) editorAliasByAlias.set(prop.alias, editorAlias);
1463
- }
1464
- return { ok: true, editorAliasByAlias };
1465
- }
1466
- function buildBlockEntry(contentKey, contentTypeKey, values, editorAliasByAlias, culture, segment) {
1467
- return {
1468
- key: contentKey,
1469
- contentTypeKey,
1470
- values: values.map((v) => ({
1471
- editorAlias: editorAliasByAlias.get(v.alias) ?? "",
1472
- culture,
1473
- segment,
1474
- alias: v.alias,
1475
- value: v.value
1476
- }))
1477
- };
1478
- }
1479
- function insertAtPosition(list, item, position, matchAnchor) {
1480
- if (position.mode === "append") return { ok: true, list: [...list, item] };
1481
- if (position.mode === "prepend") return { ok: true, list: [item, ...list] };
1482
- const anchorIndex = list.findIndex(matchAnchor);
1483
- if (anchorIndex === -1) return { ok: false, reason: "anchor-not-found" };
1484
- const insertIndex = position.mode === "before" ? anchorIndex : anchorIndex + 1;
1485
- const next = [...list];
1486
- next.splice(insertIndex, 0, item);
1487
- return { ok: true, list: next };
1488
- }
1489
- function isBlockListOrGridValue2(value) {
1490
- return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
1491
- }
1492
- function isRteWithBlocks2(value) {
1493
- return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && value.blocks !== null && typeof value.blocks === "object" && Array.isArray(value.blocks?.contentData);
1494
- }
1495
- function exposeEntry(contentKey, culture, segment) {
1496
- return { contentKey, culture, segment };
1497
- }
1498
- function removeBlockFromContainer(container, contentKey, layoutKey, newLayoutList, doomedSettingsKey) {
1499
- return {
1500
- ...container,
1501
- layout: { ...container.layout ?? {}, [layoutKey]: [...newLayoutList] },
1502
- contentData: (container.contentData ?? []).filter((entry) => entry.key !== contentKey),
1503
- settingsData: doomedSettingsKey ? (container.settingsData ?? []).filter((entry) => entry.key !== doomedSettingsKey) : container.settingsData ?? [],
1504
- expose: (container.expose ?? []).filter((entry) => entry.contentKey !== contentKey)
1505
- };
1506
- }
1507
-
1508
- // src/umbraco-api/tools/content/post/add-blocklist-block.ts
1509
1523
  var positionSchema = z.object({
1510
1524
  mode: z.enum(["append", "prepend", "before", "after"]).describe("Where to place the new block relative to existing blocks"),
1511
1525
  anchorContentKey: z.string().uuid().optional().describe("Required for 'before' or 'after' \u2014 the contentKey of the anchor block")
@@ -1564,7 +1578,7 @@ var tool14 = {
1564
1578
  settingsData: [],
1565
1579
  expose: []
1566
1580
  };
1567
- if (existingProp && (!isBlockListOrGridValue2(propValue) || existingProp.editorAlias !== "Umbraco.BlockList")) {
1581
+ if (existingProp && (!isBlockListOrGridValue(propValue) || existingProp.editorAlias !== "Umbraco.BlockList")) {
1568
1582
  return createToolResultError({ content: [{ type: "text", text: `Property '${propertyAlias}' on '${pageName}' is not a BlockList. Use inspect-blocks to confirm the editor type, or add-rte-block / add-blockgrid-block as appropriate.` }], isError: true });
1569
1583
  }
1570
1584
  const contentEditorAliases = await resolveBlockEditorAliases(contentTypeKey);
@@ -1684,7 +1698,7 @@ var tool15 = {
1684
1698
  settingsData: [],
1685
1699
  expose: []
1686
1700
  };
1687
- if (existingProp && (!isBlockListOrGridValue2(propValue) || existingProp.editorAlias !== "Umbraco.BlockGrid")) {
1701
+ if (existingProp && (!isBlockListOrGridValue(propValue) || existingProp.editorAlias !== "Umbraco.BlockGrid")) {
1688
1702
  return createToolResultError({ content: [{ type: "text", text: `Property '${propertyAlias}' on '${pageName}' is not a BlockGrid. Use inspect-blocks to confirm the editor type, or add-blocklist-block / add-rte-block as appropriate.` }], isError: true });
1689
1703
  }
1690
1704
  const contentEditorAliases = await resolveBlockEditorAliases(contentTypeKey);
@@ -1851,7 +1865,7 @@ var tool16 = {
1851
1865
  markup: "",
1852
1866
  blocks: { layout: {}, contentData: [], settingsData: [], expose: [] }
1853
1867
  };
1854
- if (existingProp && !isRteWithBlocks2(propValue)) {
1868
+ if (existingProp && !isRteWithBlocks(propValue)) {
1855
1869
  return createToolResultError({ content: [{ type: "text", text: `Property '${propertyAlias}' on '${pageName}' is not a rich text with blocks. Use inspect-blocks to confirm the editor type, or add-blocklist-block / add-blockgrid-block as appropriate.` }], isError: true });
1856
1870
  }
1857
1871
  const contentEditorAliases = await resolveBlockEditorAliases(contentTypeKey);
@@ -1989,7 +2003,7 @@ var outputSchema18 = z.object({
1989
2003
  });
1990
2004
  var tool18 = {
1991
2005
  name: "edit-block",
1992
- description: "Update properties within a specific block (BlockList, BlockGrid, or Rich Text block). Use inspect-blocks first to find the propertyAlias and contentKey. Pass blockType='settings' to edit a block's settings instead of its content. For non-block page properties, use edit-page instead. For structured property values inside the block (media pickers, content pickers, image cropper, slider, color, date, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. Culture/segment applies to the document property level \u2014 use separate calls for mixed-variant blocks. Changes are saved but NOT published. The response includes a `validation` field \u2014 if `validation.valid` is false the changes were saved but the parent page cannot be published until the listed errors are resolved.",
2006
+ description: "Update properties within a specific block (BlockList, BlockGrid, or Rich Text block). Use inspect-blocks first to find the propertyAlias and contentKey. Pass blockType='settings' to edit a block's settings instead of its content. For non-block page properties, use edit-page instead. Content pages only \u2014 for a block on a Library element use inspect-element-blocks then edit-element-block, not this tool. For structured property values inside the block (media pickers, content pickers, image cropper, slider, color, date, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. Culture/segment applies to the document property level \u2014 use separate calls for mixed-variant blocks. Changes are saved but NOT published. The response includes a `validation` field \u2014 if `validation.valid` is false the changes were saved but the parent page cannot be published until the listed errors are resolved.",
1993
2007
  inputSchema: inputSchema18,
1994
2008
  outputSchema: outputSchema18,
1995
2009
  slices: ["update"],
@@ -2057,7 +2071,8 @@ var tool19 = {
2057
2071
  const targetCulture = culture ?? null;
2058
2072
  const docResult = await chainCms("get-document-by-id", { id });
2059
2073
  if (!docResult.ok) return docResult.errorResult;
2060
- const variants = docResult.data.variants ?? [];
2074
+ const doc = docResult.data;
2075
+ const variants = doc.variants ?? [];
2061
2076
  const targetVariant = variants.find((v) => matchesCulture(v, targetCulture));
2062
2077
  if (!targetVariant) {
2063
2078
  if (targetCulture) {
@@ -2092,8 +2107,8 @@ var tool19 = {
2092
2107
  previewUrl: buildPreviewUrl(id)
2093
2108
  });
2094
2109
  }
2095
- const renameResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2096
- if (!renameResult.ok) return renameResult.errorResult;
2110
+ const updateResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2111
+ if (!updateResult.ok) return updateResult.errorResult;
2097
2112
  return createToolResult({
2098
2113
  message: `Renamed page${cultureLabel} from "${previousName}" to "${name}" (saved, not published)`,
2099
2114
  id,
@@ -2391,7 +2406,7 @@ function findAndRemoveGridItem(items, contentKey) {
2391
2406
  function planRemoval(propValue, editorAlias, propertyAlias, contentKey, pageName) {
2392
2407
  const notFound = { ok: false, errorText: `Block '${contentKey}' was not found in property '${propertyAlias}'.` };
2393
2408
  const draftSuffix = "Will be saved as a draft, not published.";
2394
- if (isBlockListOrGridValue2(propValue) && editorAlias === "Umbraco.BlockList") {
2409
+ if (isBlockListOrGridValue(propValue) && editorAlias === "Umbraco.BlockList") {
2395
2410
  const layoutKey = "Umbraco.BlockList";
2396
2411
  const layoutList = propValue.layout?.[layoutKey] ?? [];
2397
2412
  const doomed = layoutList.find((e) => e.contentKey === contentKey);
@@ -2402,7 +2417,7 @@ function planRemoval(propValue, editorAlias, propertyAlias, contentKey, pageName
2402
2417
  confirmMessage: `Remove block ${contentKey} from "${pageName}" (BlockList ${propertyAlias})? ${draftSuffix}`
2403
2418
  };
2404
2419
  }
2405
- if (isBlockListOrGridValue2(propValue) && editorAlias === "Umbraco.BlockGrid") {
2420
+ if (isBlockListOrGridValue(propValue) && editorAlias === "Umbraco.BlockGrid") {
2406
2421
  const layoutKey = "Umbraco.BlockGrid";
2407
2422
  const removed = findAndRemoveGridItem(propValue.layout?.[layoutKey] ?? [], contentKey);
2408
2423
  if (!removed.found) return notFound;
@@ -2412,7 +2427,7 @@ function planRemoval(propValue, editorAlias, propertyAlias, contentKey, pageName
2412
2427
  confirmMessage: `Remove block ${contentKey} from "${pageName}" (BlockGrid ${propertyAlias})? ${draftSuffix}`
2413
2428
  };
2414
2429
  }
2415
- if (isRteWithBlocks2(propValue)) {
2430
+ if (isRteWithBlocks(propValue)) {
2416
2431
  const layoutKey = "Umbraco.RichText";
2417
2432
  const blocks = propValue.blocks;
2418
2433
  const layoutList = blocks.layout?.[layoutKey] ?? [];
@@ -2622,17 +2637,36 @@ var outputSchema27 = z.object({
2622
2637
  updatedFields: z.array(z.string()),
2623
2638
  publishedUrls: publishedUrlsSchema
2624
2639
  });
2625
- function mergeValues(existing, updates) {
2626
- const key = (v) => `${v.alias}::${v.culture ?? ""}::${v.segment ?? ""}`;
2627
- const merged = new Map(existing.map((v) => [key(v), { alias: v.alias, value: v.value, culture: v.culture ?? null, segment: v.segment ?? null }]));
2628
- for (const u of updates) {
2629
- merged.set(key(u), { alias: u.alias, value: u.value, culture: u.culture ?? null, segment: u.segment ?? null });
2640
+ function valueKey2(value) {
2641
+ return `${value.alias}|${value.culture ?? ""}|${value.segment ?? ""}`;
2642
+ }
2643
+ function normaliseValue(value) {
2644
+ return {
2645
+ alias: value.alias,
2646
+ value: value.value,
2647
+ culture: value.culture ?? null,
2648
+ segment: value.segment ?? null
2649
+ };
2650
+ }
2651
+ function mergeValues(current, incoming) {
2652
+ const merged = current.map(normaliseValue);
2653
+ const indexByKey = new Map(merged.map((value, index) => [valueKey2(value), index]));
2654
+ for (const value of incoming) {
2655
+ const next = normaliseValue(value);
2656
+ const key = valueKey2(next);
2657
+ const existingIndex = indexByKey.get(key);
2658
+ if (existingIndex !== void 0) {
2659
+ merged[existingIndex] = next;
2660
+ } else {
2661
+ indexByKey.set(key, merged.length);
2662
+ merged.push(next);
2663
+ }
2630
2664
  }
2631
- return [...merged.values()];
2665
+ return merged;
2632
2666
  }
2633
2667
  var tool27 = {
2634
2668
  name: "save-and-publish",
2635
- description: "Save property changes and publish a content page in one atomic operation \u2014 mirrors the 'Save and publish' button in the Umbraco backoffice. If `values` is provided the changes are saved first; then the page is published. Optionally publish descendants. Call get-page or get-document-type first to discover valid property aliases.",
2669
+ description: "Save property changes and publish a content page in one atomic operation \u2014 mirrors the 'Save and publish' button in the Umbraco backoffice. If `values` is provided the changes are saved and published in a single call; otherwise the current draft is published as-is. Optionally publish descendants. Call get-page or get-document-type first to discover valid property aliases.",
2636
2670
  inputSchema: inputSchema27,
2637
2671
  outputSchema: outputSchema27,
2638
2672
  slices: ["publish", "update"],
@@ -2643,6 +2677,7 @@ var tool27 = {
2643
2677
  const doc = docResult.data;
2644
2678
  const pageName = doc.variants?.[0]?.name ?? "Unknown";
2645
2679
  const fieldNames = (values ?? []).map((v) => v.alias);
2680
+ const hasValues = (values?.length ?? 0) > 0;
2646
2681
  if (includeDescendants) {
2647
2682
  if (!await requestApproval(extra, `Publish "${pageName}" and all its descendants?`)) {
2648
2683
  return createToolResult({
@@ -2657,9 +2692,9 @@ var tool27 = {
2657
2692
  }
2658
2693
  }
2659
2694
  const variantCultures = (doc.variants ?? []).length ? doc.variants.map((v) => v.culture ?? null) : [null];
2660
- const saved = !!(values && values.length > 0);
2661
2695
  if (includeDescendants) {
2662
- if (saved) {
2696
+ let saved = false;
2697
+ if (hasValues) {
2663
2698
  const properties = values.map((v) => ({
2664
2699
  alias: v.alias,
2665
2700
  value: v.value,
@@ -2668,6 +2703,7 @@ var tool27 = {
2668
2703
  }));
2669
2704
  const updateResult = await chainCms("update-document-properties", { id, properties });
2670
2705
  if (!updateResult.ok) return updateResult.errorResult;
2706
+ saved = true;
2671
2707
  }
2672
2708
  const publishResult = await chainCms("publish-document-with-descendants", {
2673
2709
  id,
@@ -2690,52 +2726,74 @@ var tool27 = {
2690
2726
  }
2691
2727
  return publishResult.errorResult;
2692
2728
  }
2693
- } else {
2694
- const mergedValues = mergeValues(doc.values ?? [], values ?? []);
2729
+ const savedPart2 = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2730
+ return createToolResult({
2731
+ message: `${savedPart2}published "${pageName}" and all descendants`,
2732
+ id,
2733
+ name: pageName,
2734
+ saved,
2735
+ published: true,
2736
+ updatedFields: fieldNames,
2737
+ publishedUrls: await fetchPublishedUrls(id)
2738
+ });
2739
+ }
2740
+ if (hasValues) {
2695
2741
  const updateAndPublishResult = await chainCms("update-and-publish-document", {
2696
2742
  id,
2697
2743
  data: {
2698
- values: mergedValues,
2744
+ culturesToPublish: [...new Set(variantCultures.filter((c) => c !== null))],
2745
+ template: doc.template ?? null,
2746
+ values: mergeValues(doc.values ?? [], values),
2699
2747
  variants: (doc.variants ?? []).map((v) => ({
2700
2748
  culture: v.culture ?? null,
2701
2749
  segment: v.segment ?? null,
2702
2750
  name: v.name
2703
- })),
2704
- template: doc.template ?? null,
2705
- culturesToPublish: variantCultures.filter((c) => c !== null)
2751
+ }))
2706
2752
  }
2707
2753
  });
2708
- if (!updateAndPublishResult.ok) return updateAndPublishResult.errorResult;
2709
- }
2710
- if (!includeDescendants) {
2711
- const verifyError = await verifyDocumentPublished(id, variantCultures);
2712
- if (verifyError) {
2713
- if (saved) {
2714
- return createToolResult({
2715
- message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2716
- id,
2717
- name: pageName,
2718
- saved: true,
2719
- published: false,
2720
- updatedFields: fieldNames,
2721
- publishedUrls: []
2722
- });
2723
- }
2754
+ if (!updateAndPublishResult.ok) {
2755
+ const rolledBack = `No changes were saved to "${pageName}" \u2014 save-and-publish is a single atomic operation, so the field updates were rolled back along with the publish.`;
2756
+ const problem = updateAndPublishResult.errorResult.structuredContent;
2724
2757
  return createToolResultError({
2725
- status: 500,
2726
- title: "Publish did not take effect",
2727
- detail: `"${pageName}": ${verifyError}`
2758
+ ...problem,
2759
+ status: typeof problem?.status === "number" ? problem.status : 500,
2760
+ title: "Save and publish failed",
2761
+ detail: problem?.detail ? `${String(problem.detail)} ${rolledBack}` : rolledBack
2762
+ });
2763
+ }
2764
+ } else {
2765
+ const publishResult = await chainCms("publish-document", {
2766
+ id,
2767
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
2768
+ });
2769
+ if (!publishResult.ok) return publishResult.errorResult;
2770
+ }
2771
+ const verifyError = await verifyDocumentPublished(id, variantCultures);
2772
+ if (verifyError) {
2773
+ if (hasValues) {
2774
+ return createToolResult({
2775
+ message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2776
+ id,
2777
+ name: pageName,
2778
+ saved: true,
2779
+ published: false,
2780
+ updatedFields: fieldNames,
2781
+ publishedUrls: []
2728
2782
  });
2729
2783
  }
2784
+ return createToolResultError({
2785
+ status: 500,
2786
+ title: "Publish did not take effect",
2787
+ detail: `"${pageName}": ${verifyError}`
2788
+ });
2730
2789
  }
2731
2790
  const publishedUrls = await fetchPublishedUrls(id);
2732
- const savedPart = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2733
- const descPart = includeDescendants ? " and all descendants" : "";
2791
+ const savedPart = hasValues ? `Saved ${fieldNames.length} field(s) and ` : "";
2734
2792
  return createToolResult({
2735
- message: `${savedPart}published "${pageName}"${descPart}`,
2793
+ message: `${savedPart}published "${pageName}"`,
2736
2794
  id,
2737
2795
  name: pageName,
2738
- saved,
2796
+ saved: hasValues,
2739
2797
  published: true,
2740
2798
  updatedFields: fieldNames,
2741
2799
  publishedUrls
@@ -3811,46 +3869,565 @@ var collection5 = {
3811
3869
  };
3812
3870
  var media_management_default = collection5;
3813
3871
  var inputSchema46 = {
3814
- parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
3815
- take: z.number().optional().default(50).describe("Number of results to return"),
3816
- skip: z.number().optional().default(0).describe("Number of results to skip")
3872
+ id: z.string().uuid().describe("The unique ID of the element to retrieve")
3817
3873
  };
3818
3874
  var outputSchema46 = z.object({
3819
- items: z.array(z.object({
3820
- id: z.string(),
3821
- name: z.string(),
3822
- documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
3823
- })).describe("Available page blueprints"),
3824
- total: z.number()
3875
+ id: z.string(),
3876
+ name: z.string(),
3877
+ elementType: z.object({ id: z.string() }).describe("The element type (document type) this element is based on"),
3878
+ values: z.array(z.object({ alias: z.string(), value: z.any() }).passthrough()).describe("Property field values"),
3879
+ variants: z.array(z.object({ name: z.string() }).passthrough()).describe("Language/culture variants")
3825
3880
  });
3826
3881
  var tool46 = {
3827
- name: "list-blueprints",
3828
- description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
3882
+ name: "get-element",
3883
+ description: "Get the full details of a Library element \u2014 its element type, all property values, and culture variants. Elements are the document-like reusable content items that live in the Library section. Use this after search-elements or list-element-children to see what an element contains, and before edit-element to discover valid property aliases.",
3829
3884
  inputSchema: inputSchema46,
3830
3885
  outputSchema: outputSchema46,
3831
- slices: ["list"],
3886
+ slices: ["read"],
3832
3887
  annotations: { readOnlyHint: true },
3833
- handler: async ({ parentId, take, skip }) => {
3834
- const cursor = buildChainedCursor(skip, take);
3835
- const result = parentId ? await chainCms("get-document-blueprint-children", { parentId, cursor }) : await chainCms("get-document-blueprint-root", { cursor });
3888
+ handler: async ({ id }) => {
3889
+ const result = await chainCms("get-element-by-id", { id });
3836
3890
  if (!result.ok) return result.errorResult;
3891
+ const el = result.data;
3837
3892
  return createToolResult({
3838
- items: (result.data.items ?? []).map((item) => ({
3839
- id: item.id,
3840
- name: item.name ?? "Unknown",
3841
- documentType: item.documentType?.id ?? void 0
3842
- })),
3843
- total: result.data.total ?? 0
3893
+ id: el.id,
3894
+ name: el.variants?.[0]?.name ?? "Unknown",
3895
+ elementType: { id: el.documentType?.id ?? el.elementType?.id ?? "" },
3896
+ values: el.values ?? [],
3897
+ variants: el.variants ?? []
3844
3898
  });
3845
3899
  }
3846
3900
  };
3847
- var list_blueprints_default = withStandardDecorators(tool46);
3901
+ var get_element_default = withStandardDecorators(tool46);
3848
3902
  var inputSchema47 = {
3849
- id: z.string().uuid().describe("The ID of the blueprint to retrieve")
3903
+ parentId: z.string().uuid().optional().describe("Parent folder ID in the Library. Omit to list the root of the Library (top-level folders and elements)."),
3904
+ take: z.number().optional().default(20).describe("Number of results to return"),
3905
+ skip: z.number().optional().default(0).describe("Number of results to skip")
3850
3906
  };
3851
3907
  var outputSchema47 = z.object({
3852
- id: z.string(),
3853
- name: z.string(),
3908
+ items: z.array(z.object({
3909
+ id: z.string(),
3910
+ name: z.string(),
3911
+ isFolder: z.boolean().describe("True if this node is a folder that organises elements, false if it is an element item"),
3912
+ hasChildren: z.boolean()
3913
+ })).describe("Child folders and elements"),
3914
+ total: z.number().describe("Total number of children")
3915
+ });
3916
+ var tool47 = {
3917
+ name: "list-element-children",
3918
+ description: "Browse the Library tree \u2014 list the folders and elements under a folder, or the Library root when no parentId is given. Elements are the document-like reusable content items in the Library section (Umbraco 18). Use this to navigate the Library, then get-element to see an element's details.",
3919
+ inputSchema: inputSchema47,
3920
+ outputSchema: outputSchema47,
3921
+ slices: ["tree"],
3922
+ annotations: { readOnlyHint: true },
3923
+ handler: async ({ parentId, take, skip }) => {
3924
+ const cursor = buildChainedCursor(skip, take);
3925
+ const result = parentId ? await chainCms("get-element-children", { parentId, cursor }) : await chainCms("get-element-root", { cursor });
3926
+ if (!result.ok) return result.errorResult;
3927
+ const data = result.data;
3928
+ const items = data.items ?? [];
3929
+ return createToolResult({
3930
+ items: items.map((item) => ({
3931
+ id: item.id,
3932
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown",
3933
+ isFolder: item.isFolder ?? false,
3934
+ hasChildren: item.hasChildren ?? false
3935
+ })),
3936
+ total: data.total ?? items.length
3937
+ });
3938
+ }
3939
+ };
3940
+ var list_element_children_default = withStandardDecorators(tool47);
3941
+ var inputSchema48 = {
3942
+ query: z.string().describe("Search term to find Library elements by name"),
3943
+ take: z.number().optional().default(10).describe("Number of results to return (default 10)"),
3944
+ skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
3945
+ };
3946
+ var outputSchema48 = z.object({
3947
+ items: z.array(z.object({
3948
+ id: z.string(),
3949
+ name: z.string()
3950
+ })).describe("Matching Library elements"),
3951
+ total: z.number().describe("Total number of matches")
3952
+ });
3953
+ var tool48 = {
3954
+ name: "search-elements",
3955
+ description: "Search for Library elements by name. Returns matching elements with their names and IDs. Use get-element with an ID from the results to retrieve an element's full details. Elements are the document-like reusable content items in the Library section (Umbraco 18).",
3956
+ inputSchema: inputSchema48,
3957
+ outputSchema: outputSchema48,
3958
+ slices: ["search"],
3959
+ annotations: { readOnlyHint: true },
3960
+ handler: async ({ query, take, skip }) => {
3961
+ const result = await chainCms("search-element", { query, cursor: buildChainedCursor(skip, take) });
3962
+ if (!result.ok) return result.errorResult;
3963
+ const data = result.data;
3964
+ const items = data.items ?? [];
3965
+ return createToolResult({
3966
+ items: items.map((item) => ({
3967
+ id: item.id,
3968
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown"
3969
+ })),
3970
+ total: data.total ?? items.length
3971
+ });
3972
+ }
3973
+ };
3974
+ var search_elements_default = withStandardDecorators(tool48);
3975
+ var inputSchema49 = {
3976
+ id: z.string().uuid().describe("The ID of the Library element to inspect"),
3977
+ propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
3978
+ };
3979
+ var outputSchema49 = z.object({
3980
+ id: z.string(),
3981
+ name: z.string(),
3982
+ blockProperties: blockPropertiesSchema("edit-element-block")
3983
+ });
3984
+ var tool49 = {
3985
+ name: "inspect-element-blocks",
3986
+ description: "Inspect the block structure of a Library element. Shows each block's type, unique key, and property values inside the element's BlockList, BlockGrid, or Rich Text properties. Use this to find the propertyAlias and contentKey that edit-element-block needs. Library elements only \u2014 for blocks on a content page use inspect-blocks instead. Elements are the document-like reusable content items in the Library section (Umbraco 18).",
3987
+ inputSchema: inputSchema49,
3988
+ outputSchema: outputSchema49,
3989
+ slices: ["read"],
3990
+ annotations: { readOnlyHint: true },
3991
+ handler: async ({ id, propertyAlias }) => {
3992
+ const result = await chainCms("get-element-by-id", { id });
3993
+ if (!result.ok) return result.errorResult;
3994
+ const element = result.data;
3995
+ return createToolResult({
3996
+ id: element.id,
3997
+ name: element.variants?.[0]?.name ?? "Unknown",
3998
+ blockProperties: collectBlockProperties(element.values ?? [], propertyAlias)
3999
+ });
4000
+ }
4001
+ };
4002
+ var inspect_element_blocks_default = withStandardDecorators(tool49);
4003
+ var inputSchema50 = {
4004
+ name: z.string().describe("The name of the element to create"),
4005
+ elementTypeId: z.string().uuid().describe("The ID of the element type (document type) to use. Elements are created from element types \u2014 find valid IDs from an existing element (get-element) or the element configuration."),
4006
+ parentId: z.string().uuid().optional().describe("The ID of the parent folder in the Library. Elements live inside folders; omit only if creating at a location that allows root items."),
4007
+ values: z.array(z.object({
4008
+ alias: z.string().describe("The property alias"),
4009
+ value: z.any().describe("The property value"),
4010
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4011
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4012
+ })).optional().describe("Initial property values to set on the new element")
4013
+ };
4014
+ var outputSchema50 = z.object({
4015
+ message: z.string(),
4016
+ id: z.string(),
4017
+ name: z.string()
4018
+ });
4019
+ var tool50 = {
4020
+ name: "create-element",
4021
+ description: "Create a new Library element as a draft \u2014 it is NOT published automatically. Elements are the document-like reusable content items in the Library section. Pass `name`, `elementTypeId`, an optional parent folder `parentId`, and at most a few simple initial values. For everything else, follow up after creation with edit-element for property updates. Publish separately with publish-element.",
4022
+ inputSchema: inputSchema50,
4023
+ outputSchema: outputSchema50,
4024
+ slices: ["create"],
4025
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4026
+ handler: async ({ name, elementTypeId, parentId, values }) => {
4027
+ const editorAliasByPropertyAlias = /* @__PURE__ */ new Map();
4028
+ if (values && values.length > 0) {
4029
+ const typeResult = await chainCms("get-document-type-by-id", { id: elementTypeId });
4030
+ if (!typeResult.ok) return typeResult.errorResult;
4031
+ const dataTypeIds = Array.from(new Set(typeResult.data.properties.map((p) => p.dataType.id)));
4032
+ const dataTypesResult = await chainCms("get-data-types-by-id-array", { id: dataTypeIds });
4033
+ if (!dataTypesResult.ok) return dataTypesResult.errorResult;
4034
+ const editorAliasByDataTypeId = new Map(
4035
+ dataTypesResult.data.items.map((dt) => [dt.id, dt.editorAlias])
4036
+ );
4037
+ for (const prop of typeResult.data.properties) {
4038
+ const editorAlias = editorAliasByDataTypeId.get(prop.dataType.id);
4039
+ if (editorAlias) editorAliasByPropertyAlias.set(prop.alias, editorAlias);
4040
+ }
4041
+ }
4042
+ const createResult = await chainCms("create-element", {
4043
+ documentTypeId: elementTypeId,
4044
+ name,
4045
+ values: (values ?? []).map((v) => ({
4046
+ alias: v.alias,
4047
+ value: v.value,
4048
+ culture: v.culture ?? null,
4049
+ segment: v.segment ?? null,
4050
+ editorAlias: editorAliasByPropertyAlias.get(v.alias) ?? ""
4051
+ })),
4052
+ ...parentId ? { parentId } : {}
4053
+ });
4054
+ if (!createResult.ok) return createResult.errorResult;
4055
+ return createToolResult({
4056
+ message: `Created draft element "${name}"`,
4057
+ id: createResult.data.id ?? "",
4058
+ name
4059
+ });
4060
+ }
4061
+ };
4062
+ var create_element_default = withStandardDecorators(tool50);
4063
+ var inputSchema51 = {
4064
+ name: z.string().describe("The name of the element to create"),
4065
+ elementTypeId: z.string().uuid().describe("The ID of the element type (document type) to use. Elements are created from element types \u2014 find valid IDs from an existing element (get-element) or the element configuration."),
4066
+ parentId: z.string().uuid().optional().describe("The ID of the parent folder in the Library. Elements live inside folders; omit only if creating at a location that allows root items."),
4067
+ values: z.array(z.object({
4068
+ alias: z.string().describe("The property alias"),
4069
+ value: z.any().describe("The property value"),
4070
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4071
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4072
+ })).optional().describe("Initial property values to set on the new element")
4073
+ };
4074
+ var outputSchema51 = z.object({
4075
+ message: z.string(),
4076
+ id: z.string(),
4077
+ name: z.string()
4078
+ });
4079
+ var tool51 = {
4080
+ name: "create-and-publish-element",
4081
+ description: "Create a new Library element and publish it in one atomic operation \u2014 mirrors clicking 'Save and publish' (instead of 'Save') on the element create screen. Elements are the document-like reusable content items in the Library section. Pass `name`, `elementTypeId`, an optional parent folder `parentId`, and at most a few simple initial values. If the element type requires properties this doesn't set, or if the values fail validation, the whole operation fails and no element is created \u2014 use create-element followed by publish-element instead when you need to build up content across multiple calls before publishing.",
4082
+ inputSchema: inputSchema51,
4083
+ outputSchema: outputSchema51,
4084
+ slices: ["create", "publish"],
4085
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4086
+ handler: async ({ name, elementTypeId, parentId, values }) => {
4087
+ const createResult = await chainCms("create-and-publish-element", {
4088
+ documentTypeId: elementTypeId,
4089
+ name,
4090
+ values: (values ?? []).map((v) => ({
4091
+ alias: v.alias,
4092
+ value: v.value,
4093
+ culture: v.culture ?? null,
4094
+ segment: v.segment ?? null
4095
+ })),
4096
+ ...parentId ? { parentId } : {}
4097
+ });
4098
+ if (!createResult.ok) return createResult.errorResult;
4099
+ return createToolResult({
4100
+ message: `Created and published element "${name}"`,
4101
+ id: createResult.data.id ?? "",
4102
+ name
4103
+ });
4104
+ }
4105
+ };
4106
+ var create_and_publish_element_default = withStandardDecorators(tool51);
4107
+ var inputSchema52 = {
4108
+ name: z.string().describe("Name of the new folder"),
4109
+ parentId: z.string().uuid().optional().describe("ID of the parent folder in the Library (omit to create at the root)")
4110
+ };
4111
+ var outputSchema52 = z.object({
4112
+ message: z.string(),
4113
+ id: z.string(),
4114
+ name: z.string()
4115
+ });
4116
+ var tool52 = {
4117
+ name: "create-element-folder",
4118
+ description: "Create a folder in the Library to organise elements (Umbraco 18 Library section). Folders are the primary way the Library tree is structured; the returned ID can be used as parentId in list-element-children or create-element.",
4119
+ inputSchema: inputSchema52,
4120
+ outputSchema: outputSchema52,
4121
+ slices: ["create"],
4122
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4123
+ handler: async ({ name, parentId }) => {
4124
+ const createResult = await chainCms("create-element-folder", { name, parent: parentId ? { id: parentId } : null });
4125
+ if (!createResult.ok) return createResult.errorResult;
4126
+ let createdId = createResult.data?.id ?? "";
4127
+ let location = "at the root";
4128
+ if (!createdId) {
4129
+ const listResult = parentId ? await chainCms("get-element-children", { parentId }) : await chainCms("get-element-root", {});
4130
+ if (listResult.ok) {
4131
+ const match = (listResult.data.items ?? []).filter((i) => i.isFolder).find((i) => (i.variants?.[0]?.name ?? i.name) === name);
4132
+ if (match) createdId = match.id;
4133
+ }
4134
+ }
4135
+ if (parentId) {
4136
+ const folderResult = await chainCms("get-element-folder", { id: parentId });
4137
+ if (folderResult.ok) location = `under "${folderResult.data.name ?? "Unknown"}"`;
4138
+ }
4139
+ return createToolResult({
4140
+ message: `Created Library folder "${name}" ${location}`,
4141
+ id: createdId,
4142
+ name
4143
+ });
4144
+ }
4145
+ };
4146
+ var create_element_folder_default = withStandardDecorators(tool52);
4147
+ var inputSchema53 = {
4148
+ id: z.string().uuid().describe("The ID of the element to publish")
4149
+ };
4150
+ var outputSchema53 = z.object({
4151
+ message: z.string(),
4152
+ id: z.string(),
4153
+ name: z.string()
4154
+ });
4155
+ var tool53 = {
4156
+ name: "publish-element",
4157
+ description: "Publish a Library element to make its current draft live (mirrors the back office 'Save and publish' action). Edit the element first with edit-element if it needs changes. Use unpublish-element to take it back offline. NOTE: this publishes directly \u2014 if the site requires workflow approval, that must be handled separately.",
4158
+ inputSchema: inputSchema53,
4159
+ outputSchema: outputSchema53,
4160
+ slices: ["publish"],
4161
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4162
+ handler: async ({ id }) => {
4163
+ const elResult = await chainCms("get-element-by-id", { id });
4164
+ if (!elResult.ok) return elResult.errorResult;
4165
+ const el = elResult.data;
4166
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4167
+ const variantCultures = (el.variants ?? []).length ? el.variants.map((v) => v.culture ?? null) : [null];
4168
+ const publishResult = await chainCms("publish-element", {
4169
+ id,
4170
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
4171
+ });
4172
+ if (!publishResult.ok) return publishResult.errorResult;
4173
+ return createToolResult({
4174
+ message: `Published element "${elementName}"`,
4175
+ id,
4176
+ name: elementName
4177
+ });
4178
+ }
4179
+ };
4180
+ var publish_element_default = withStandardDecorators(tool53);
4181
+ var inputSchema54 = {
4182
+ id: z.string().uuid().describe("The ID of the element to unpublish")
4183
+ };
4184
+ var outputSchema54 = z.object({
4185
+ message: z.string(),
4186
+ id: z.string(),
4187
+ name: z.string()
4188
+ });
4189
+ var tool54 = {
4190
+ name: "unpublish-element",
4191
+ description: "Unpublish a Library element, taking it offline. The element still exists as a draft. You will be asked to confirm before unpublishing.",
4192
+ inputSchema: inputSchema54,
4193
+ outputSchema: outputSchema54,
4194
+ slices: ["publish"],
4195
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4196
+ handler: async ({ id }, extra) => {
4197
+ const elResult = await chainCms("get-element-by-id", { id });
4198
+ if (!elResult.ok) return elResult.errorResult;
4199
+ const el = elResult.data;
4200
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4201
+ if (!await requestApproval(extra, `Unpublish element "${elementName}"? This will take it offline.`)) {
4202
+ return createToolResult({ message: "Unpublish cancelled", id, name: elementName });
4203
+ }
4204
+ const cultures = (el.variants ?? []).filter((v) => v.culture).map((v) => v.culture);
4205
+ const result = await chainCms("unpublish-element", {
4206
+ id,
4207
+ data: { cultures: cultures.length > 0 ? cultures : null }
4208
+ });
4209
+ if (!result.ok) return result.errorResult;
4210
+ return createToolResult({ message: `Unpublished element "${elementName}" \u2014 it is now a draft only`, id, name: elementName });
4211
+ }
4212
+ };
4213
+ var unpublish_element_default = withStandardDecorators(tool54);
4214
+ var inputSchema55 = {
4215
+ id: z.string().uuid().describe("The ID of the element to edit"),
4216
+ values: z.array(z.object({
4217
+ alias: z.string().describe("The property alias"),
4218
+ value: z.any().describe("The new property value"),
4219
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4220
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4221
+ })).describe("Property values to update on the element")
4222
+ };
4223
+ var outputSchema55 = z.object({
4224
+ message: z.string(),
4225
+ id: z.string(),
4226
+ name: z.string(),
4227
+ updatedFields: z.array(z.string())
4228
+ });
4229
+ var tool55 = {
4230
+ name: "edit-element",
4231
+ description: "Update property values on a Library element. Changes are saved but NOT published \u2014 publish separately with publish-element. Call get-element first to discover valid property aliases. For structured non-block property values (media pickers, pickers, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. To change a property INSIDE a block on the element (BlockList, BlockGrid, or Rich Text block) use inspect-element-blocks then edit-element-block instead \u2014 passing a whole block value here would overwrite the property's entire block structure. Elements are the document-like reusable content items in the Library section (Umbraco 18).",
4232
+ inputSchema: inputSchema55,
4233
+ outputSchema: outputSchema55,
4234
+ slices: ["update"],
4235
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4236
+ handler: async ({ id, values }) => {
4237
+ const elResult = await chainCms("get-element-by-id", { id });
4238
+ if (!elResult.ok) return elResult.errorResult;
4239
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4240
+ const fieldNames = values.map((v) => v.alias);
4241
+ const properties = values.map((v) => ({
4242
+ alias: v.alias,
4243
+ value: v.value,
4244
+ culture: v.culture ?? null,
4245
+ segment: v.segment ?? null
4246
+ }));
4247
+ const updateResult = await chainCms("update-element-properties", { id, properties });
4248
+ if (!updateResult.ok) return updateResult.errorResult;
4249
+ return createToolResult({
4250
+ message: `Updated ${fieldNames.length} field(s) on element "${elementName}" (saved, not published)`,
4251
+ id,
4252
+ name: elementName,
4253
+ updatedFields: fieldNames
4254
+ });
4255
+ }
4256
+ };
4257
+ var edit_element_default = withStandardDecorators(tool55);
4258
+ var inputSchema56 = {
4259
+ id: z.string().uuid().describe("The ID of the Library element containing the block"),
4260
+ propertyAlias: z.string().describe("The element property alias containing the blocks (e.g. 'mainContent'). Use inspect-element-blocks to find this."),
4261
+ contentKey: z.string().uuid().describe("The unique key of the block to edit \u2014 always the block's contentKey as reported by inspect-element-blocks, including when blockType is 'settings'."),
4262
+ values: z.array(z.object({
4263
+ alias: z.string().describe("The property alias within the block"),
4264
+ value: z.any().describe("The new value for the property")
4265
+ })).min(1).describe("Properties to update within the block"),
4266
+ blockType: z.enum(["content", "settings"]).optional().describe("Whether to update the block's content or its settings. Defaults to 'content'."),
4267
+ culture: z.string().nullable().optional().describe("Culture code if the element property is variant"),
4268
+ segment: z.string().nullable().optional().describe("Segment if the element property is variant")
4269
+ };
4270
+ var outputSchema56 = z.object({
4271
+ message: z.string(),
4272
+ id: z.string(),
4273
+ name: z.string(),
4274
+ contentKey: z.string(),
4275
+ updatedFields: z.array(z.string()),
4276
+ warnings: z.array(z.string()).optional()
4277
+ });
4278
+ var tool56 = {
4279
+ name: "edit-element-block",
4280
+ description: "Update properties within a specific block (BlockList, BlockGrid, or Rich Text block) on a Library element. Use inspect-element-blocks first to find the propertyAlias and contentKey. Pass blockType='settings' to edit a block's settings instead of its content \u2014 still pass the block's contentKey, this tool resolves the settings entry itself. For non-block element properties use edit-element instead; for blocks on a content page use edit-block instead. For structured property values inside the block (media pickers, content pickers, image cropper, slider, color, date, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. Culture/segment applies to the element property level \u2014 use separate calls for mixed-variant blocks. Changes are saved but NOT published \u2014 publish separately with publish-element. Elements are the document-like reusable content items in the Library section (Umbraco 18).",
4281
+ inputSchema: inputSchema56,
4282
+ outputSchema: outputSchema56,
4283
+ slices: ["update"],
4284
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4285
+ handler: async ({ id, propertyAlias, contentKey, values, blockType, culture, segment }) => {
4286
+ const elResult = await chainCms("get-element-by-id", { id });
4287
+ if (!elResult.ok) return elResult.errorResult;
4288
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4289
+ const fieldNames = values.map((v) => v.alias);
4290
+ const resolvedBlockType = blockType ?? "content";
4291
+ let targetKey = contentKey;
4292
+ if (resolvedBlockType === "settings") {
4293
+ const rawValue = (elResult.data.values ?? []).find(
4294
+ (v) => v.alias === propertyAlias && (v.culture ?? null) === (culture ?? null) && (v.segment ?? null) === (segment ?? null)
4295
+ )?.value;
4296
+ const container = isRteWithBlocks(rawValue) ? rawValue.blocks : rawValue;
4297
+ const settingsKey = findSettingsKey(container, contentKey);
4298
+ if (!settingsKey) {
4299
+ return createToolResultError(
4300
+ `Block ${contentKey} in property "${propertyAlias}" has no settings entry, so its settings cannot be edited. Use inspect-element-blocks to check for a settingsKey, or omit blockType to edit the block's content.`
4301
+ );
4302
+ }
4303
+ targetKey = settingsKey;
4304
+ }
4305
+ const propsTuple = values.map((v) => ({ alias: v.alias, value: v.value }));
4306
+ const updateResult = await chainCms("update-element-block-property", {
4307
+ elementId: id,
4308
+ propertyAlias,
4309
+ culture: culture ?? null,
4310
+ segment: segment ?? null,
4311
+ updates: [{
4312
+ contentKey: targetKey,
4313
+ blockType: resolvedBlockType,
4314
+ properties: propsTuple
4315
+ }]
4316
+ });
4317
+ if (!updateResult.ok) return updateResult.errorResult;
4318
+ const failed = (updateResult.data.results ?? []).filter((r) => r.success === false);
4319
+ if (failed.length > 0) {
4320
+ const detail = failed.flatMap((r) => r.errors?.length ? r.errors : [r.message]).join("; ");
4321
+ return createToolResultError(
4322
+ `Block update failed: ${detail || updateResult.data.message || "no detail returned"}`
4323
+ );
4324
+ }
4325
+ const target = resolvedBlockType === "settings" ? "settings" : "content";
4326
+ const warnings = (updateResult.data.results ?? []).flatMap((r) => r.warnings ?? []);
4327
+ return createToolResult({
4328
+ message: `Updated ${fieldNames.length} field(s) in block ${target} on element "${elementName}" (saved, not published)`,
4329
+ id,
4330
+ name: elementName,
4331
+ contentKey,
4332
+ updatedFields: fieldNames,
4333
+ ...warnings.length ? { warnings } : {}
4334
+ });
4335
+ }
4336
+ };
4337
+ var edit_element_block_default = withStandardDecorators(tool56);
4338
+ var inputSchema57 = {
4339
+ id: z.string().uuid().describe("The ID of the element to delete")
4340
+ };
4341
+ var outputSchema57 = z.object({
4342
+ message: z.string(),
4343
+ id: z.string(),
4344
+ name: z.string()
4345
+ });
4346
+ var tool57 = {
4347
+ name: "delete-element",
4348
+ description: "Move a Library element to the recycle bin. It can be restored later. You will be asked to confirm before deleting.",
4349
+ inputSchema: inputSchema57,
4350
+ outputSchema: outputSchema57,
4351
+ slices: ["delete"],
4352
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4353
+ handler: async ({ id }, extra) => {
4354
+ const elResult = await chainCms("get-element-by-id", { id });
4355
+ if (!elResult.ok) return elResult.errorResult;
4356
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4357
+ if (!await requestApproval(extra, `WARNING: Move element "${elementName}" to the recycle bin? This will remove it from the Library.`)) {
4358
+ return createToolResult({ message: "Delete cancelled", id, name: elementName });
4359
+ }
4360
+ const deleteResult = await chainCms("move-element-to-recycle-bin", { id });
4361
+ if (!deleteResult.ok) return deleteResult.errorResult;
4362
+ return createToolResult({ message: `Moved element "${elementName}" to the recycle bin`, id, name: elementName });
4363
+ }
4364
+ };
4365
+ var delete_element_default = withStandardDecorators(tool57);
4366
+
4367
+ // src/umbraco-api/tools/element/index.ts
4368
+ var collection6 = {
4369
+ metadata: {
4370
+ name: "element",
4371
+ displayName: "Library Elements",
4372
+ description: "Browse, view, edit (including blocks), publish, and organise reusable Library elements (Umbraco 18 Library section)"
4373
+ },
4374
+ tools: () => [
4375
+ get_element_default,
4376
+ list_element_children_default,
4377
+ search_elements_default,
4378
+ inspect_element_blocks_default,
4379
+ create_element_default,
4380
+ create_and_publish_element_default,
4381
+ create_element_folder_default,
4382
+ edit_element_default,
4383
+ edit_element_block_default,
4384
+ publish_element_default,
4385
+ unpublish_element_default,
4386
+ delete_element_default
4387
+ ]
4388
+ };
4389
+ var element_default = collection6;
4390
+ var inputSchema58 = {
4391
+ parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
4392
+ take: z.number().optional().default(50).describe("Number of results to return"),
4393
+ skip: z.number().optional().default(0).describe("Number of results to skip")
4394
+ };
4395
+ var outputSchema58 = z.object({
4396
+ items: z.array(z.object({
4397
+ id: z.string(),
4398
+ name: z.string(),
4399
+ documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
4400
+ })).describe("Available page blueprints"),
4401
+ total: z.number()
4402
+ });
4403
+ var tool58 = {
4404
+ name: "list-blueprints",
4405
+ description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
4406
+ inputSchema: inputSchema58,
4407
+ outputSchema: outputSchema58,
4408
+ slices: ["list"],
4409
+ annotations: { readOnlyHint: true },
4410
+ handler: async ({ parentId, take, skip }) => {
4411
+ const cursor = buildChainedCursor(skip, take);
4412
+ const result = parentId ? await chainCms("get-document-blueprint-children", { parentId, cursor }) : await chainCms("get-document-blueprint-root", { cursor });
4413
+ if (!result.ok) return result.errorResult;
4414
+ return createToolResult({
4415
+ items: (result.data.items ?? []).map((item) => ({
4416
+ id: item.id,
4417
+ name: item.name ?? "Unknown",
4418
+ documentType: item.documentType?.id ?? void 0
4419
+ })),
4420
+ total: result.data.total ?? 0
4421
+ });
4422
+ }
4423
+ };
4424
+ var list_blueprints_default = withStandardDecorators(tool58);
4425
+ var inputSchema59 = {
4426
+ id: z.string().uuid().describe("The ID of the blueprint to retrieve")
4427
+ };
4428
+ var outputSchema59 = z.object({
4429
+ id: z.string(),
4430
+ name: z.string(),
3854
4431
  documentType: z.object({
3855
4432
  id: z.string().optional(),
3856
4433
  alias: z.string().optional(),
@@ -3868,11 +4445,11 @@ var outputSchema47 = z.object({
3868
4445
  segment: z.string().nullable().optional()
3869
4446
  })).optional().describe("Variant information")
3870
4447
  });
3871
- var tool47 = {
4448
+ var tool59 = {
3872
4449
  name: "get-blueprint",
3873
4450
  description: "Get the full details of a page blueprint including its pre-filled property values. Blueprints are page templates that provide default content when creating new pages.",
3874
- inputSchema: inputSchema47,
3875
- outputSchema: outputSchema47,
4451
+ inputSchema: inputSchema59,
4452
+ outputSchema: outputSchema59,
3876
4453
  slices: ["read"],
3877
4454
  annotations: { readOnlyHint: true },
3878
4455
  handler: async ({ id }) => {
@@ -3895,21 +4472,21 @@ var tool47 = {
3895
4472
  });
3896
4473
  }
3897
4474
  };
3898
- var get_blueprint_default = withStandardDecorators(tool47);
3899
- var inputSchema48 = {
4475
+ var get_blueprint_default = withStandardDecorators(tool59);
4476
+ var inputSchema60 = {
3900
4477
  pageId: z.string().uuid().describe("The ID of the source page to save as a blueprint"),
3901
4478
  name: z.string().describe("The name for the new blueprint")
3902
4479
  };
3903
- var outputSchema48 = z.object({
4480
+ var outputSchema60 = z.object({
3904
4481
  message: z.string(),
3905
4482
  id: z.string(),
3906
4483
  name: z.string()
3907
4484
  });
3908
- var tool48 = {
4485
+ var tool60 = {
3909
4486
  name: "create-blueprint",
3910
4487
  description: "Save an existing page as a reusable blueprint (template). The blueprint preserves the page's document type and property values.",
3911
- inputSchema: inputSchema48,
3912
- outputSchema: outputSchema48,
4488
+ inputSchema: inputSchema60,
4489
+ outputSchema: outputSchema60,
3913
4490
  slices: ["create"],
3914
4491
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
3915
4492
  handler: async ({ pageId, name }) => {
@@ -3935,24 +4512,214 @@ var tool48 = {
3935
4512
  }
3936
4513
  }
3937
4514
  return createToolResult({
3938
- message: `Created blueprint "${name}" from page "${pageName}"`,
3939
- id: createdId,
4515
+ message: `Created blueprint "${name}" from page "${pageName}"`,
4516
+ id: createdId,
4517
+ name
4518
+ });
4519
+ }
4520
+ };
4521
+ var create_blueprint_default = withStandardDecorators(tool60);
4522
+
4523
+ // src/umbraco-api/tools/blueprint/index.ts
4524
+ var collection7 = {
4525
+ metadata: {
4526
+ name: "blueprint",
4527
+ displayName: "Blueprints",
4528
+ description: "List, view, and create page blueprints"
4529
+ },
4530
+ tools: () => [list_blueprints_default, get_blueprint_default, create_blueprint_default]
4531
+ };
4532
+ var blueprint_default = collection7;
4533
+ var inputSchema61 = {
4534
+ take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4535
+ skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4536
+ };
4537
+ var outputSchema61 = z.object({
4538
+ items: z.array(z.object({
4539
+ isoCode: z.string().describe("ISO language code (e.g. en-US)"),
4540
+ name: z.string().describe("Display name of the language"),
4541
+ isDefault: z.boolean().describe("Whether this is the default language"),
4542
+ isMandatory: z.boolean().describe("Whether this language is mandatory")
4543
+ })).describe("List of configured languages"),
4544
+ total: z.number().describe("Total number of languages")
4545
+ });
4546
+ var tool61 = {
4547
+ name: "list-languages",
4548
+ description: "List all languages configured on the Umbraco site. Shows the ISO code, name, and whether each language is the default or mandatory.",
4549
+ inputSchema: inputSchema61,
4550
+ outputSchema: outputSchema61,
4551
+ slices: ["list"],
4552
+ annotations: { readOnlyHint: true },
4553
+ handler: async ({ take, skip }) => {
4554
+ const result = await chainCms("get-language", { cursor: buildChainedCursor(skip, take) });
4555
+ if (!result.ok) return result.errorResult;
4556
+ const data = result.data;
4557
+ return createToolResult({
4558
+ items: (data.items ?? []).map((item) => ({
4559
+ isoCode: item.isoCode,
4560
+ name: item.name,
4561
+ isDefault: item.isDefault,
4562
+ isMandatory: item.isMandatory
4563
+ })),
4564
+ total: data.total ?? 0
4565
+ });
4566
+ }
4567
+ };
4568
+ var list_languages_default = withStandardDecorators(tool61);
4569
+ var inputSchema62 = {
4570
+ isoCode: z.string().describe("ISO language code (e.g. en-US)")
4571
+ };
4572
+ var outputSchema62 = z.object({
4573
+ isoCode: z.string().describe("ISO language code"),
4574
+ name: z.string().describe("Display name of the language"),
4575
+ isDefault: z.boolean().describe("Whether this is the default language"),
4576
+ isMandatory: z.boolean().describe("Whether this language is mandatory"),
4577
+ fallbackIsoCode: z.string().nullable().describe("ISO code of the fallback language, if set")
4578
+ });
4579
+ var tool62 = {
4580
+ name: "get-language",
4581
+ description: "Get details of a language by its ISO code. Shows default/mandatory status and fallback language. Use list-languages to see all available ISO codes.",
4582
+ inputSchema: inputSchema62,
4583
+ outputSchema: outputSchema62,
4584
+ slices: ["read"],
4585
+ annotations: { readOnlyHint: true },
4586
+ handler: async ({ isoCode }) => {
4587
+ const result = await chainCms("get-language-by-iso-code", { isoCode });
4588
+ if (!result.ok) return result.errorResult;
4589
+ const data = result.data;
4590
+ return createToolResult({
4591
+ isoCode: data.isoCode,
4592
+ name: data.name,
4593
+ isDefault: data.isDefault ?? false,
4594
+ isMandatory: data.isMandatory ?? false,
4595
+ fallbackIsoCode: data.fallbackIsoCode ?? null
4596
+ });
4597
+ }
4598
+ };
4599
+ var get_language_default = withStandardDecorators(tool62);
4600
+ var inputSchema63 = {
4601
+ isoCode: z.string().describe("ISO language code to add (e.g. fr-FR)"),
4602
+ name: z.string().optional().describe("Display name for the language (e.g. 'French'). Defaults to the ISO code if not provided."),
4603
+ isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4604
+ isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4605
+ fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4606
+ };
4607
+ var outputSchema63 = z.object({
4608
+ message: z.string(),
4609
+ isoCode: z.string(),
4610
+ name: z.string()
4611
+ });
4612
+ var tool63 = {
4613
+ name: "create-language",
4614
+ description: "Add a new language to the site. Use this only for languages that do not yet exist \u2014 call list-languages first to avoid duplicates, and use update-language to change settings on an existing language.",
4615
+ inputSchema: inputSchema63,
4616
+ outputSchema: outputSchema63,
4617
+ slices: ["create"],
4618
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4619
+ handler: async ({ isoCode, name: displayName, isDefault, isMandatory, fallbackIsoCode }) => {
4620
+ const langName = displayName || isoCode;
4621
+ const result = await chainCms("create-language", {
4622
+ name: langName,
4623
+ isoCode,
4624
+ isDefault: isDefault ?? false,
4625
+ isMandatory: isMandatory ?? false,
4626
+ fallbackIsoCode
4627
+ });
4628
+ if (!result.ok) return result.errorResult;
4629
+ return createToolResult({
4630
+ message: `Language "${langName}" (${isoCode}) added successfully`,
4631
+ isoCode: result.data.isoCode,
4632
+ name: langName
4633
+ });
4634
+ }
4635
+ };
4636
+ var create_language_default = withStandardDecorators(tool63);
4637
+ var inputSchema64 = {
4638
+ isoCode: z.string().describe("ISO language code of the language to update (e.g. en-US)"),
4639
+ isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4640
+ isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4641
+ fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4642
+ };
4643
+ var outputSchema64 = z.object({
4644
+ message: z.string(),
4645
+ isoCode: z.string(),
4646
+ name: z.string()
4647
+ });
4648
+ var tool64 = {
4649
+ name: "update-language",
4650
+ description: "Update a language's settings (default, mandatory, fallback).",
4651
+ inputSchema: inputSchema64,
4652
+ outputSchema: outputSchema64,
4653
+ slices: ["update"],
4654
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4655
+ handler: async ({ isoCode, isDefault, isMandatory, fallbackIsoCode }) => {
4656
+ const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4657
+ if (!langResult.ok) return langResult.errorResult;
4658
+ const lang = langResult.data;
4659
+ const name = lang.name ?? isoCode;
4660
+ const result = await chainCms("update-language", {
4661
+ isoCode,
4662
+ data: {
4663
+ name,
4664
+ isDefault: isDefault ?? lang.isDefault ?? false,
4665
+ isMandatory: isMandatory ?? lang.isMandatory ?? false,
4666
+ fallbackIsoCode: fallbackIsoCode ?? lang.fallbackIsoCode ?? void 0
4667
+ }
4668
+ });
4669
+ if (!result.ok) return result.errorResult;
4670
+ return createToolResult({
4671
+ message: `Language "${name}" (${isoCode}) updated successfully`,
4672
+ isoCode,
4673
+ name
4674
+ });
4675
+ }
4676
+ };
4677
+ var update_language_default = withStandardDecorators(tool64);
4678
+ var inputSchema65 = {
4679
+ isoCode: z.string().describe("ISO language code of the language to delete (e.g. fr-FR)")
4680
+ };
4681
+ var outputSchema65 = z.object({
4682
+ message: z.string(),
4683
+ isoCode: z.string(),
4684
+ name: z.string()
4685
+ });
4686
+ var tool65 = {
4687
+ name: "delete-language",
4688
+ description: "Remove a language from the site. Content variants in this language will become inaccessible. You will be asked to confirm before deleting.",
4689
+ inputSchema: inputSchema65,
4690
+ outputSchema: outputSchema65,
4691
+ slices: ["delete"],
4692
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4693
+ handler: async ({ isoCode }, extra) => {
4694
+ const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4695
+ if (!langResult.ok) return langResult.errorResult;
4696
+ const lang = langResult.data;
4697
+ const name = lang.name ?? isoCode;
4698
+ const confirmMessage = `Delete language "${name}" (${isoCode})? All content variants in this language will become inaccessible.`;
4699
+ if (!await requestApproval(extra, confirmMessage)) {
4700
+ return createToolResult({ message: "Delete cancelled", isoCode, name });
4701
+ }
4702
+ const deleteResult = await chainCms("delete-language", { isoCode });
4703
+ if (!deleteResult.ok) return deleteResult.errorResult;
4704
+ return createToolResult({
4705
+ message: `Language "${name}" (${isoCode}) deleted successfully`,
4706
+ isoCode,
3940
4707
  name
3941
4708
  });
3942
4709
  }
3943
4710
  };
3944
- var create_blueprint_default = withStandardDecorators(tool48);
4711
+ var delete_language_default = withStandardDecorators(tool65);
3945
4712
 
3946
- // src/umbraco-api/tools/blueprint/index.ts
3947
- var collection6 = {
4713
+ // src/umbraco-api/tools/language/index.ts
4714
+ var collection8 = {
3948
4715
  metadata: {
3949
- name: "blueprint",
3950
- displayName: "Blueprints",
3951
- description: "List, view, and create page blueprints"
4716
+ name: "language",
4717
+ displayName: "Languages",
4718
+ description: "Manage languages configured on the Umbraco site"
3952
4719
  },
3953
- tools: () => [list_blueprints_default, get_blueprint_default, create_blueprint_default]
4720
+ tools: () => [list_languages_default, get_language_default, create_language_default, update_language_default, delete_language_default]
3954
4721
  };
3955
- var blueprint_default = collection6;
4722
+ var language_default = collection8;
3956
4723
  async function checkVariesByCulture(documentId) {
3957
4724
  const docResult = await chainCms("get-document-by-id", { id: documentId });
3958
4725
  if (!docResult.ok) return docResult.errorResult;
@@ -3972,7 +4739,7 @@ async function checkVariesByCulture(documentId) {
3972
4739
  }
3973
4740
 
3974
4741
  // src/umbraco-api/tools/translation/post/create-variant.ts
3975
- var inputSchema49 = {
4742
+ var inputSchema66 = {
3976
4743
  id: z.string().uuid().describe("The ID of the page to add a language variant to"),
3977
4744
  culture: z.string().describe("The target language ISO code (e.g. 'da-DK', 'fr-FR'). Call list-languages to find available cultures."),
3978
4745
  values: z.array(z.object({
@@ -3982,7 +4749,7 @@ var inputSchema49 = {
3982
4749
  segment: z.string().nullable().optional().describe("The segment for segmented content")
3983
4750
  })).optional().describe("Optional property values to set on the new variant")
3984
4751
  };
3985
- var outputSchema49 = z.object({
4752
+ var outputSchema66 = z.object({
3986
4753
  message: z.string(),
3987
4754
  id: z.string(),
3988
4755
  name: z.string(),
@@ -3990,11 +4757,11 @@ var outputSchema49 = z.object({
3990
4757
  previewUrl: previewUrlSchema,
3991
4758
  validation: validationResultSchema
3992
4759
  });
3993
- var tool49 = {
4760
+ var tool66 = {
3994
4761
  name: "create-variant",
3995
4762
  description: "Create a new language variant for a content page. Call list-languages to find available cultures. Optionally provide property values for the new variant.",
3996
- inputSchema: inputSchema49,
3997
- outputSchema: outputSchema49,
4763
+ inputSchema: inputSchema66,
4764
+ outputSchema: outputSchema66,
3998
4765
  slices: ["create"],
3999
4766
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4000
4767
  handler: async ({ id, culture, values }) => {
@@ -4038,13 +4805,13 @@ var tool49 = {
4038
4805
  });
4039
4806
  }
4040
4807
  };
4041
- var create_variant_default = withStandardDecorators(tool49);
4042
- var inputSchema50 = {
4808
+ var create_variant_default = withStandardDecorators(tool66);
4809
+ var inputSchema67 = {
4043
4810
  id: z.string().uuid().describe("The ID of the page to copy a variant on"),
4044
4811
  sourceCulture: z.string().describe("The source language ISO code to copy content from (e.g. 'en-US')"),
4045
4812
  targetCulture: z.string().describe("The target language ISO code to copy content to (e.g. 'da-DK')")
4046
4813
  };
4047
- var outputSchema50 = z.object({
4814
+ var outputSchema67 = z.object({
4048
4815
  message: z.string(),
4049
4816
  id: z.string(),
4050
4817
  name: z.string(),
@@ -4054,11 +4821,11 @@ var outputSchema50 = z.object({
4054
4821
  previewUrl: previewUrlSchema,
4055
4822
  validation: validationResultSchema
4056
4823
  });
4057
- var tool50 = {
4824
+ var tool67 = {
4058
4825
  name: "copy-variant",
4059
4826
  description: "Copy all content from one language variant to another as a starting point for translation. Overwrites the target variant's content and creates the variant if it does not exist \u2014 you will be asked to confirm. Note: Umbraco supports language fallback chains, so a property left unset on a variant can fall back to the default language automatically \u2014 copy-variant is for when you want explicit content per culture rather than relying on fallback.",
4060
- inputSchema: inputSchema50,
4061
- outputSchema: outputSchema50,
4827
+ inputSchema: inputSchema67,
4828
+ outputSchema: outputSchema67,
4062
4829
  slices: ["create"],
4063
4830
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4064
4831
  handler: async ({ id, sourceCulture, targetCulture }, extra) => {
@@ -4112,14 +4879,14 @@ var tool50 = {
4112
4879
  });
4113
4880
  }
4114
4881
  };
4115
- var copy_variant_default = withStandardDecorators(tool50);
4116
- var inputSchema51 = {
4882
+ var copy_variant_default = withStandardDecorators(tool67);
4883
+ var inputSchema68 = {
4117
4884
  culture: z.string().describe("The language ISO code to check for (e.g. 'da-DK'). Pages missing this variant will be returned. Call list-languages to find valid culture codes."),
4118
4885
  parentId: z.string().uuid().optional().describe("Parent page ID to search under. Omit to search root-level pages."),
4119
4886
  take: z.number().optional().default(20).describe("Number of results to return"),
4120
4887
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4121
4888
  };
4122
- var outputSchema51 = z.object({
4889
+ var outputSchema68 = z.object({
4123
4890
  items: z.array(z.object({
4124
4891
  id: z.string(),
4125
4892
  name: z.string(),
@@ -4127,11 +4894,11 @@ var outputSchema51 = z.object({
4127
4894
  })).describe("Pages that are missing the specified language variant"),
4128
4895
  total: z.number().describe("Total number of pages missing the variant (before pagination)")
4129
4896
  });
4130
- var tool51 = {
4897
+ var tool68 = {
4131
4898
  name: "list-untranslated",
4132
4899
  description: "Find content pages that are missing a specific language variant. Searches up to 100 pages per call \u2014 use parentId to scope to a subtree for larger sites. Use copy-variant to seed translations for found pages. Call list-languages to find valid culture codes.",
4133
- inputSchema: inputSchema51,
4134
- outputSchema: outputSchema51,
4900
+ inputSchema: inputSchema68,
4901
+ outputSchema: outputSchema68,
4135
4902
  slices: ["search"],
4136
4903
  annotations: { readOnlyHint: true },
4137
4904
  handler: async ({ culture, parentId, take, skip }) => {
@@ -4164,10 +4931,10 @@ var tool51 = {
4164
4931
  return createToolResult({ items: paged, total });
4165
4932
  }
4166
4933
  };
4167
- var list_untranslated_default = withStandardDecorators(tool51);
4934
+ var list_untranslated_default = withStandardDecorators(tool68);
4168
4935
 
4169
4936
  // src/umbraco-api/tools/translation/index.ts
4170
- var collection7 = {
4937
+ var collection9 = {
4171
4938
  metadata: {
4172
4939
  name: "translation",
4173
4940
  displayName: "Translation",
@@ -4175,203 +4942,13 @@ var collection7 = {
4175
4942
  },
4176
4943
  tools: () => [create_variant_default, copy_variant_default, list_untranslated_default]
4177
4944
  };
4178
- var translation_default = collection7;
4179
- var inputSchema52 = {
4180
- take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4181
- skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4182
- };
4183
- var outputSchema52 = z.object({
4184
- items: z.array(z.object({
4185
- isoCode: z.string().describe("ISO language code (e.g. en-US)"),
4186
- name: z.string().describe("Display name of the language"),
4187
- isDefault: z.boolean().describe("Whether this is the default language"),
4188
- isMandatory: z.boolean().describe("Whether this language is mandatory")
4189
- })).describe("List of configured languages"),
4190
- total: z.number().describe("Total number of languages")
4191
- });
4192
- var tool52 = {
4193
- name: "list-languages",
4194
- description: "List all languages configured on the Umbraco site. Shows the ISO code, name, and whether each language is the default or mandatory.",
4195
- inputSchema: inputSchema52,
4196
- outputSchema: outputSchema52,
4197
- slices: ["list"],
4198
- annotations: { readOnlyHint: true },
4199
- handler: async ({ take, skip }) => {
4200
- const result = await chainCms("get-language", { cursor: buildChainedCursor(skip, take) });
4201
- if (!result.ok) return result.errorResult;
4202
- const data = result.data;
4203
- return createToolResult({
4204
- items: (data.items ?? []).map((item) => ({
4205
- isoCode: item.isoCode,
4206
- name: item.name,
4207
- isDefault: item.isDefault,
4208
- isMandatory: item.isMandatory
4209
- })),
4210
- total: data.total ?? 0
4211
- });
4212
- }
4213
- };
4214
- var list_languages_default = withStandardDecorators(tool52);
4215
- var inputSchema53 = {
4216
- isoCode: z.string().describe("ISO language code (e.g. en-US)")
4217
- };
4218
- var outputSchema53 = z.object({
4219
- isoCode: z.string().describe("ISO language code"),
4220
- name: z.string().describe("Display name of the language"),
4221
- isDefault: z.boolean().describe("Whether this is the default language"),
4222
- isMandatory: z.boolean().describe("Whether this language is mandatory"),
4223
- fallbackIsoCode: z.string().nullable().describe("ISO code of the fallback language, if set")
4224
- });
4225
- var tool53 = {
4226
- name: "get-language",
4227
- description: "Get details of a language by its ISO code. Shows default/mandatory status and fallback language. Use list-languages to see all available ISO codes.",
4228
- inputSchema: inputSchema53,
4229
- outputSchema: outputSchema53,
4230
- slices: ["read"],
4231
- annotations: { readOnlyHint: true },
4232
- handler: async ({ isoCode }) => {
4233
- const result = await chainCms("get-language-by-iso-code", { isoCode });
4234
- if (!result.ok) return result.errorResult;
4235
- const data = result.data;
4236
- return createToolResult({
4237
- isoCode: data.isoCode,
4238
- name: data.name,
4239
- isDefault: data.isDefault ?? false,
4240
- isMandatory: data.isMandatory ?? false,
4241
- fallbackIsoCode: data.fallbackIsoCode ?? null
4242
- });
4243
- }
4244
- };
4245
- var get_language_default = withStandardDecorators(tool53);
4246
- var inputSchema54 = {
4247
- isoCode: z.string().describe("ISO language code to add (e.g. fr-FR)"),
4248
- name: z.string().optional().describe("Display name for the language (e.g. 'French'). Defaults to the ISO code if not provided."),
4249
- isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4250
- isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4251
- fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4252
- };
4253
- var outputSchema54 = z.object({
4254
- message: z.string(),
4255
- isoCode: z.string(),
4256
- name: z.string()
4257
- });
4258
- var tool54 = {
4259
- name: "create-language",
4260
- description: "Add a new language to the site. Use this only for languages that do not yet exist \u2014 call list-languages first to avoid duplicates, and use update-language to change settings on an existing language.",
4261
- inputSchema: inputSchema54,
4262
- outputSchema: outputSchema54,
4263
- slices: ["create"],
4264
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4265
- handler: async ({ isoCode, name: displayName, isDefault, isMandatory, fallbackIsoCode }) => {
4266
- const langName = displayName || isoCode;
4267
- const result = await chainCms("create-language", {
4268
- name: langName,
4269
- isoCode,
4270
- isDefault: isDefault ?? false,
4271
- isMandatory: isMandatory ?? false,
4272
- fallbackIsoCode
4273
- });
4274
- if (!result.ok) return result.errorResult;
4275
- return createToolResult({
4276
- message: `Language "${langName}" (${isoCode}) added successfully`,
4277
- isoCode: result.data.isoCode,
4278
- name: langName
4279
- });
4280
- }
4281
- };
4282
- var create_language_default = withStandardDecorators(tool54);
4283
- var inputSchema55 = {
4284
- isoCode: z.string().describe("ISO language code of the language to update (e.g. en-US)"),
4285
- isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4286
- isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4287
- fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4288
- };
4289
- var outputSchema55 = z.object({
4290
- message: z.string(),
4291
- isoCode: z.string(),
4292
- name: z.string()
4293
- });
4294
- var tool55 = {
4295
- name: "update-language",
4296
- description: "Update a language's settings (default, mandatory, fallback).",
4297
- inputSchema: inputSchema55,
4298
- outputSchema: outputSchema55,
4299
- slices: ["update"],
4300
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4301
- handler: async ({ isoCode, isDefault, isMandatory, fallbackIsoCode }) => {
4302
- const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4303
- if (!langResult.ok) return langResult.errorResult;
4304
- const lang = langResult.data;
4305
- const name = lang.name ?? isoCode;
4306
- const result = await chainCms("update-language", {
4307
- isoCode,
4308
- data: {
4309
- name,
4310
- isDefault: isDefault ?? lang.isDefault ?? false,
4311
- isMandatory: isMandatory ?? lang.isMandatory ?? false,
4312
- fallbackIsoCode: fallbackIsoCode ?? lang.fallbackIsoCode ?? void 0
4313
- }
4314
- });
4315
- if (!result.ok) return result.errorResult;
4316
- return createToolResult({
4317
- message: `Language "${name}" (${isoCode}) updated successfully`,
4318
- isoCode,
4319
- name
4320
- });
4321
- }
4322
- };
4323
- var update_language_default = withStandardDecorators(tool55);
4324
- var inputSchema56 = {
4325
- isoCode: z.string().describe("ISO language code of the language to delete (e.g. fr-FR)")
4326
- };
4327
- var outputSchema56 = z.object({
4328
- message: z.string(),
4329
- isoCode: z.string(),
4330
- name: z.string()
4331
- });
4332
- var tool56 = {
4333
- name: "delete-language",
4334
- description: "Remove a language from the site. Content variants in this language will become inaccessible. You will be asked to confirm before deleting.",
4335
- inputSchema: inputSchema56,
4336
- outputSchema: outputSchema56,
4337
- slices: ["delete"],
4338
- annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4339
- handler: async ({ isoCode }, extra) => {
4340
- const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4341
- if (!langResult.ok) return langResult.errorResult;
4342
- const lang = langResult.data;
4343
- const name = lang.name ?? isoCode;
4344
- const confirmMessage = `Delete language "${name}" (${isoCode})? All content variants in this language will become inaccessible.`;
4345
- if (!await requestApproval(extra, confirmMessage)) {
4346
- return createToolResult({ message: "Delete cancelled", isoCode, name });
4347
- }
4348
- const deleteResult = await chainCms("delete-language", { isoCode });
4349
- if (!deleteResult.ok) return deleteResult.errorResult;
4350
- return createToolResult({
4351
- message: `Language "${name}" (${isoCode}) deleted successfully`,
4352
- isoCode,
4353
- name
4354
- });
4355
- }
4356
- };
4357
- var delete_language_default = withStandardDecorators(tool56);
4358
-
4359
- // src/umbraco-api/tools/language/index.ts
4360
- var collection8 = {
4361
- metadata: {
4362
- name: "language",
4363
- displayName: "Languages",
4364
- description: "Manage languages configured on the Umbraco site"
4365
- },
4366
- tools: () => [list_languages_default, get_language_default, create_language_default, update_language_default, delete_language_default]
4367
- };
4368
- var language_default = collection8;
4369
- var inputSchema57 = {
4945
+ var translation_default = collection9;
4946
+ var inputSchema69 = {
4370
4947
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to list root-level entries"),
4371
4948
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4372
4949
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4373
4950
  };
4374
- var outputSchema57 = z.object({
4951
+ var outputSchema69 = z.object({
4375
4952
  items: z.array(
4376
4953
  z.object({
4377
4954
  id: z.string(),
@@ -4381,11 +4958,11 @@ var outputSchema57 = z.object({
4381
4958
  ).describe("Dictionary items"),
4382
4959
  total: z.number().describe("Total number of items")
4383
4960
  });
4384
- var tool57 = {
4961
+ var tool69 = {
4385
4962
  name: "list-dictionary",
4386
4963
  description: "Browse the dictionary tree. Shows root entries or children of a parent. Each item shows which languages have translations. Use get-dictionary to see the full translations.",
4387
- inputSchema: inputSchema57,
4388
- outputSchema: outputSchema57,
4964
+ inputSchema: inputSchema69,
4965
+ outputSchema: outputSchema69,
4389
4966
  slices: ["list", "tree"],
4390
4967
  annotations: { readOnlyHint: true },
4391
4968
  handler: async ({ parentId, take, skip }) => {
@@ -4411,11 +4988,11 @@ var tool57 = {
4411
4988
  });
4412
4989
  }
4413
4990
  };
4414
- var list_dictionary_default = withStandardDecorators(tool57);
4415
- var inputSchema58 = {
4991
+ var list_dictionary_default = withStandardDecorators(tool69);
4992
+ var inputSchema70 = {
4416
4993
  query: z.string().describe("Search term to match against dictionary item key names")
4417
4994
  };
4418
- var outputSchema58 = z.object({
4995
+ var outputSchema70 = z.object({
4419
4996
  items: z.array(
4420
4997
  z.object({
4421
4998
  id: z.string(),
@@ -4424,11 +5001,11 @@ var outputSchema58 = z.object({
4424
5001
  ).describe("Matching dictionary items"),
4425
5002
  total: z.number().describe("Total number of matching items")
4426
5003
  });
4427
- var tool58 = {
5004
+ var tool70 = {
4428
5005
  name: "search-dictionary",
4429
5006
  description: "Search for dictionary items by key name. Use get-dictionary to see all translations for a specific item.",
4430
- inputSchema: inputSchema58,
4431
- outputSchema: outputSchema58,
5007
+ inputSchema: inputSchema70,
5008
+ outputSchema: outputSchema70,
4432
5009
  slices: ["search"],
4433
5010
  annotations: { readOnlyHint: true },
4434
5011
  handler: async ({ query }) => {
@@ -4443,11 +5020,11 @@ var tool58 = {
4443
5020
  });
4444
5021
  }
4445
5022
  };
4446
- var search_dictionary_default = withStandardDecorators(tool58);
4447
- var inputSchema59 = {
5023
+ var search_dictionary_default = withStandardDecorators(tool70);
5024
+ var inputSchema71 = {
4448
5025
  id: z.string().uuid().describe("UUID of the dictionary item to retrieve")
4449
5026
  };
4450
- var outputSchema59 = z.object({
5027
+ var outputSchema71 = z.object({
4451
5028
  id: z.string(),
4452
5029
  name: z.string(),
4453
5030
  translations: z.array(
@@ -4458,11 +5035,11 @@ var outputSchema59 = z.object({
4458
5035
  })
4459
5036
  ).describe("All translations for this dictionary item")
4460
5037
  });
4461
- var tool59 = {
5038
+ var tool71 = {
4462
5039
  name: "get-dictionary",
4463
5040
  description: "Get a dictionary item with all its translations across languages. Shows the key name and each language's translation value.",
4464
- inputSchema: inputSchema59,
4465
- outputSchema: outputSchema59,
5041
+ inputSchema: inputSchema71,
5042
+ outputSchema: outputSchema71,
4466
5043
  slices: ["read"],
4467
5044
  annotations: { readOnlyHint: true },
4468
5045
  handler: async ({ id }) => {
@@ -4484,8 +5061,8 @@ var tool59 = {
4484
5061
  });
4485
5062
  }
4486
5063
  };
4487
- var get_dictionary_default = withStandardDecorators(tool59);
4488
- var inputSchema60 = {
5064
+ var get_dictionary_default = withStandardDecorators(tool71);
5065
+ var inputSchema72 = {
4489
5066
  name: z.string().describe("The dictionary key name"),
4490
5067
  translations: z.array(
4491
5068
  z.object({
@@ -4495,16 +5072,16 @@ var inputSchema60 = {
4495
5072
  ).describe("Translations to set for this dictionary item"),
4496
5073
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to create at the root")
4497
5074
  };
4498
- var outputSchema60 = z.object({
5075
+ var outputSchema72 = z.object({
4499
5076
  message: z.string(),
4500
5077
  id: z.string(),
4501
5078
  name: z.string()
4502
5079
  });
4503
- var tool60 = {
5080
+ var tool72 = {
4504
5081
  name: "create-dictionary",
4505
5082
  description: "Create a new dictionary item with translations. Dictionary keys typically use dot-notation (e.g. 'Header.Title', 'Buttons.ReadMore') \u2014 call list-dictionary first to avoid duplicate keys, and use update-dictionary to change translations on an existing item. Use list-languages to find valid ISO codes.",
4506
- inputSchema: inputSchema60,
4507
- outputSchema: outputSchema60,
5083
+ inputSchema: inputSchema72,
5084
+ outputSchema: outputSchema72,
4508
5085
  slices: ["create"],
4509
5086
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4510
5087
  handler: async ({ name, translations, parentId }) => {
@@ -4521,8 +5098,8 @@ var tool60 = {
4521
5098
  });
4522
5099
  }
4523
5100
  };
4524
- var create_dictionary_default = withStandardDecorators(tool60);
4525
- var inputSchema61 = {
5101
+ var create_dictionary_default = withStandardDecorators(tool72);
5102
+ var inputSchema73 = {
4526
5103
  id: z.string().uuid().describe("UUID of the dictionary item to update"),
4527
5104
  translations: z.array(
4528
5105
  z.object({
@@ -4531,17 +5108,17 @@ var inputSchema61 = {
4531
5108
  })
4532
5109
  ).describe("Translations to update. Languages not listed here will keep their existing translations.")
4533
5110
  };
4534
- var outputSchema61 = z.object({
5111
+ var outputSchema73 = z.object({
4535
5112
  message: z.string(),
4536
5113
  id: z.string(),
4537
5114
  name: z.string(),
4538
5115
  updatedLanguages: z.array(z.string()).describe("ISO codes of languages that were updated")
4539
5116
  });
4540
- var tool61 = {
5117
+ var tool73 = {
4541
5118
  name: "update-dictionary",
4542
5119
  description: "Update translations for a dictionary item. Call get-dictionary first to see existing translations.",
4543
- inputSchema: inputSchema61,
4544
- outputSchema: outputSchema61,
5120
+ inputSchema: inputSchema73,
5121
+ outputSchema: outputSchema73,
4545
5122
  slices: ["update"],
4546
5123
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4547
5124
  handler: async ({ id, translations }) => {
@@ -4573,21 +5150,21 @@ var tool61 = {
4573
5150
  });
4574
5151
  }
4575
5152
  };
4576
- var update_dictionary_default = withStandardDecorators(tool61);
4577
- var inputSchema62 = {
5153
+ var update_dictionary_default = withStandardDecorators(tool73);
5154
+ var inputSchema74 = {
4578
5155
  id: z.string().uuid().describe("UUID of the dictionary item to move"),
4579
5156
  targetParentId: z.string().uuid().optional().describe("UUID of the destination parent dictionary item, or omit to move to the root")
4580
5157
  };
4581
- var outputSchema62 = z.object({
5158
+ var outputSchema74 = z.object({
4582
5159
  message: z.string(),
4583
5160
  id: z.string(),
4584
5161
  name: z.string()
4585
5162
  });
4586
- var tool62 = {
5163
+ var tool74 = {
4587
5164
  name: "move-dictionary",
4588
5165
  description: "Move a dictionary item to a different parent in the dictionary tree, or to the root. You will be asked to confirm.",
4589
- inputSchema: inputSchema62,
4590
- outputSchema: outputSchema62,
5166
+ inputSchema: inputSchema74,
5167
+ outputSchema: outputSchema74,
4591
5168
  slices: ["move"],
4592
5169
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4593
5170
  handler: async ({ id, targetParentId }, extra) => {
@@ -4618,10 +5195,10 @@ var tool62 = {
4618
5195
  });
4619
5196
  }
4620
5197
  };
4621
- var move_dictionary_default = withStandardDecorators(tool62);
5198
+ var move_dictionary_default = withStandardDecorators(tool74);
4622
5199
 
4623
5200
  // src/umbraco-api/tools/dictionary/index.ts
4624
- var collection9 = {
5201
+ var collection10 = {
4625
5202
  metadata: {
4626
5203
  name: "dictionary",
4627
5204
  displayName: "Dictionary",
@@ -4629,13 +5206,13 @@ var collection9 = {
4629
5206
  },
4630
5207
  tools: () => [list_dictionary_default, search_dictionary_default, get_dictionary_default, create_dictionary_default, update_dictionary_default, move_dictionary_default]
4631
5208
  };
4632
- var dictionary_default = collection9;
4633
- var inputSchema63 = {
5209
+ var dictionary_default = collection10;
5210
+ var inputSchema75 = {
4634
5211
  tagGroup: z.string().optional().describe("Filter tags by group name, or omit to list all tags"),
4635
5212
  take: z.number().optional().default(50).describe("Number of tags to return"),
4636
5213
  skip: z.number().optional().default(0).describe("Number of tags to skip for pagination")
4637
5214
  };
4638
- var outputSchema63 = z.object({
5215
+ var outputSchema75 = z.object({
4639
5216
  items: z.array(
4640
5217
  z.object({
4641
5218
  id: z.number(),
@@ -4646,11 +5223,11 @@ var outputSchema63 = z.object({
4646
5223
  ).describe("Tags in use across the site"),
4647
5224
  total: z.number().describe("Total number of tags")
4648
5225
  });
4649
- var tool63 = {
5226
+ var tool75 = {
4650
5227
  name: "list-tags",
4651
5228
  description: "List tags in use across the site. Optionally filter by tag group. Shows how many content items use each tag.",
4652
- inputSchema: inputSchema63,
4653
- outputSchema: outputSchema63,
5229
+ inputSchema: inputSchema75,
5230
+ outputSchema: outputSchema75,
4654
5231
  slices: ["list"],
4655
5232
  annotations: { readOnlyHint: true },
4656
5233
  handler: async ({ tagGroup, take, skip }) => {
@@ -4667,10 +5244,10 @@ var tool63 = {
4667
5244
  });
4668
5245
  }
4669
5246
  };
4670
- var list_tags_default = withStandardDecorators(tool63);
5247
+ var list_tags_default = withStandardDecorators(tool75);
4671
5248
 
4672
5249
  // src/umbraco-api/tools/tag/index.ts
4673
- var collection10 = {
5250
+ var collection11 = {
4674
5251
  metadata: {
4675
5252
  name: "tag",
4676
5253
  displayName: "Tags",
@@ -4678,13 +5255,13 @@ var collection10 = {
4678
5255
  },
4679
5256
  tools: () => [list_tags_default]
4680
5257
  };
4681
- var tag_default = collection10;
5258
+ var tag_default = collection11;
4682
5259
  var TITLE_ALIASES = ["pageTitle", "title", "metaTitle", "seoTitle"];
4683
5260
  var META_DESC_ALIASES = ["metaDescription", "seoMetaDescription", "description"];
4684
- var inputSchema64 = {
5261
+ var inputSchema76 = {
4685
5262
  id: z.string().uuid().describe("The ID of the content page to audit")
4686
5263
  };
4687
- var outputSchema64 = z.object({
5264
+ var outputSchema76 = z.object({
4688
5265
  id: z.string().describe("Page ID"),
4689
5266
  name: z.string().describe("Page name"),
4690
5267
  url: z.string().describe("Page URL"),
@@ -4701,11 +5278,11 @@ var outputSchema64 = z.object({
4701
5278
  headings: z.array(z.object({ level: z.number(), text: z.string() })).describe("Headings found in body content"),
4702
5279
  images: z.array(z.object({ src: z.string(), alt: z.string(), hasAlt: z.boolean() })).describe("Images found in body content with alt text status")
4703
5280
  });
4704
- var tool64 = {
5281
+ var tool76 = {
4705
5282
  name: "audit-page-seo",
4706
5283
  description: "Audit a page's SEO health. Returns title, meta description, headings, images with alt text status, and word count. Includes flags for quick scanning and raw data for detailed analysis. Use with analytics data to prioritise high-traffic pages.",
4707
- inputSchema: inputSchema64,
4708
- outputSchema: outputSchema64,
5284
+ inputSchema: inputSchema76,
5285
+ outputSchema: outputSchema76,
4709
5286
  slices: ["read"],
4710
5287
  annotations: { readOnlyHint: true },
4711
5288
  handler: async ({ id }) => {
@@ -4749,13 +5326,13 @@ var tool64 = {
4749
5326
  });
4750
5327
  }
4751
5328
  };
4752
- var audit_page_seo_default = withStandardDecorators(tool64);
5329
+ var audit_page_seo_default = withStandardDecorators(tool76);
4753
5330
  var META_DESC_ALIASES2 = ["metaDescription", "seoMetaDescription", "description"];
4754
5331
  var BODY_CONTENT_MAX = 2e3;
4755
- var inputSchema65 = {
5332
+ var inputSchema77 = {
4756
5333
  id: z.string().uuid().describe("The ID of the content page to audit")
4757
5334
  };
4758
- var outputSchema65 = z.object({
5335
+ var outputSchema77 = z.object({
4759
5336
  id: z.string().describe("Page ID"),
4760
5337
  name: z.string().describe("Page name"),
4761
5338
  url: z.string().describe("Page URL"),
@@ -4766,11 +5343,11 @@ var outputSchema65 = z.object({
4766
5343
  documentType: z.string().describe("The document type name"),
4767
5344
  lastModified: z.string().describe("ISO date string of last modification")
4768
5345
  });
4769
- var tool65 = {
5346
+ var tool77 = {
4770
5347
  name: "audit-page-content",
4771
5348
  description: "Retrieve a page's body text alongside its meta description for alignment analysis. Use to identify where the meta description does not reflect the actual content. Returns the first ~2000 characters of body text.",
4772
- inputSchema: inputSchema65,
4773
- outputSchema: outputSchema65,
5349
+ inputSchema: inputSchema77,
5350
+ outputSchema: outputSchema77,
4774
5351
  slices: ["read"],
4775
5352
  annotations: { readOnlyHint: true },
4776
5353
  handler: async ({ id }) => {
@@ -4807,10 +5384,10 @@ var tool65 = {
4807
5384
  });
4808
5385
  }
4809
5386
  };
4810
- var audit_page_content_default = withStandardDecorators(tool65);
5387
+ var audit_page_content_default = withStandardDecorators(tool77);
4811
5388
 
4812
5389
  // src/umbraco-api/tools/content-health/index.ts
4813
- var collection11 = {
5390
+ var collection12 = {
4814
5391
  metadata: {
4815
5392
  name: "content-health",
4816
5393
  displayName: "Content Health",
@@ -4818,8 +5395,8 @@ var collection11 = {
4818
5395
  },
4819
5396
  tools: () => [audit_page_seo_default, audit_page_content_default]
4820
5397
  };
4821
- var content_health_default = collection11;
4822
- var inputSchema66 = {
5398
+ var content_health_default = collection12;
5399
+ var inputSchema78 = {
4823
5400
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
4824
5401
  maxDepth: z.number().optional().default(5).describe("How many levels deep to scan (default 5)")
4825
5402
  };
@@ -4834,7 +5411,7 @@ var treeNodeSchema = z.lazy(
4834
5411
  children: z.array(treeNodeSchema)
4835
5412
  })
4836
5413
  );
4837
- var outputSchema66 = z.object({
5414
+ var outputSchema78 = z.object({
4838
5415
  tree: z.array(treeNodeSchema).describe("Hierarchical site tree with children nested inside each node"),
4839
5416
  totalPages: z.number().describe("Total number of pages found across all levels"),
4840
5417
  maxDepthFound: z.number().describe("The deepest level actually found during the scan"),
@@ -4872,11 +5449,11 @@ async function buildTreeNodes(parentId, depth, maxDepth, pagesPerLevel, totalRef
4872
5449
  }
4873
5450
  return nodes;
4874
5451
  }
4875
- var tool66 = {
5452
+ var tool78 = {
4876
5453
  name: "report-site-tree-summary",
4877
5454
  description: "Full site tree structure with page counts per level. Returns hierarchical data that maps to tree diagrams, sitemaps, and flowcharts. Use maxDepth to limit how deep to scan.",
4878
- inputSchema: inputSchema66,
4879
- outputSchema: outputSchema66,
5455
+ inputSchema: inputSchema78,
5456
+ outputSchema: outputSchema78,
4880
5457
  slices: ["read"],
4881
5458
  annotations: { readOnlyHint: true },
4882
5459
  handler: async ({ parentId, maxDepth }) => {
@@ -4893,14 +5470,14 @@ var tool66 = {
4893
5470
  });
4894
5471
  }
4895
5472
  };
4896
- var report_site_tree_summary_default = withStandardDecorators(tool66);
4897
- var inputSchema67 = {
5473
+ var report_site_tree_summary_default = withStandardDecorators(tool78);
5474
+ var inputSchema79 = {
4898
5475
  depthThreshold: z.number().optional().default(4).describe("Pages deeper than this level are reported (default 4)"),
4899
5476
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
4900
5477
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
4901
5478
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
4902
5479
  };
4903
- var outputSchema67 = z.object({
5480
+ var outputSchema79 = z.object({
4904
5481
  items: z.array(
4905
5482
  z.object({
4906
5483
  id: z.string(),
@@ -4915,11 +5492,11 @@ var outputSchema67 = z.object({
4915
5492
  scannedPages: z.number().describe("Total number of pages scanned during the walk"),
4916
5493
  threshold: z.number().describe("The depth threshold used for this scan")
4917
5494
  });
4918
- var tool67 = {
5495
+ var tool79 = {
4919
5496
  name: "report-deep-pages",
4920
5497
  description: "Find pages buried more than N levels deep in the site tree. Deep pages are harder for users to find. Default threshold is 4 levels. Includes the full path to each deep page.",
4921
- inputSchema: inputSchema67,
4922
- outputSchema: outputSchema67,
5498
+ inputSchema: inputSchema79,
5499
+ outputSchema: outputSchema79,
4923
5500
  slices: ["read"],
4924
5501
  annotations: { readOnlyHint: true },
4925
5502
  handler: async ({ depthThreshold, parentId, take, skip }) => {
@@ -4963,10 +5540,10 @@ var tool67 = {
4963
5540
  });
4964
5541
  }
4965
5542
  };
4966
- var report_deep_pages_default = withStandardDecorators(tool67);
5543
+ var report_deep_pages_default = withStandardDecorators(tool79);
4967
5544
 
4968
5545
  // src/umbraco-api/tools/site-structure/index.ts
4969
- var collection12 = {
5546
+ var collection13 = {
4970
5547
  metadata: {
4971
5548
  name: "site-structure",
4972
5549
  displayName: "Site Structure",
@@ -4974,12 +5551,12 @@ var collection12 = {
4974
5551
  },
4975
5552
  tools: () => [report_site_tree_summary_default, report_deep_pages_default]
4976
5553
  };
4977
- var site_structure_default = collection12;
4978
- var inputSchema68 = {
5554
+ var site_structure_default = collection13;
5555
+ var inputSchema80 = {
4979
5556
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to publish (max 10)"),
4980
5557
  includeDescendants: z.boolean().optional().default(false).describe("Whether to also publish all child pages of each page")
4981
5558
  };
4982
- var outputSchema68 = z.object({
5559
+ var outputSchema80 = z.object({
4983
5560
  message: z.string(),
4984
5561
  results: z.array(z.object({
4985
5562
  id: z.string(),
@@ -4993,11 +5570,11 @@ var outputSchema68 = z.object({
4993
5570
  failureCount: z.number(),
4994
5571
  skippedCount: z.number()
4995
5572
  });
4996
- var tool68 = {
5573
+ var tool80 = {
4997
5574
  name: "bulk-publish",
4998
5575
  description: "Publish multiple pages at once (max 10). Lists all page names for confirmation. Each result includes a previousVersionId for rollback. Use search-content or list-children to find page IDs first.",
4999
- inputSchema: inputSchema68,
5000
- outputSchema: outputSchema68,
5576
+ inputSchema: inputSchema80,
5577
+ outputSchema: outputSchema80,
5001
5578
  slices: ["publish"],
5002
5579
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5003
5580
  handler: async ({ ids, includeDescendants }, extra) => {
@@ -5049,11 +5626,11 @@ ${nameList}`;
5049
5626
  return createToolResult(buildBulkOutput("Published", results));
5050
5627
  }
5051
5628
  };
5052
- var bulk_publish_default = withStandardDecorators(tool68);
5053
- var inputSchema69 = {
5629
+ var bulk_publish_default = withStandardDecorators(tool80);
5630
+ var inputSchema81 = {
5054
5631
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to unpublish (max 10)")
5055
5632
  };
5056
- var outputSchema69 = z.object({
5633
+ var outputSchema81 = z.object({
5057
5634
  message: z.string(),
5058
5635
  results: z.array(z.object({
5059
5636
  id: z.string(),
@@ -5067,11 +5644,11 @@ var outputSchema69 = z.object({
5067
5644
  failureCount: z.number(),
5068
5645
  skippedCount: z.number()
5069
5646
  });
5070
- var tool69 = {
5647
+ var tool81 = {
5071
5648
  name: "bulk-unpublish",
5072
5649
  description: "Take multiple pages offline at once (max 10). Pages will remain as drafts. Lists all page names for confirmation. Each result includes a previousVersionId for rollback.",
5073
- inputSchema: inputSchema69,
5074
- outputSchema: outputSchema69,
5650
+ inputSchema: inputSchema81,
5651
+ outputSchema: outputSchema81,
5075
5652
  slices: ["publish"],
5076
5653
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5077
5654
  handler: async ({ ids }, extra) => {
@@ -5127,7 +5704,7 @@ ${nameList}`;
5127
5704
  return createToolResult(buildBulkOutput("Unpublished", results));
5128
5705
  }
5129
5706
  };
5130
- var bulk_unpublish_default = withStandardDecorators(tool69);
5707
+ var bulk_unpublish_default = withStandardDecorators(tool81);
5131
5708
 
5132
5709
  // src/umbraco-api/tools/helpers/format-date.ts
5133
5710
  function formatDate(iso) {
@@ -5141,11 +5718,11 @@ function formatDate(iso) {
5141
5718
  }
5142
5719
 
5143
5720
  // src/umbraco-api/tools/bulk-operations/post/bulk-schedule-publish.ts
5144
- var inputSchema70 = {
5721
+ var inputSchema82 = {
5145
5722
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to schedule for publishing (max 10)"),
5146
5723
  publishDate: z.string().datetime().describe("The future date and time to publish the pages, in ISO 8601 format (e.g. 2026-06-01T09:00:00Z). Must be in the future.")
5147
5724
  };
5148
- var outputSchema70 = z.object({
5725
+ var outputSchema82 = z.object({
5149
5726
  message: z.string(),
5150
5727
  results: z.array(z.object({
5151
5728
  id: z.string(),
@@ -5159,11 +5736,11 @@ var outputSchema70 = z.object({
5159
5736
  failureCount: z.number(),
5160
5737
  skippedCount: z.number()
5161
5738
  });
5162
- var tool70 = {
5739
+ var tool82 = {
5163
5740
  name: "bulk-schedule-publish",
5164
5741
  description: "Schedule multiple pages to publish at a future date (max 10). Provide the date in ISO 8601 format. Lists all page names and the scheduled date for confirmation.",
5165
- inputSchema: inputSchema70,
5166
- outputSchema: outputSchema70,
5742
+ inputSchema: inputSchema82,
5743
+ outputSchema: outputSchema82,
5167
5744
  slices: ["publish"],
5168
5745
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5169
5746
  handler: async ({ ids, publishDate }, extra) => {
@@ -5208,15 +5785,15 @@ ${nameList}`;
5208
5785
  return createToolResult(buildBulkOutput("Scheduled", results));
5209
5786
  }
5210
5787
  };
5211
- var bulk_schedule_publish_default = withStandardDecorators(tool70);
5212
- var inputSchema71 = {
5788
+ var bulk_schedule_publish_default = withStandardDecorators(tool82);
5789
+ var inputSchema83 = {
5213
5790
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5214
5791
  alias: z.string().describe("The property alias to set (call get-page first to verify it exists on the document type)"),
5215
5792
  value: z.any().describe("The value to set on the property"),
5216
5793
  culture: z.string().optional().describe("The culture code for variant content (omit for invariant properties)"),
5217
5794
  segment: z.string().optional().describe("The segment for segmented content (omit if not using segments)")
5218
5795
  };
5219
- var outputSchema71 = z.object({
5796
+ var outputSchema83 = z.object({
5220
5797
  message: z.string(),
5221
5798
  results: z.array(z.object({
5222
5799
  id: z.string(),
@@ -5231,11 +5808,11 @@ var outputSchema71 = z.object({
5231
5808
  failureCount: z.number(),
5232
5809
  skippedCount: z.number()
5233
5810
  });
5234
- var tool71 = {
5811
+ var tool83 = {
5235
5812
  name: "bulk-set-property",
5236
5813
  description: "Set the same property value on multiple pages at once (max 10). Call get-page first to verify the property alias exists. For non-string non-block property values (media pickers, content/multi-node pickers, image cropper, slider, color, date, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. For block-shaped values use bulk-set-block-property (or the per-page block tools \u2014 add-blocklist-block / add-blockgrid-block / add-rte-block / edit-block) instead of hand-constructing the JSON here. Lists all page names and the property change for confirmation. Each successful result includes a previousVersionId for rollback, a previewUrl (draft preview after the change), and a `validation` outcome \u2014 if `valid` is false the changes were saved but the page cannot be published until the listed errors are resolved.",
5237
- inputSchema: inputSchema71,
5238
- outputSchema: outputSchema71,
5814
+ inputSchema: inputSchema83,
5815
+ outputSchema: outputSchema83,
5239
5816
  slices: ["update"],
5240
5817
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5241
5818
  handler: async ({ ids, alias, value, culture, segment }, extra) => {
@@ -5282,12 +5859,12 @@ ${nameList}`;
5282
5859
  return createToolResult(buildBulkOutput("Updated", results));
5283
5860
  }
5284
5861
  };
5285
- var bulk_set_property_default = withStandardDecorators(tool71);
5286
- var inputSchema72 = {
5862
+ var bulk_set_property_default = withStandardDecorators(tool83);
5863
+ var inputSchema84 = {
5287
5864
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to move (max 10)"),
5288
5865
  targetParentId: z.string().uuid().describe("The ID of the destination parent page to move the pages into")
5289
5866
  };
5290
- var outputSchema72 = z.object({
5867
+ var outputSchema84 = z.object({
5291
5868
  message: z.string(),
5292
5869
  results: z.array(z.object({
5293
5870
  id: z.string(),
@@ -5301,11 +5878,11 @@ var outputSchema72 = z.object({
5301
5878
  failureCount: z.number(),
5302
5879
  skippedCount: z.number()
5303
5880
  });
5304
- var tool72 = {
5881
+ var tool84 = {
5305
5882
  name: "bulk-move",
5306
5883
  description: "Move multiple pages to a new parent location (max 10). Shows each page name and target location for confirmation. Restructuring the site tree is hard to undo \u2014 review carefully. Note: previousVersionId in results is for content rollback only and cannot undo a move.",
5307
- inputSchema: inputSchema72,
5308
- outputSchema: outputSchema72,
5884
+ inputSchema: inputSchema84,
5885
+ outputSchema: outputSchema84,
5309
5886
  slices: ["move"],
5310
5887
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5311
5888
  handler: async ({ ids, targetParentId }, extra) => {
@@ -5358,8 +5935,8 @@ ${nameList}`;
5358
5935
  return createToolResult(buildBulkOutput("Moved", results));
5359
5936
  }
5360
5937
  };
5361
- var bulk_move_default = withStandardDecorators(tool72);
5362
- var inputSchema73 = {
5938
+ var bulk_move_default = withStandardDecorators(tool84);
5939
+ var inputSchema85 = {
5363
5940
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5364
5941
  contentTypeKey: z.string().uuid().describe("The block element type key to target. Use inspect-blocks to find this."),
5365
5942
  propertyAlias: z.string().describe("The document property alias containing the blocks (e.g. 'contentRows'). Use inspect-blocks to find this."),
@@ -5370,7 +5947,7 @@ var inputSchema73 = {
5370
5947
  culture: z.string().nullable().optional().describe("Culture code if the document property is variant"),
5371
5948
  segment: z.string().nullable().optional().describe("Segment if the document property is variant")
5372
5949
  };
5373
- var outputSchema73 = z.object({
5950
+ var outputSchema85 = z.object({
5374
5951
  message: z.string(),
5375
5952
  results: z.array(z.object({
5376
5953
  id: z.string(),
@@ -5387,10 +5964,10 @@ var outputSchema73 = z.object({
5387
5964
  skippedCount: z.number(),
5388
5965
  totalBlocksUpdated: z.number()
5389
5966
  });
5390
- function isBlockListOrGridValue3(value) {
5967
+ function isBlockListOrGridValue2(value) {
5391
5968
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
5392
5969
  }
5393
- function isRteWithBlocks3(value) {
5970
+ function isRteWithBlocks2(value) {
5394
5971
  return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && value.blocks !== null && typeof value.blocks === "object" && Array.isArray(value.blocks?.contentData);
5395
5972
  }
5396
5973
  function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
@@ -5398,18 +5975,18 @@ function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
5398
5975
  const prop = allValues.find((v) => v.alias === propertyAlias);
5399
5976
  if (!prop) return [];
5400
5977
  let contentData = [];
5401
- if (isBlockListOrGridValue3(prop.value)) {
5978
+ if (isBlockListOrGridValue2(prop.value)) {
5402
5979
  contentData = prop.value.contentData;
5403
- } else if (isRteWithBlocks3(prop.value)) {
5980
+ } else if (isRteWithBlocks2(prop.value)) {
5404
5981
  contentData = prop.value.blocks.contentData;
5405
5982
  }
5406
5983
  return contentData.filter((block) => block.contentTypeKey === contentTypeKey).map((block) => ({ contentKey: block.key ?? "" })).filter((b) => b.contentKey !== "");
5407
5984
  }
5408
- var tool73 = {
5985
+ var tool85 = {
5409
5986
  name: "bulk-set-block-property",
5410
5987
  description: "Update properties on blocks of a specific type across multiple pages (max 10). Targets all blocks matching the given element type within the specified property. Use inspect-blocks first on a sample page to find contentTypeKey and propertyAlias. For non-string property values inside the block (media pickers, content pickers, image cropper, slider, color, date, etc.) call get-property-value-template with the editor alias first to see the expected JSON shape. Changes are saved but NOT published. You will be asked to confirm before updating. Each successful per-page result includes a previewUrl (parent page draft preview) and a `validation` outcome \u2014 if `valid` is false the changes were saved but the page cannot be published until the listed errors are resolved.",
5411
- inputSchema: inputSchema73,
5412
- outputSchema: outputSchema73,
5988
+ inputSchema: inputSchema85,
5989
+ outputSchema: outputSchema85,
5413
5990
  slices: ["update"],
5414
5991
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5415
5992
  handler: async ({ ids, contentTypeKey, propertyAlias, values, culture, segment }, extra) => {
@@ -5547,10 +6124,10 @@ Changes will be saved but not published.`;
5547
6124
  });
5548
6125
  }
5549
6126
  };
5550
- var bulk_set_block_property_default = withStandardDecorators(tool73);
6127
+ var bulk_set_block_property_default = withStandardDecorators(tool85);
5551
6128
 
5552
6129
  // src/umbraco-api/tools/bulk-operations/index.ts
5553
- var collection13 = {
6130
+ var collection14 = {
5554
6131
  metadata: {
5555
6132
  name: "bulk-operations",
5556
6133
  displayName: "Bulk Operations",
@@ -5558,7 +6135,7 @@ var collection13 = {
5558
6135
  },
5559
6136
  tools: () => [bulk_publish_default, bulk_unpublish_default, bulk_schedule_publish_default, bulk_set_property_default, bulk_move_default, bulk_set_block_property_default]
5560
6137
  };
5561
- var bulk_operations_default = collection13;
6138
+ var bulk_operations_default = collection14;
5562
6139
 
5563
6140
  // src/umbraco-api/tools/member-reporting/get/member-type-helper.ts
5564
6141
  function memberTypeToString(memberType) {
@@ -5572,12 +6149,12 @@ function memberTypeToString(memberType) {
5572
6149
  }
5573
6150
 
5574
6151
  // src/umbraco-api/tools/member/get/search-members.ts
5575
- var inputSchema74 = {
6152
+ var inputSchema86 = {
5576
6153
  query: z.string().describe("Search term to find members by name or email address"),
5577
6154
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
5578
6155
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5579
6156
  };
5580
- var outputSchema74 = z.object({
6157
+ var outputSchema86 = z.object({
5581
6158
  items: z.array(z.object({
5582
6159
  id: z.string(),
5583
6160
  name: z.string(),
@@ -5588,11 +6165,11 @@ var outputSchema74 = z.object({
5588
6165
  })).describe("Matching members"),
5589
6166
  total: z.number().describe("Total number of matches")
5590
6167
  });
5591
- var tool74 = {
6168
+ var tool86 = {
5592
6169
  name: "search-members",
5593
6170
  description: "Search for members by name or email address. Returns matching members with their approval and lockout status. Use get-member for full profile details.",
5594
- inputSchema: inputSchema74,
5595
- outputSchema: outputSchema74,
6171
+ inputSchema: inputSchema86,
6172
+ outputSchema: outputSchema86,
5596
6173
  slices: ["search"],
5597
6174
  annotations: { readOnlyHint: true },
5598
6175
  handler: async ({ query, take, skip }) => {
@@ -5612,7 +6189,7 @@ var tool74 = {
5612
6189
  });
5613
6190
  }
5614
6191
  };
5615
- var search_members_default = withStandardDecorators(tool74);
6192
+ var search_members_default = withStandardDecorators(tool86);
5616
6193
 
5617
6194
  // src/umbraco-api/tools/member/sensitive-data-access.ts
5618
6195
  var cachedAccess;
@@ -5624,10 +6201,10 @@ async function hasSensitiveDataAccess() {
5624
6201
  }
5625
6202
 
5626
6203
  // src/umbraco-api/tools/member/get/get-member.ts
5627
- var inputSchema75 = {
6204
+ var inputSchema87 = {
5628
6205
  id: z.string().uuid().describe("The ID of the member to retrieve")
5629
6206
  };
5630
- var outputSchema75 = z.object({
6207
+ var outputSchema87 = z.object({
5631
6208
  id: z.string(),
5632
6209
  name: z.string(),
5633
6210
  email: z.string(),
@@ -5647,11 +6224,11 @@ var outputSchema75 = z.object({
5647
6224
  lastPasswordChangeDate: z.string().nullable(),
5648
6225
  sensitiveDataAccessible: z.boolean().describe("Whether the calling API user can see real values for isApproved / isLockedOut / isTwoFactorEnabled / lastLoginDate. False means those fields are null in this response \u2014 grant Sensitive Data group access to the API user to see them.")
5649
6226
  });
5650
- var tool75 = {
6227
+ var tool87 = {
5651
6228
  name: "get-member",
5652
6229
  description: "Get the full profile of a member including their groups, properties, approval status, and login history.",
5653
- inputSchema: inputSchema75,
5654
- outputSchema: outputSchema75,
6230
+ inputSchema: inputSchema87,
6231
+ outputSchema: outputSchema87,
5655
6232
  slices: ["read"],
5656
6233
  annotations: { readOnlyHint: true },
5657
6234
  handler: async ({ id }) => {
@@ -5676,12 +6253,12 @@ var tool75 = {
5676
6253
  });
5677
6254
  }
5678
6255
  };
5679
- var get_member_default = withStandardDecorators(tool75);
5680
- var inputSchema76 = {
6256
+ var get_member_default = withStandardDecorators(tool87);
6257
+ var inputSchema88 = {
5681
6258
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
5682
6259
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5683
6260
  };
5684
- var outputSchema76 = z.object({
6261
+ var outputSchema88 = z.object({
5685
6262
  items: z.array(z.object({
5686
6263
  id: z.string(),
5687
6264
  alias: z.string(),
@@ -5689,11 +6266,11 @@ var outputSchema76 = z.object({
5689
6266
  })).describe("Available member types"),
5690
6267
  total: z.number().describe("Total number of member types")
5691
6268
  });
5692
- var tool76 = {
6269
+ var tool88 = {
5693
6270
  name: "list-member-types",
5694
6271
  description: "List available member types. Use this before create-member to find a valid member type ID.",
5695
- inputSchema: inputSchema76,
5696
- outputSchema: outputSchema76,
6272
+ inputSchema: inputSchema88,
6273
+ outputSchema: outputSchema88,
5697
6274
  slices: ["list"],
5698
6275
  annotations: { readOnlyHint: true },
5699
6276
  handler: async ({ take, skip }) => {
@@ -5709,8 +6286,8 @@ var tool76 = {
5709
6286
  });
5710
6287
  }
5711
6288
  };
5712
- var list_member_types_default = withStandardDecorators(tool76);
5713
- var inputSchema77 = {
6289
+ var list_member_types_default = withStandardDecorators(tool88);
6290
+ var inputSchema89 = {
5714
6291
  email: z.string().email().describe("The email address for the new member"),
5715
6292
  username: z.string().describe("The username for the new member"),
5716
6293
  name: z.string().describe("The display name for the new member"),
@@ -5723,17 +6300,17 @@ var inputSchema77 = {
5723
6300
  value: z.any().describe("The property value")
5724
6301
  })).optional().describe("Custom property values to set on the new member")
5725
6302
  };
5726
- var outputSchema77 = z.object({
6303
+ var outputSchema89 = z.object({
5727
6304
  message: z.string(),
5728
6305
  id: z.string(),
5729
6306
  name: z.string(),
5730
6307
  email: z.string()
5731
6308
  });
5732
- var tool77 = {
6309
+ var tool89 = {
5733
6310
  name: "create-member",
5734
6311
  description: "Create a new member account. Use update-member to change details on an existing member \u2014 search-members first if unsure whether the email or username is already taken. Call list-member-types to find a valid memberTypeId and list-member-groups for group IDs.",
5735
- inputSchema: inputSchema77,
5736
- outputSchema: outputSchema77,
6312
+ inputSchema: inputSchema89,
6313
+ outputSchema: outputSchema89,
5737
6314
  slices: ["create"],
5738
6315
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
5739
6316
  handler: async ({ email, username, name, password, memberTypeId, isApproved, groups, values }) => {
@@ -5787,8 +6364,8 @@ var tool77 = {
5787
6364
  });
5788
6365
  }
5789
6366
  };
5790
- var create_member_default = withStandardDecorators(tool77);
5791
- var inputSchema78 = {
6367
+ var create_member_default = withStandardDecorators(tool89);
6368
+ var inputSchema90 = {
5792
6369
  id: z.string().uuid().describe("The ID of the member to update"),
5793
6370
  name: z.string().optional().describe("The new display name for the member"),
5794
6371
  email: z.string().email().optional().describe("The new email address for the member"),
@@ -5803,17 +6380,17 @@ var inputSchema78 = {
5803
6380
  value: z.any().describe("The new property value")
5804
6381
  })).optional().describe("Custom property values to update")
5805
6382
  };
5806
- var outputSchema78 = z.object({
6383
+ var outputSchema90 = z.object({
5807
6384
  message: z.string(),
5808
6385
  id: z.string(),
5809
6386
  name: z.string(),
5810
6387
  email: z.string()
5811
6388
  });
5812
- var tool78 = {
6389
+ var tool90 = {
5813
6390
  name: "update-member",
5814
6391
  description: "Update a member's profile, credentials (username / password / 2FA toggle), approval status, groups, or custom properties. Call get-member first to see current values. Password resets require an extra confirmation.",
5815
- inputSchema: inputSchema78,
5816
- outputSchema: outputSchema78,
6392
+ inputSchema: inputSchema90,
6393
+ outputSchema: outputSchema90,
5817
6394
  slices: ["update"],
5818
6395
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5819
6396
  handler: async ({ id, name, email, username, newPassword, isTwoFactorEnabled, isApproved, isLockedOut, groups, values }, extra) => {
@@ -5865,21 +6442,21 @@ var tool78 = {
5865
6442
  });
5866
6443
  }
5867
6444
  };
5868
- var update_member_default = withStandardDecorators(tool78);
5869
- var inputSchema79 = {
6445
+ var update_member_default = withStandardDecorators(tool90);
6446
+ var inputSchema91 = {
5870
6447
  id: z.string().uuid().describe("The ID of the member to permanently delete")
5871
6448
  };
5872
- var outputSchema79 = z.object({
6449
+ var outputSchema91 = z.object({
5873
6450
  message: z.string(),
5874
6451
  id: z.string(),
5875
6452
  name: z.string(),
5876
6453
  email: z.string()
5877
6454
  });
5878
- var tool79 = {
6455
+ var tool91 = {
5879
6456
  name: "delete-member",
5880
6457
  description: "Permanently delete a member. This cannot be undone \u2014 there is no recycle bin for members. You will be asked to confirm.",
5881
- inputSchema: inputSchema79,
5882
- outputSchema: outputSchema79,
6458
+ inputSchema: inputSchema91,
6459
+ outputSchema: outputSchema91,
5883
6460
  slices: ["delete"],
5884
6461
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5885
6462
  handler: async ({ id }, extra) => {
@@ -5901,10 +6478,10 @@ var tool79 = {
5901
6478
  });
5902
6479
  }
5903
6480
  };
5904
- var delete_member_default = withStandardDecorators(tool79);
6481
+ var delete_member_default = withStandardDecorators(tool91);
5905
6482
 
5906
6483
  // src/umbraco-api/tools/member/index.ts
5907
- var collection14 = {
6484
+ var collection15 = {
5908
6485
  metadata: {
5909
6486
  name: "member",
5910
6487
  displayName: "Members",
@@ -5912,23 +6489,23 @@ var collection14 = {
5912
6489
  },
5913
6490
  tools: () => [search_members_default, get_member_default, list_member_types_default, create_member_default, update_member_default, delete_member_default]
5914
6491
  };
5915
- var member_default = collection14;
5916
- var inputSchema80 = {
6492
+ var member_default = collection15;
6493
+ var inputSchema92 = {
5917
6494
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
5918
6495
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5919
6496
  };
5920
- var outputSchema80 = z.object({
6497
+ var outputSchema92 = z.object({
5921
6498
  items: z.array(z.object({
5922
6499
  id: z.string(),
5923
6500
  name: z.string()
5924
6501
  })).describe("Member groups"),
5925
6502
  total: z.number().describe("Total number of member groups")
5926
6503
  });
5927
- var tool80 = {
6504
+ var tool92 = {
5928
6505
  name: "list-member-groups",
5929
6506
  description: "List all member groups. Use group names when creating or updating members to assign them to groups.",
5930
- inputSchema: inputSchema80,
5931
- outputSchema: outputSchema80,
6507
+ inputSchema: inputSchema92,
6508
+ outputSchema: outputSchema92,
5932
6509
  slices: ["list"],
5933
6510
  annotations: { readOnlyHint: true },
5934
6511
  handler: async ({ take, skip }) => {
@@ -5944,20 +6521,20 @@ var tool80 = {
5944
6521
  });
5945
6522
  }
5946
6523
  };
5947
- var list_member_groups_default = withStandardDecorators(tool80);
5948
- var inputSchema81 = {
6524
+ var list_member_groups_default = withStandardDecorators(tool92);
6525
+ var inputSchema93 = {
5949
6526
  name: z.string().describe("The name of the new member group")
5950
6527
  };
5951
- var outputSchema81 = z.object({
6528
+ var outputSchema93 = z.object({
5952
6529
  message: z.string(),
5953
6530
  id: z.string(),
5954
6531
  name: z.string()
5955
6532
  });
5956
- var tool81 = {
6533
+ var tool93 = {
5957
6534
  name: "create-member-group",
5958
6535
  description: "Create a new member group. Groups are referenced by name when assigning members via create-member or update-member. Use list-member-groups to check existing groups first.",
5959
- inputSchema: inputSchema81,
5960
- outputSchema: outputSchema81,
6536
+ inputSchema: inputSchema93,
6537
+ outputSchema: outputSchema93,
5961
6538
  slices: ["create"],
5962
6539
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
5963
6540
  handler: async ({ name }) => {
@@ -5970,20 +6547,20 @@ var tool81 = {
5970
6547
  });
5971
6548
  }
5972
6549
  };
5973
- var create_member_group_default = withStandardDecorators(tool81);
5974
- var inputSchema82 = {
6550
+ var create_member_group_default = withStandardDecorators(tool93);
6551
+ var inputSchema94 = {
5975
6552
  id: z.string().uuid().describe("The ID of the member group to delete")
5976
6553
  };
5977
- var outputSchema82 = z.object({
6554
+ var outputSchema94 = z.object({
5978
6555
  message: z.string(),
5979
6556
  id: z.string(),
5980
6557
  name: z.string()
5981
6558
  });
5982
- var tool82 = {
6559
+ var tool94 = {
5983
6560
  name: "delete-member-group",
5984
6561
  description: "Delete a member group. Members in this group will lose the group assignment. You will be asked to confirm.",
5985
- inputSchema: inputSchema82,
5986
- outputSchema: outputSchema82,
6562
+ inputSchema: inputSchema94,
6563
+ outputSchema: outputSchema94,
5987
6564
  slices: ["delete"],
5988
6565
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5989
6566
  handler: async ({ id }, extra) => {
@@ -6004,10 +6581,10 @@ var tool82 = {
6004
6581
  });
6005
6582
  }
6006
6583
  };
6007
- var delete_member_group_default = withStandardDecorators(tool82);
6584
+ var delete_member_group_default = withStandardDecorators(tool94);
6008
6585
 
6009
6586
  // src/umbraco-api/tools/member-group/index.ts
6010
- var collection15 = {
6587
+ var collection16 = {
6011
6588
  metadata: {
6012
6589
  name: "member-group",
6013
6590
  displayName: "Member Groups",
@@ -6015,74 +6592,82 @@ var collection15 = {
6015
6592
  },
6016
6593
  tools: () => [list_member_groups_default, create_member_group_default, delete_member_group_default]
6017
6594
  };
6018
- var member_group_default = collection15;
6019
- var inputSchema83 = {};
6020
- var outputSchema83 = z.object({
6021
- totalMembers: z.number().describe("Total number of members across all types and groups"),
6595
+ var member_group_default = collection16;
6596
+ var inputSchema95 = {};
6597
+ var outputSchema95 = z.object({
6598
+ totalMembers: z.number().describe("Total number of members across all types and groups (exact, server-reported \u2014 not capped by the sample)."),
6022
6599
  byType: z.array(z.object({
6023
6600
  memberType: z.string().describe("Member type alias or name"),
6024
6601
  count: z.number()
6025
- })).describe("Member counts grouped by member type. Maps naturally to a pie or bar chart."),
6602
+ })).describe("Member counts grouped by member type, computed from a sample of up to 500 members \u2014 may undercount byType on larger sites (byType counts can sum to less than totalMembers). Maps naturally to a pie or bar chart."),
6026
6603
  byGroup: z.array(z.object({
6027
6604
  group: z.string().describe("Member group name"),
6028
6605
  count: z.number()
6029
- })).describe("Member counts grouped by member group. Members with no group are excluded.")
6606
+ })).describe("Member counts grouped by member group \u2014 exact, server-reported per-group totals (uncapped). Members with no group are excluded.")
6030
6607
  });
6031
6608
  var PAGE_SIZE = 100;
6032
6609
  var MEMBER_CAP = 500;
6033
- var tool83 = {
6610
+ var tool95 = {
6034
6611
  name: "report-member-count",
6035
- description: "Returns a breakdown of member counts by type and group. Analyses up to 500 members \u2014 results may be incomplete on larger sites. Data maps naturally to pie or bar charts.",
6036
- inputSchema: inputSchema83,
6037
- outputSchema: outputSchema83,
6612
+ description: "Returns a breakdown of member counts by type and group. totalMembers and the byGroup counts are exact (server-reported, uncapped); the byType breakdown is computed from a sample of up to 500 members, so it may undercount on larger sites. Data maps naturally to pie or bar charts.",
6613
+ inputSchema: inputSchema95,
6614
+ outputSchema: outputSchema95,
6038
6615
  slices: ["read"],
6039
6616
  annotations: { readOnlyHint: true },
6040
6617
  handler: async () => {
6041
- const allMembers = [];
6618
+ const sampledMembers = [];
6619
+ let totalMembers = 0;
6042
6620
  let cursor = encodeCursor({ s: 0, t: PAGE_SIZE });
6043
- while (allMembers.length < MEMBER_CAP) {
6621
+ while (sampledMembers.length < MEMBER_CAP) {
6044
6622
  const result = await chainCms("find-member", { cursor, orderBy: "username" });
6045
6623
  if (!result.ok) return result.errorResult;
6046
6624
  const data = result.data;
6047
6625
  const items = data.items ?? [];
6048
- allMembers.push(...items);
6626
+ if (typeof data.total === "number") totalMembers = data.total;
6627
+ sampledMembers.push(...items);
6049
6628
  const nextCursor = data.nextCursor;
6050
6629
  if (!nextCursor || items.length === 0) break;
6051
6630
  cursor = nextCursor;
6052
6631
  }
6632
+ if (totalMembers === 0 && sampledMembers.length > 0) totalMembers = sampledMembers.length;
6053
6633
  const typeCounts = /* @__PURE__ */ new Map();
6054
- for (const member of allMembers) {
6634
+ for (const member of sampledMembers) {
6055
6635
  const memberType = memberTypeToString(member.memberType);
6056
6636
  typeCounts.set(memberType, (typeCounts.get(memberType) ?? 0) + 1);
6057
6637
  }
6058
6638
  const groupResult = await chainCms("get-all-member-groups", {});
6059
6639
  if (!groupResult.ok) return groupResult.errorResult;
6060
6640
  const allGroups = groupResult.data.items ?? [];
6641
+ const named = allGroups.filter((g) => typeof g.name === "string");
6642
+ const perGroupResults = await Promise.all(
6643
+ named.map(
6644
+ (g) => chainCms("find-member", {
6645
+ memberGroupName: g.name,
6646
+ cursor: encodeCursor({ s: 0, t: 1 }),
6647
+ orderBy: "username"
6648
+ })
6649
+ )
6650
+ );
6061
6651
  const byGroup = [];
6062
- for (const group of allGroups) {
6063
- if (!group.name) continue;
6064
- const countResult = await chainCms("find-member", {
6065
- memberGroupName: group.name,
6066
- cursor: encodeCursor({ s: 0, t: 1 }),
6067
- orderBy: "username"
6068
- });
6069
- if (!countResult.ok) return countResult.errorResult;
6070
- byGroup.push({ group: group.name, count: countResult.data.total ?? 0 });
6652
+ for (let i = 0; i < named.length; i++) {
6653
+ const r = perGroupResults[i];
6654
+ if (!r.ok) return r.errorResult;
6655
+ byGroup.push({ group: named[i].name, count: r.data.total ?? 0 });
6071
6656
  }
6072
6657
  return createToolResult({
6073
- totalMembers: allMembers.length,
6658
+ totalMembers,
6074
6659
  byType: Array.from(typeCounts.entries()).map(([memberType, count]) => ({ memberType, count })).sort((a, b) => b.count - a.count),
6075
6660
  byGroup: byGroup.sort((a, b) => b.count - a.count)
6076
6661
  });
6077
6662
  }
6078
6663
  };
6079
- var report_member_count_default = withStandardDecorators(tool83);
6080
- var inputSchema84 = {
6664
+ var report_member_count_default = withStandardDecorators(tool95);
6665
+ var inputSchema96 = {
6081
6666
  groupName: z.string().describe("The name of the member group to filter by. Use list-member-groups to find valid group names."),
6082
6667
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6083
6668
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6084
6669
  };
6085
- var outputSchema84 = z.object({
6670
+ var outputSchema96 = z.object({
6086
6671
  groupName: z.string().describe("The group name used for this query"),
6087
6672
  items: z.array(z.object({
6088
6673
  id: z.string(),
@@ -6093,11 +6678,11 @@ var outputSchema84 = z.object({
6093
6678
  })).describe("Members belonging to the specified group"),
6094
6679
  total: z.number().describe("Total number of members in this group")
6095
6680
  });
6096
- var tool84 = {
6681
+ var tool96 = {
6097
6682
  name: "report-members-by-group",
6098
6683
  description: "List members belonging to a specific group. Use list-member-groups to find valid group names.",
6099
- inputSchema: inputSchema84,
6100
- outputSchema: outputSchema84,
6684
+ inputSchema: inputSchema96,
6685
+ outputSchema: outputSchema96,
6101
6686
  slices: ["read"],
6102
6687
  annotations: { readOnlyHint: true },
6103
6688
  handler: async ({ groupName, take, skip }) => {
@@ -6113,8 +6698,9 @@ var tool84 = {
6113
6698
  detail: `No member group named "${groupName}". Use list-member-groups to see existing group names.`
6114
6699
  });
6115
6700
  }
6701
+ const canonicalGroupName = groupMatch.name ?? groupName;
6116
6702
  const result = await chainCms("find-member", {
6117
- memberGroupName: groupMatch.name,
6703
+ memberGroupName: canonicalGroupName,
6118
6704
  cursor: buildChainedCursor(skip, take),
6119
6705
  orderBy: "username"
6120
6706
  });
@@ -6133,13 +6719,13 @@ var tool84 = {
6133
6719
  });
6134
6720
  }
6135
6721
  };
6136
- var report_members_by_group_default = withStandardDecorators(tool84);
6137
- var inputSchema85 = {
6722
+ var report_members_by_group_default = withStandardDecorators(tool96);
6723
+ var inputSchema97 = {
6138
6724
  inactiveDays: z.number().optional().default(90).describe("Number of days without a login before a member is considered inactive (default 90)"),
6139
6725
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
6140
6726
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6141
6727
  };
6142
- var outputSchema85 = z.object({
6728
+ var outputSchema97 = z.object({
6143
6729
  items: z.array(z.object({
6144
6730
  id: z.string(),
6145
6731
  name: z.string(),
@@ -6154,11 +6740,11 @@ var outputSchema85 = z.object({
6154
6740
  });
6155
6741
  var PAGE_SIZE2 = 100;
6156
6742
  var MEMBER_CAP2 = 500;
6157
- var tool85 = {
6743
+ var tool97 = {
6158
6744
  name: "report-member-activity",
6159
6745
  description: "Find members who haven't logged in within a given number of days. Default threshold is 90 days. Members who have never logged in are always included. Analyses up to 500 members. Useful for identifying inactive accounts.",
6160
- inputSchema: inputSchema85,
6161
- outputSchema: outputSchema85,
6746
+ inputSchema: inputSchema97,
6747
+ outputSchema: outputSchema97,
6162
6748
  slices: ["read"],
6163
6749
  annotations: { readOnlyHint: true },
6164
6750
  handler: async ({ inactiveDays, take, skip }) => {
@@ -6212,10 +6798,10 @@ var tool85 = {
6212
6798
  });
6213
6799
  }
6214
6800
  };
6215
- var report_member_activity_default = withStandardDecorators(tool85);
6801
+ var report_member_activity_default = withStandardDecorators(tool97);
6216
6802
 
6217
6803
  // src/umbraco-api/tools/member-reporting/index.ts
6218
- var collection16 = {
6804
+ var collection17 = {
6219
6805
  metadata: {
6220
6806
  name: "member-reporting",
6221
6807
  displayName: "Member Reporting",
@@ -6223,22 +6809,22 @@ var collection16 = {
6223
6809
  },
6224
6810
  tools: () => [report_member_count_default, report_members_by_group_default, report_member_activity_default]
6225
6811
  };
6226
- var member_reporting_default = collection16;
6227
- var inputSchema86 = {
6812
+ var member_reporting_default = collection17;
6813
+ var inputSchema98 = {
6228
6814
  id: z.string().uuid().describe("The ID of the page to check publish status for")
6229
6815
  };
6230
- var outputSchema86 = z.object({
6816
+ var outputSchema98 = z.object({
6231
6817
  id: z.string(),
6232
6818
  name: z.string(),
6233
6819
  isPublished: z.boolean(),
6234
6820
  state: z.string(),
6235
6821
  variants: z.array(publishStatusVariantSchema)
6236
6822
  });
6237
- var tool86 = {
6823
+ var tool98 = {
6238
6824
  name: "get-publish-status",
6239
6825
  description: "View a page's current publish state including any scheduled publish or unpublish dates. Shows per-variant status for multilingual sites. Returns empty variants for unpublished pages.",
6240
- inputSchema: inputSchema86,
6241
- outputSchema: outputSchema86,
6826
+ inputSchema: inputSchema98,
6827
+ outputSchema: outputSchema98,
6242
6828
  slices: ["read"],
6243
6829
  annotations: { readOnlyHint: true },
6244
6830
  handler: async ({ id }) => {
@@ -6254,24 +6840,24 @@ var tool86 = {
6254
6840
  });
6255
6841
  }
6256
6842
  };
6257
- var get_publish_status_default = withStandardDecorators(tool86);
6258
- var inputSchema87 = {
6843
+ var get_publish_status_default = withStandardDecorators(tool98);
6844
+ var inputSchema99 = {
6259
6845
  id: z.string().uuid().describe("The ID of the page to schedule for publish"),
6260
6846
  publishDate: z.string().datetime().describe("The date and time to publish the page (ISO 8601 format, must be in the future)"),
6261
6847
  culture: z.string().optional().describe("Culture code for variant-specific scheduling (e.g. 'en-US'). Omit for invariant content.")
6262
6848
  };
6263
- var outputSchema87 = z.object({
6849
+ var outputSchema99 = z.object({
6264
6850
  message: z.string(),
6265
6851
  id: z.string(),
6266
6852
  name: z.string(),
6267
6853
  scheduledDate: z.string(),
6268
6854
  previewUrl: previewUrlSchema
6269
6855
  });
6270
- var tool87 = {
6856
+ var tool99 = {
6271
6857
  name: "schedule-publish",
6272
6858
  description: "Schedule a page to publish at a future date. Provide the date in ISO 8601 format (must be in the future). Optionally specify a culture for variant-specific scheduling. You will be asked to confirm.",
6273
- inputSchema: inputSchema87,
6274
- outputSchema: outputSchema87,
6859
+ inputSchema: inputSchema99,
6860
+ outputSchema: outputSchema99,
6275
6861
  slices: ["publish"],
6276
6862
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6277
6863
  handler: async ({ id, publishDate, culture }, extra) => {
@@ -6296,22 +6882,22 @@ var tool87 = {
6296
6882
  });
6297
6883
  }
6298
6884
  };
6299
- var schedule_publish_default = withStandardDecorators(tool87);
6300
- var inputSchema88 = {
6885
+ var schedule_publish_default = withStandardDecorators(tool99);
6886
+ var inputSchema100 = {
6301
6887
  id: z.string().uuid().describe("The ID of the page whose scheduled publish should be cancelled"),
6302
6888
  culture: z.string().optional().describe("Culture code to check for a scheduled variant (e.g. 'en-US'). Omit for invariant content.")
6303
6889
  };
6304
- var outputSchema88 = z.object({
6890
+ var outputSchema100 = z.object({
6305
6891
  message: z.string(),
6306
6892
  id: z.string(),
6307
6893
  name: z.string(),
6308
6894
  previewUrl: previewUrlSchema
6309
6895
  });
6310
- var tool88 = {
6896
+ var tool100 = {
6311
6897
  name: "cancel-schedule",
6312
6898
  description: "Cancel a pending scheduled publish for a page. Use get-publish-status to verify the page has a pending schedule. You will be asked to confirm.",
6313
- inputSchema: inputSchema88,
6314
- outputSchema: outputSchema88,
6899
+ inputSchema: inputSchema100,
6900
+ outputSchema: outputSchema100,
6315
6901
  slices: ["publish"],
6316
6902
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6317
6903
  handler: async ({ id, culture }, extra) => {
@@ -6349,10 +6935,10 @@ var tool88 = {
6349
6935
  });
6350
6936
  }
6351
6937
  };
6352
- var cancel_schedule_default = withStandardDecorators(tool88);
6938
+ var cancel_schedule_default = withStandardDecorators(tool100);
6353
6939
 
6354
6940
  // src/umbraco-api/tools/scheduling/index.ts
6355
- var collection17 = {
6941
+ var collection18 = {
6356
6942
  metadata: {
6357
6943
  name: "scheduling",
6358
6944
  displayName: "Scheduling",
@@ -6360,13 +6946,13 @@ var collection17 = {
6360
6946
  },
6361
6947
  tools: () => [get_publish_status_default, schedule_publish_default, cancel_schedule_default]
6362
6948
  };
6363
- var scheduling_default = collection17;
6364
- var inputSchema89 = {
6949
+ var scheduling_default = collection18;
6950
+ var inputSchema101 = {
6365
6951
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6366
6952
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination"),
6367
6953
  filter: z.string().optional().describe("Filter redirects by URL")
6368
6954
  };
6369
- var outputSchema89 = z.object({
6955
+ var outputSchema101 = z.object({
6370
6956
  items: z.array(
6371
6957
  z.object({
6372
6958
  id: z.string(),
@@ -6378,11 +6964,11 @@ var outputSchema89 = z.object({
6378
6964
  ).describe("URL redirects"),
6379
6965
  total: z.number().describe("Total number of redirects")
6380
6966
  });
6381
- var tool89 = {
6967
+ var tool101 = {
6382
6968
  name: "list-redirects",
6383
6969
  description: "List URL redirects configured on the site. Optionally filter by URL. Shows the original URL, destination, and whether the redirect was created automatically by Umbraco.",
6384
- inputSchema: inputSchema89,
6385
- outputSchema: outputSchema89,
6970
+ inputSchema: inputSchema101,
6971
+ outputSchema: outputSchema101,
6386
6972
  slices: ["list"],
6387
6973
  annotations: { readOnlyHint: true },
6388
6974
  handler: async ({ take, skip, filter }) => {
@@ -6404,11 +6990,11 @@ var tool89 = {
6404
6990
  });
6405
6991
  }
6406
6992
  };
6407
- var list_redirects_default = withStandardDecorators(tool89);
6408
- var inputSchema90 = {
6993
+ var list_redirects_default = withStandardDecorators(tool101);
6994
+ var inputSchema102 = {
6409
6995
  id: z.string().uuid().describe("The ID of the redirect to retrieve")
6410
6996
  };
6411
- var outputSchema90 = z.object({
6997
+ var outputSchema102 = z.object({
6412
6998
  id: z.string(),
6413
6999
  originalUrl: z.string(),
6414
7000
  destinationUrl: z.string(),
@@ -6416,11 +7002,11 @@ var outputSchema90 = z.object({
6416
7002
  isAutomatic: z.boolean(),
6417
7003
  createDate: z.string()
6418
7004
  });
6419
- var tool90 = {
7005
+ var tool102 = {
6420
7006
  name: "get-redirect",
6421
7007
  description: "View the full details of a URL redirect including when it was created and whether it was automatic. Use list-redirects to find redirect IDs.",
6422
- inputSchema: inputSchema90,
6423
- outputSchema: outputSchema90,
7008
+ inputSchema: inputSchema102,
7009
+ outputSchema: outputSchema102,
6424
7010
  slices: ["read"],
6425
7011
  annotations: { readOnlyHint: true },
6426
7012
  handler: async ({ id }) => {
@@ -6437,17 +7023,17 @@ var tool90 = {
6437
7023
  });
6438
7024
  }
6439
7025
  };
6440
- var get_redirect_default = withStandardDecorators(tool90);
6441
- var inputSchema91 = {};
6442
- var outputSchema91 = z.object({
7026
+ var get_redirect_default = withStandardDecorators(tool102);
7027
+ var inputSchema103 = {};
7028
+ var outputSchema103 = z.object({
6443
7029
  isEnabled: z.boolean(),
6444
7030
  message: z.string()
6445
7031
  });
6446
- var tool91 = {
7032
+ var tool103 = {
6447
7033
  name: "get-redirect-status",
6448
7034
  description: "Check whether automatic URL redirect tracking is enabled on the site. When enabled, Umbraco automatically creates redirects when pages are moved or renamed.",
6449
- inputSchema: inputSchema91,
6450
- outputSchema: outputSchema91,
7035
+ inputSchema: inputSchema103,
7036
+ outputSchema: outputSchema103,
6451
7037
  slices: ["read"],
6452
7038
  annotations: { readOnlyHint: true },
6453
7039
  handler: async () => {
@@ -6460,20 +7046,20 @@ var tool91 = {
6460
7046
  });
6461
7047
  }
6462
7048
  };
6463
- var get_redirect_status_default = withStandardDecorators(tool91);
6464
- var inputSchema92 = {
7049
+ var get_redirect_status_default = withStandardDecorators(tool103);
7050
+ var inputSchema104 = {
6465
7051
  id: z.string().uuid().describe("The ID of the redirect to delete")
6466
7052
  };
6467
- var outputSchema92 = z.object({
7053
+ var outputSchema104 = z.object({
6468
7054
  message: z.string(),
6469
7055
  id: z.string(),
6470
7056
  originalUrl: z.string()
6471
7057
  });
6472
- var tool92 = {
7058
+ var tool104 = {
6473
7059
  name: "delete-redirect",
6474
7060
  description: "Delete a URL redirect. Visitors following the original URL will get a 404 error. You will be asked to confirm.",
6475
- inputSchema: inputSchema92,
6476
- outputSchema: outputSchema92,
7061
+ inputSchema: inputSchema104,
7062
+ outputSchema: outputSchema104,
6477
7063
  slices: ["delete"],
6478
7064
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6479
7065
  handler: async ({ id }, extra) => {
@@ -6504,10 +7090,10 @@ var tool92 = {
6504
7090
  });
6505
7091
  }
6506
7092
  };
6507
- var delete_redirect_default = withStandardDecorators(tool92);
7093
+ var delete_redirect_default = withStandardDecorators(tool104);
6508
7094
 
6509
7095
  // src/umbraco-api/tools/redirect/index.ts
6510
- var collection18 = {
7096
+ var collection19 = {
6511
7097
  metadata: {
6512
7098
  name: "redirect",
6513
7099
  displayName: "Redirects",
@@ -6515,12 +7101,12 @@ var collection18 = {
6515
7101
  },
6516
7102
  tools: () => [list_redirects_default, get_redirect_default, get_redirect_status_default, delete_redirect_default]
6517
7103
  };
6518
- var redirect_default = collection18;
6519
- var inputSchema93 = {
7104
+ var redirect_default = collection19;
7105
+ var inputSchema105 = {
6520
7106
  id: z.string().uuid().describe("The ID of the content page or media item to look up references for"),
6521
7107
  type: z.enum(["document", "media"]).describe("Whether the ID refers to a content document or a media item")
6522
7108
  };
6523
- var outputSchema93 = z.object({
7109
+ var outputSchema105 = z.object({
6524
7110
  id: z.string(),
6525
7111
  name: z.string(),
6526
7112
  url: z.string(),
@@ -6535,11 +7121,11 @@ var outputSchema93 = z.object({
6535
7121
  ).describe("Pages that reference this item"),
6536
7122
  referenceCount: z.number().describe("Total number of pages referencing this item")
6537
7123
  });
6538
- var tool93 = {
7124
+ var tool105 = {
6539
7125
  name: "report-content-references",
6540
7126
  description: "Find which pages reference a given content page or media item. Useful before deleting or restructuring content to understand the impact.",
6541
- inputSchema: inputSchema93,
6542
- outputSchema: outputSchema93,
7127
+ inputSchema: inputSchema105,
7128
+ outputSchema: outputSchema105,
6543
7129
  slices: ["read"],
6544
7130
  annotations: { readOnlyHint: true },
6545
7131
  handler: async ({ id, type }) => {
@@ -6629,18 +7215,18 @@ var tool93 = {
6629
7215
  }
6630
7216
  }
6631
7217
  };
6632
- var report_content_references_default = withStandardDecorators(tool93);
7218
+ var report_content_references_default = withStandardDecorators(tool105);
6633
7219
 
6634
7220
  // src/umbraco-api/tools/helpers/link-extractor.ts
6635
7221
  var UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
6636
- function isBlockListOrGridValue4(value) {
7222
+ function isBlockListOrGridValue3(value) {
6637
7223
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
6638
7224
  }
6639
- function isRteWithBlocks4(value) {
7225
+ function isRteWithBlocks3(value) {
6640
7226
  return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && value.blocks !== null && typeof value.blocks === "object" && Array.isArray(value.blocks?.contentData);
6641
7227
  }
6642
7228
  function isPlainRteValue(value) {
6643
- return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks4(value);
7229
+ return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks3(value);
6644
7230
  }
6645
7231
  function extractHrefUrls(html) {
6646
7232
  const urls = [];
@@ -6750,7 +7336,7 @@ function extractLinksFromValues(values) {
6750
7336
  return;
6751
7337
  }
6752
7338
  if (typeof val === "object") {
6753
- if (isRteWithBlocks4(val)) {
7339
+ if (isRteWithBlocks3(val)) {
6754
7340
  processHtml(val.markup);
6755
7341
  const blockValues = extractBlockValues(val.blocks.contentData);
6756
7342
  for (const bv of blockValues) processValue(bv);
@@ -6760,7 +7346,7 @@ function extractLinksFromValues(values) {
6760
7346
  processHtml(val.markup);
6761
7347
  return;
6762
7348
  }
6763
- if (isBlockListOrGridValue4(val)) {
7349
+ if (isBlockListOrGridValue3(val)) {
6764
7350
  const blockValues = extractBlockValues(val.contentData);
6765
7351
  for (const bv of blockValues) processValue(bv);
6766
7352
  return;
@@ -6827,10 +7413,10 @@ async function resolveOutboundIds(candidateIds, excludeId) {
6827
7413
  }
6828
7414
 
6829
7415
  // src/umbraco-api/tools/relationships/get/report-outbound-links.ts
6830
- var inputSchema94 = {
7416
+ var inputSchema106 = {
6831
7417
  id: z.string().uuid().describe("The ID of the page to analyze for outbound links")
6832
7418
  };
6833
- var outputSchema94 = z.object({
7419
+ var outputSchema106 = z.object({
6834
7420
  id: z.string(),
6835
7421
  name: z.string(),
6836
7422
  url: z.string(),
@@ -6862,11 +7448,11 @@ var outputSchema94 = z.object({
6862
7448
  totalLinks: z.number()
6863
7449
  })
6864
7450
  });
6865
- var tool94 = {
7451
+ var tool106 = {
6866
7452
  name: "report-outbound-links",
6867
7453
  description: "Show everything a page links to \u2014 internal content pages, media items, and external URLs. Extracts references from content pickers, media pickers, rich text links, and block content. Use this to understand a page's dependencies before restructuring.",
6868
- inputSchema: inputSchema94,
6869
- outputSchema: outputSchema94,
7454
+ inputSchema: inputSchema106,
7455
+ outputSchema: outputSchema106,
6870
7456
  slices: ["read"],
6871
7457
  annotations: { readOnlyHint: true },
6872
7458
  handler: async ({ id }) => {
@@ -6895,10 +7481,10 @@ var tool94 = {
6895
7481
  });
6896
7482
  }
6897
7483
  };
6898
- var report_outbound_links_default = withStandardDecorators(tool94);
7484
+ var report_outbound_links_default = withStandardDecorators(tool106);
6899
7485
 
6900
7486
  // src/umbraco-api/tools/relationships/index.ts
6901
- var collection19 = {
7487
+ var collection20 = {
6902
7488
  metadata: {
6903
7489
  name: "relationships",
6904
7490
  displayName: "Content Relationships",
@@ -6906,11 +7492,11 @@ var collection19 = {
6906
7492
  },
6907
7493
  tools: () => [report_content_references_default, report_outbound_links_default]
6908
7494
  };
6909
- var relationships_default = collection19;
6910
- var inputSchema95 = {
7495
+ var relationships_default = collection20;
7496
+ var inputSchema107 = {
6911
7497
  id: z.string().uuid().describe("The ID of the content page to read public access settings for")
6912
7498
  };
6913
- var outputSchema95 = z.object({
7499
+ var outputSchema107 = z.object({
6914
7500
  hasRestrictions: z.boolean().describe("True if the page has public access rules configured"),
6915
7501
  memberGroups: z.array(z.object({
6916
7502
  id: z.string(),
@@ -6921,11 +7507,11 @@ var outputSchema95 = z.object({
6921
7507
  errorPageId: z.string().nullable().describe("The ID of the page shown when an authenticated visitor is denied access"),
6922
7508
  message: z.string().describe("Human-readable summary of the access rules")
6923
7509
  });
6924
- var tool95 = {
7510
+ var tool107 = {
6925
7511
  name: "get-public-access",
6926
7512
  description: "Read the public access (member-group restriction) settings for a content page. Returns the member groups, members, login page, and error page configured via the 'Public Access\u2026' entity action. If the page has no restrictions, returns hasRestrictions: false.",
6927
- inputSchema: inputSchema95,
6928
- outputSchema: outputSchema95,
7513
+ inputSchema: inputSchema107,
7514
+ outputSchema: outputSchema107,
6929
7515
  slices: ["read"],
6930
7516
  annotations: { readOnlyHint: true },
6931
7517
  handler: async ({ id }) => {
@@ -6958,15 +7544,15 @@ var tool95 = {
6958
7544
  });
6959
7545
  }
6960
7546
  };
6961
- var get_public_access_default = withStandardDecorators(tool95);
6962
- var inputSchema96 = {
7547
+ var get_public_access_default = withStandardDecorators(tool107);
7548
+ var inputSchema108 = {
6963
7549
  id: z.string().uuid().describe("The ID of the content page to restrict"),
6964
7550
  memberGroupNames: z.array(z.string()).describe("Names of member groups allowed to view the page. Use list-member-groups to look up existing groups."),
6965
7551
  loginPageId: z.string().uuid().describe("The ID of the page visitors are redirected to when login is required"),
6966
7552
  errorPageId: z.string().uuid().describe("The ID of the page shown when an authenticated visitor is denied access"),
6967
7553
  memberUserNames: z.array(z.string()).optional().describe("Optional: specific member usernames allowed to view the page (in addition to group members)")
6968
7554
  };
6969
- var outputSchema96 = z.object({
7555
+ var outputSchema108 = z.object({
6970
7556
  message: z.string(),
6971
7557
  id: z.string(),
6972
7558
  memberGroupNames: z.array(z.string()),
@@ -6974,11 +7560,11 @@ var outputSchema96 = z.object({
6974
7560
  loginPageId: z.string(),
6975
7561
  errorPageId: z.string()
6976
7562
  });
6977
- var tool96 = {
7563
+ var tool108 = {
6978
7564
  name: "set-public-access",
6979
7565
  description: "Restrict a content page to members of specific groups (or specific members), redirecting unauthenticated visitors to a login page. Equivalent to the 'Public Access\u2026' entity action in the Umbraco backoffice. Creates new rules on first call, updates them on subsequent calls. You will be asked to confirm.",
6980
- inputSchema: inputSchema96,
6981
- outputSchema: outputSchema96,
7566
+ inputSchema: inputSchema108,
7567
+ outputSchema: outputSchema108,
6982
7568
  slices: ["update"],
6983
7569
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
6984
7570
  handler: async ({ id, memberGroupNames, loginPageId, errorPageId, memberUserNames }, extra) => {
@@ -7016,19 +7602,19 @@ var tool96 = {
7016
7602
  });
7017
7603
  }
7018
7604
  };
7019
- var set_public_access_default = withStandardDecorators(tool96);
7020
- var inputSchema97 = {
7605
+ var set_public_access_default = withStandardDecorators(tool108);
7606
+ var inputSchema109 = {
7021
7607
  id: z.string().uuid().describe("The ID of the content page to remove public access restrictions from")
7022
7608
  };
7023
- var outputSchema97 = z.object({
7609
+ var outputSchema109 = z.object({
7024
7610
  message: z.string(),
7025
7611
  id: z.string()
7026
7612
  });
7027
- var tool97 = {
7613
+ var tool109 = {
7028
7614
  name: "remove-public-access",
7029
7615
  description: "Remove all public access restrictions from a content page, making it publicly viewable again. You will be asked to confirm.",
7030
- inputSchema: inputSchema97,
7031
- outputSchema: outputSchema97,
7616
+ inputSchema: inputSchema109,
7617
+ outputSchema: outputSchema109,
7032
7618
  slices: ["delete"],
7033
7619
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
7034
7620
  handler: async ({ id }, extra) => {
@@ -7043,10 +7629,10 @@ var tool97 = {
7043
7629
  });
7044
7630
  }
7045
7631
  };
7046
- var remove_public_access_default = withStandardDecorators(tool97);
7632
+ var remove_public_access_default = withStandardDecorators(tool109);
7047
7633
 
7048
7634
  // src/umbraco-api/tools/public-access/index.ts
7049
- var collection20 = {
7635
+ var collection21 = {
7050
7636
  metadata: {
7051
7637
  name: "public-access",
7052
7638
  displayName: "Public Access",
@@ -7054,7 +7640,7 @@ var collection20 = {
7054
7640
  },
7055
7641
  tools: () => [get_public_access_default, set_public_access_default, remove_public_access_default]
7056
7642
  };
7057
- var public_access_default = collection20;
7643
+ var public_access_default = collection21;
7058
7644
 
7059
7645
  // src/umbraco-api/tools/helpers/runtime.ts
7060
7646
  var isHostedRuntime = () => {
@@ -7064,7 +7650,7 @@ var isHostedRuntime = () => {
7064
7650
  };
7065
7651
 
7066
7652
  // src/umbraco-api/tools/notifications/get/get-content-notifications.ts
7067
- var inputSchema98 = {
7653
+ var inputSchema110 = {
7068
7654
  id: z.string().uuid().describe("UUID of the content page to read notification subscriptions for")
7069
7655
  };
7070
7656
  var subscriptionSchema = z.object({
@@ -7072,16 +7658,16 @@ var subscriptionSchema = z.object({
7072
7658
  alias: z.string().describe("Human-readable action alias (e.g. publish, unpublish, save, delete)"),
7073
7659
  subscribed: z.boolean().describe("True if the current user is subscribed to this action")
7074
7660
  });
7075
- var outputSchema98 = z.object({
7661
+ var outputSchema110 = z.object({
7076
7662
  id: z.string(),
7077
7663
  subscriptions: z.array(subscriptionSchema),
7078
7664
  subscribedActionIds: z.array(z.string()).describe("Convenience list of actionIds the current user is already subscribed to \u2014 pass back into set-content-notifications to preserve or modify")
7079
7665
  });
7080
- var tool98 = {
7666
+ var tool110 = {
7081
7667
  name: "get-content-notifications",
7082
7668
  description: "Get the current OAuth user's email notification subscriptions for a content page. Returns the full list of available actions (publish, unpublish, save, delete, etc.) with the user's subscribed/unsubscribed state for each. Hosted-only \u2014 not available in stdio mode because the static API user has no real inbox.",
7083
- inputSchema: inputSchema98,
7084
- outputSchema: outputSchema98,
7669
+ inputSchema: inputSchema110,
7670
+ outputSchema: outputSchema110,
7085
7671
  slices: ["read"],
7086
7672
  annotations: { readOnlyHint: true },
7087
7673
  enabled: isHostedRuntime,
@@ -7097,21 +7683,21 @@ var tool98 = {
7097
7683
  return createToolResult({ id, subscriptions, subscribedActionIds });
7098
7684
  }
7099
7685
  };
7100
- var get_content_notifications_default = withStandardDecorators(tool98);
7101
- var inputSchema99 = {
7686
+ var get_content_notifications_default = withStandardDecorators(tool110);
7687
+ var inputSchema111 = {
7102
7688
  id: z.string().uuid().describe("UUID of the content page to update notification subscriptions for"),
7103
7689
  subscribedActionIds: z.array(z.string()).describe("Complete list of action IDs the current user should be subscribed to. Replaces existing subscriptions \u2014 pass an empty array to unsubscribe from all. Call get-content-notifications first to see available actionIds and preserve any you don't want to change.")
7104
7690
  };
7105
- var outputSchema99 = z.object({
7691
+ var outputSchema111 = z.object({
7106
7692
  message: z.string(),
7107
7693
  id: z.string(),
7108
7694
  subscribedActionIds: z.array(z.string())
7109
7695
  });
7110
- var tool99 = {
7696
+ var tool111 = {
7111
7697
  name: "set-content-notifications",
7112
7698
  description: "Replace the current OAuth user's email notification subscriptions for a content page. Full overwrite \u2014 any action ID not in the list will be unsubscribed. Hosted-only \u2014 not available in stdio mode because the static API user has no real inbox.",
7113
- inputSchema: inputSchema99,
7114
- outputSchema: outputSchema99,
7699
+ inputSchema: inputSchema111,
7700
+ outputSchema: outputSchema111,
7115
7701
  slices: ["update"],
7116
7702
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
7117
7703
  enabled: isHostedRuntime,
@@ -7129,10 +7715,10 @@ var tool99 = {
7129
7715
  });
7130
7716
  }
7131
7717
  };
7132
- var set_content_notifications_default = withStandardDecorators(tool99);
7718
+ var set_content_notifications_default = withStandardDecorators(tool111);
7133
7719
 
7134
7720
  // src/umbraco-api/tools/notifications/index.ts
7135
- var collection21 = {
7721
+ var collection22 = {
7136
7722
  metadata: {
7137
7723
  name: "notifications",
7138
7724
  displayName: "Content Notifications",
@@ -7140,7 +7726,7 @@ var collection21 = {
7140
7726
  },
7141
7727
  tools: () => isHostedRuntime() ? [get_content_notifications_default, set_content_notifications_default] : []
7142
7728
  };
7143
- var notifications_default = collection21;
7729
+ var notifications_default = collection22;
7144
7730
  var mediaTools = {
7145
7731
  listRoot: "get-recycle-bin-media-root",
7146
7732
  listChildren: "get-recycle-bin-media-children",
@@ -7203,13 +7789,13 @@ function formatNamePreview(names, total) {
7203
7789
  }
7204
7790
 
7205
7791
  // src/umbraco-api/tools/recycle-bin/get/list-recycle-bin.ts
7206
- var inputSchema100 = {
7792
+ var inputSchema112 = {
7207
7793
  type: z.enum(["content", "media"]).describe("Which recycle bin to list: content (pages) or media."),
7208
7794
  parentId: z.string().uuid().optional().describe("When omitted, lists the bin root. When given, lists the children of that trashed folder \u2014 the recycle bin is a tree and this drills into nested trashed content."),
7209
7795
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
7210
7796
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
7211
7797
  };
7212
- var outputSchema100 = z.object({
7798
+ var outputSchema112 = z.object({
7213
7799
  items: z.array(z.object({
7214
7800
  id: z.string(),
7215
7801
  name: z.string(),
@@ -7218,11 +7804,11 @@ var outputSchema100 = z.object({
7218
7804
  })).describe("Trashed items at this level of the recycle bin"),
7219
7805
  total: z.number().describe("Total number of trashed items at this level (before pagination)")
7220
7806
  });
7221
- var tool100 = {
7807
+ var tool112 = {
7222
7808
  name: "list-recycle-bin",
7223
7809
  description: "List items in the content or media recycle bin. Returns one level at a time \u2014 when a trashed item has hasChildren=true it is a trashed folder; pass its id as parentId on a follow-up call to drill into its contents. Read-only.",
7224
- inputSchema: inputSchema100,
7225
- outputSchema: outputSchema100,
7810
+ inputSchema: inputSchema112,
7811
+ outputSchema: outputSchema112,
7226
7812
  slices: ["list", "tree"],
7227
7813
  annotations: { readOnlyHint: true },
7228
7814
  handler: async ({ type, parentId, take, skip }) => {
@@ -7245,22 +7831,22 @@ var tool100 = {
7245
7831
  });
7246
7832
  }
7247
7833
  };
7248
- var list_recycle_bin_default = withStandardDecorators(tool100);
7249
- var inputSchema101 = {
7834
+ var list_recycle_bin_default = withStandardDecorators(tool112);
7835
+ var inputSchema113 = {
7250
7836
  id: z.string().uuid().describe("ID of the trashed item to permanently delete."),
7251
7837
  type: z.enum(["content", "media"]).describe("Which recycle bin the item is in.")
7252
7838
  };
7253
- var outputSchema101 = z.object({
7839
+ var outputSchema113 = z.object({
7254
7840
  message: z.string(),
7255
7841
  id: z.string(),
7256
7842
  name: z.string(),
7257
7843
  descendantCount: z.number().optional().describe("Descendants also deleted when the item was a folder")
7258
7844
  });
7259
- var tool101 = {
7845
+ var tool113 = {
7260
7846
  name: "permanent-delete-recycle-bin-item",
7261
7847
  description: "Permanently delete a single item from the content or media recycle bin. Deleting a trashed folder deletes its entire subtree. This cannot be undone. Always elicits confirmation with an itemised preview before deleting.",
7262
- inputSchema: inputSchema101,
7263
- outputSchema: outputSchema101,
7848
+ inputSchema: inputSchema113,
7849
+ outputSchema: outputSchema113,
7264
7850
  slices: ["delete"],
7265
7851
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7266
7852
  handler: async ({ id, type }, extra) => {
@@ -7307,20 +7893,20 @@ var tool101 = {
7307
7893
  });
7308
7894
  }
7309
7895
  };
7310
- var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool101);
7311
- var inputSchema102 = {
7896
+ var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool113);
7897
+ var inputSchema114 = {
7312
7898
  type: z.enum(["content", "media"]).describe("Which recycle bin to empty.")
7313
7899
  };
7314
- var outputSchema102 = z.object({
7900
+ var outputSchema114 = z.object({
7315
7901
  message: z.string(),
7316
7902
  type: z.enum(["content", "media"]),
7317
7903
  topLevelCount: z.number().describe("Number of top-level items that were in the bin before emptying (descendants are not counted).")
7318
7904
  });
7319
- var tool102 = {
7905
+ var tool114 = {
7320
7906
  name: "empty-recycle-bin",
7321
7907
  description: "Empty the entire content or media recycle bin \u2014 permanently deletes every trashed item including the contents of any trashed folders. This cannot be undone. Always elicits two successive confirmations before executing.",
7322
- inputSchema: inputSchema102,
7323
- outputSchema: outputSchema102,
7908
+ inputSchema: inputSchema114,
7909
+ outputSchema: outputSchema114,
7324
7910
  slices: ["delete"],
7325
7911
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7326
7912
  handler: async ({ type }, extra) => {
@@ -7365,10 +7951,10 @@ var tool102 = {
7365
7951
  });
7366
7952
  }
7367
7953
  };
7368
- var empty_recycle_bin_default = withStandardDecorators(tool102);
7954
+ var empty_recycle_bin_default = withStandardDecorators(tool114);
7369
7955
 
7370
7956
  // src/umbraco-api/tools/recycle-bin/index.ts
7371
- var collection22 = {
7957
+ var collection23 = {
7372
7958
  metadata: {
7373
7959
  name: "recycle-bin",
7374
7960
  displayName: "Recycle Bin",
@@ -7376,9 +7962,9 @@ var collection22 = {
7376
7962
  },
7377
7963
  tools: () => [list_recycle_bin_default, permanent_delete_recycle_bin_item_default, empty_recycle_bin_default]
7378
7964
  };
7379
- var recycle_bin_default = collection22;
7380
- var inputSchema103 = {};
7381
- var outputSchema103 = z.object({
7965
+ var recycle_bin_default = collection23;
7966
+ var inputSchema115 = {};
7967
+ var outputSchema115 = z.object({
7382
7968
  id: z.string(),
7383
7969
  name: z.string(),
7384
7970
  userName: z.string(),
@@ -7400,11 +7986,11 @@ var outputSchema103 = z.object({
7400
7986
  documentStartNodeIds: z.array(z.string()).describe("Content node IDs the user is restricted to. Empty when hasDocumentRootAccess is true."),
7401
7987
  mediaStartNodeIds: z.array(z.string()).describe("Media node IDs the user is restricted to. Empty when hasMediaRootAccess is true.")
7402
7988
  });
7403
- var tool103 = {
7989
+ var tool115 = {
7404
7990
  name: "get-current-user",
7405
7991
  description: "Identify which Umbraco backoffice user the MCP server is authenticated as. Returns the user's name, email, admin flag, and resolved user-group names. Use this to confirm identity when permissions behave unexpectedly \u2014 e.g. an action fails or returns different data than expected, before assuming the API is broken.",
7406
- inputSchema: inputSchema103,
7407
- outputSchema: outputSchema103,
7992
+ inputSchema: inputSchema115,
7993
+ outputSchema: outputSchema115,
7408
7994
  slices: ["read"],
7409
7995
  annotations: { readOnlyHint: true },
7410
7996
  handler: async () => {
@@ -7443,10 +8029,10 @@ var tool103 = {
7443
8029
  });
7444
8030
  }
7445
8031
  };
7446
- var get_current_user_default = withStandardDecorators(tool103);
8032
+ var get_current_user_default = withStandardDecorators(tool115);
7447
8033
 
7448
8034
  // src/umbraco-api/tools/account/index.ts
7449
- var collection23 = {
8035
+ var collection24 = {
7450
8036
  metadata: {
7451
8037
  name: "account",
7452
8038
  displayName: "Account",
@@ -7454,22 +8040,7 @@ var collection23 = {
7454
8040
  },
7455
8041
  tools: () => [get_current_user_default]
7456
8042
  };
7457
- var account_default = collection23;
7458
- var toolSliceNames = [
7459
- // Base slices from toolkit (create, read, update, delete, list)
7460
- ...baseSliceNames,
7461
- // Query
7462
- "search",
7463
- // Navigation
7464
- "tree",
7465
- // Workflow
7466
- "publish",
7467
- // Versioning
7468
- "version",
7469
- // Movement
7470
- "move"
7471
- ];
7472
- var allSliceNames = [...toolSliceNames, "other"];
8043
+ var account_default = collection24;
7473
8044
 
7474
8045
  // src/config/mode-registry.ts
7475
8046
  var toolModes = [
@@ -7485,6 +8056,12 @@ var toolModes = [
7485
8056
  description: "Browse, search, upload, and manage media files and folders",
7486
8057
  collections: ["media", "media-management"]
7487
8058
  },
8059
+ {
8060
+ name: "library",
8061
+ displayName: "Library Elements",
8062
+ description: "Browse, view, and manage reusable Library elements (Umbraco 18 Library section)",
8063
+ collections: ["element"]
8064
+ },
7488
8065
  {
7489
8066
  name: "blueprints",
7490
8067
  displayName: "Blueprints",
@@ -7572,6 +8149,49 @@ var toolModes = [
7572
8149
  ];
7573
8150
  var allModes = [...toolModes];
7574
8151
  var allModeNames = toolModes.map((m) => m.name);
8152
+ var toolSliceNames = [
8153
+ // Base slices from toolkit (create, read, update, delete, list)
8154
+ ...baseSliceNames,
8155
+ // Query
8156
+ "search",
8157
+ // Navigation
8158
+ "tree",
8159
+ // Workflow
8160
+ "publish",
8161
+ // Versioning
8162
+ "version",
8163
+ // Movement
8164
+ "move"
8165
+ ];
8166
+ var allSliceNames = [...toolSliceNames, "other"];
8167
+
8168
+ // src/collections.ts
8169
+ var collections = [
8170
+ content_default,
8171
+ publishing_default,
8172
+ versioning_default,
8173
+ media_default,
8174
+ media_management_default,
8175
+ element_default,
8176
+ blueprint_default,
8177
+ language_default,
8178
+ translation_default,
8179
+ dictionary_default,
8180
+ tag_default,
8181
+ content_health_default,
8182
+ site_structure_default,
8183
+ bulk_operations_default,
8184
+ member_default,
8185
+ member_group_default,
8186
+ member_reporting_default,
8187
+ scheduling_default,
8188
+ redirect_default,
8189
+ relationships_default,
8190
+ public_access_default,
8191
+ notifications_default,
8192
+ recycle_bin_default,
8193
+ account_default
8194
+ ];
7575
8195
  var customFields = [
7576
8196
  {
7577
8197
  name: "disableMcpChaining",
@@ -7698,31 +8318,7 @@ initializeUmbracoFetch({
7698
8318
  clientSecret: serverConfig.umbraco.auth.clientSecret
7699
8319
  });
7700
8320
  var filterConfig = configLoader.loadFromConfig(serverConfig.umbraco);
7701
- var collections = [
7702
- content_default,
7703
- publishing_default,
7704
- versioning_default,
7705
- media_default,
7706
- media_management_default,
7707
- blueprint_default,
7708
- translation_default,
7709
- language_default,
7710
- dictionary_default,
7711
- tag_default,
7712
- content_health_default,
7713
- site_structure_default,
7714
- bulk_operations_default,
7715
- member_default,
7716
- member_group_default,
7717
- member_reporting_default,
7718
- scheduling_default,
7719
- redirect_default,
7720
- relationships_default,
7721
- public_access_default,
7722
- notifications_default,
7723
- recycle_bin_default,
7724
- account_default
7725
- ];
8321
+ var registeredCollections = collections;
7726
8322
  async function main() {
7727
8323
  const chainingEnabled = mcpServers.length > 0 && !serverConfig.custom.disableMcpChaining;
7728
8324
  let availableChainedTools;
@@ -7744,23 +8340,23 @@ async function main() {
7744
8340
  }
7745
8341
  let registeredToolCount = 0;
7746
8342
  let skippedByDeps = 0;
7747
- for (const collection24 of collections) {
7748
- const collectionName = collection24.metadata.name;
7749
- const tools = collection24.tools({});
7750
- for (const tool104 of tools) {
7751
- const toolWithDeps = CHAINED_DEPS[tool104.name] && !tool104.chainedDeps ? { ...tool104, chainedDeps: CHAINED_DEPS[tool104.name] } : tool104;
8343
+ for (const collection25 of registeredCollections) {
8344
+ const collectionName = collection25.metadata.name;
8345
+ const tools = collection25.tools({});
8346
+ for (const tool116 of tools) {
8347
+ const toolWithDeps = CHAINED_DEPS[tool116.name] && !tool116.chainedDeps ? { ...tool116, chainedDeps: CHAINED_DEPS[tool116.name] } : tool116;
7752
8348
  if (!shouldIncludeTool(toolWithDeps, { collectionName, config: filterConfig, availableChainedTools })) {
7753
- if (availableChainedTools && CHAINED_DEPS[tool104.name]) skippedByDeps++;
8349
+ if (availableChainedTools && CHAINED_DEPS[tool116.name]) skippedByDeps++;
7754
8350
  continue;
7755
8351
  }
7756
- const annotations = createToolAnnotations(tool104);
7757
- server.registerTool(tool104.name, {
7758
- description: tool104.description,
7759
- inputSchema: tool104.inputSchema,
7760
- outputSchema: tool104.outputSchema,
8352
+ const annotations = createToolAnnotations(tool116);
8353
+ server.registerTool(tool116.name, {
8354
+ description: tool116.description,
8355
+ inputSchema: tool116.inputSchema,
8356
+ outputSchema: tool116.outputSchema,
7761
8357
  annotations,
7762
- ...tool104._meta ? { _meta: tool104._meta } : {}
7763
- }, tool104.handler);
8358
+ ...tool116._meta ? { _meta: tool116._meta } : {}
8359
+ }, tool116.handler);
7764
8360
  registeredToolCount++;
7765
8361
  }
7766
8362
  }
@@ -7768,7 +8364,7 @@ async function main() {
7768
8364
  const transport = new StdioServerTransport();
7769
8365
  await server.connect(transport);
7770
8366
  console.error(
7771
- `MCP Server started with ${registeredToolCount} tool(s) from ${collections.length} collection(s)` + (skippedByDeps > 0 ? ` (${skippedByDeps} tool(s) hidden \u2014 chained deps not available for this user)` : "")
8367
+ `MCP Server started with ${registeredToolCount} tool(s) from ${registeredCollections.length} collection(s)` + (skippedByDeps > 0 ? ` (${skippedByDeps} tool(s) hidden \u2014 chained deps not available for this user)` : "")
7772
8368
  );
7773
8369
  }
7774
8370
  process.on("SIGINT", async () => {