@umbraco-cms/mcp-editor 17.6.0-beta.8 → 18.0.0-beta.10

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
@@ -9,7 +9,7 @@ import { resolve } from 'path';
9
9
 
10
10
  // package.json
11
11
  var package_default = {
12
- version: "17.6.0-beta.8"};
12
+ version: "18.0.0-beta.10"};
13
13
 
14
14
  // src/auth/chained-deps.generated.ts
15
15
  var CHAINED_DEPS = {
@@ -27,6 +27,7 @@ var CHAINED_DEPS = {
27
27
  "bulk-unpublish": ["get-document-by-id", "unpublish-document"],
28
28
  "cancel-schedule": ["get-document-by-id", "publish-document"],
29
29
  "copy-variant": ["get-document-by-id", "update-document"],
30
+ "create-and-publish-page": ["create-and-publish-document", "get-data-types-by-id-array", "get-document-type-by-id"],
30
31
  "create-blueprint": ["create-document-blueprint-from-document", "get-document-blueprint-root", "get-document-by-id"],
31
32
  "create-dictionary": ["create-dictionary"],
32
33
  "create-language": ["create-language"],
@@ -100,7 +101,7 @@ var CHAINED_DEPS = {
100
101
  "restore-media": ["get-media-by-id", "restore-media-from-recycle-bin"],
101
102
  "restore-page": ["get-document-by-id"],
102
103
  "rollback-page": ["create-document-version-rollback", "get-document-by-id", "get-document-version", "get-user-by-id"],
103
- "save-and-publish": ["get-document-by-id", "publish-document", "publish-document-with-descendants", "update-document-properties"],
104
+ "save-and-publish": ["get-document-by-id", "publish-document", "publish-document-with-descendants", "update-and-publish-document", "update-document-properties"],
104
105
  "schedule-publish": ["get-document-by-id", "publish-document"],
105
106
  "search-content": ["search-document"],
106
107
  "search-dictionary": ["find-dictionary"],
@@ -120,8 +121,7 @@ var CHAINED_DEPS = {
120
121
 
121
122
  // src/config/mcp-servers.ts
122
123
  async function buildServers() {
123
- const isWorkersRuntime = typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers";
124
- if (isWorkersRuntime || typeof process === "undefined" || !process.env) return [];
124
+ if (typeof process === "undefined" || !process.env) return [];
125
125
  const useMockChain = process.env.USE_MOCK_MCP_CHAIN === "true";
126
126
  if (useMockChain) {
127
127
  const path2 = await import('path');
@@ -223,14 +223,6 @@ function truncateAvailableTools(message) {
223
223
  }
224
224
  return message.slice(0, availableToolsIndex + 1);
225
225
  }
226
- async function isCmsToolAvailable(toolName) {
227
- try {
228
- const { tools } = await mcpClientManager.listTools("cms");
229
- return (tools ?? []).some((t) => t.name === toolName);
230
- } catch {
231
- return true;
232
- }
233
- }
234
226
  async function chainCms(toolName, args) {
235
227
  let result;
236
228
  try {
@@ -593,9 +585,9 @@ var tool2 = {
593
585
  })),
594
586
  variants: doc.variants ?? [],
595
587
  previewUrl: buildPreviewUrl(doc.id),
596
- // The get-document-by-id response doesn't carry `urls` — published
597
- // URLs come only from the separate get-document-urls endpoint via
598
- // fetchPublishedUrls.
588
+ // Umbraco 18's get-document-by-id response no longer carries `urls` —
589
+ // published URLs now come only from the separate get-document-urls
590
+ // endpoint via fetchPublishedUrls.
599
591
  publishedUrls: await fetchPublishedUrls(id)
600
592
  });
601
593
  }
@@ -920,13 +912,13 @@ async function validateDocumentState(id, doc) {
920
912
  culture: v.culture ?? null,
921
913
  segment: v.segment ?? null
922
914
  }));
923
- const ancestorsResult = await chainCms("get-document-ancestors", { descendantId: id });
924
- const parent = ancestorsResult.ok ? (ancestorsResult.data.items ?? []).find((item) => item.id === id)?.parent ?? null : null;
915
+ const itemResult = await chainCms("get-item-document", { id: [id] });
916
+ const parent = itemResult.ok ? itemResult.data.items[0]?.parent ?? null : null;
925
917
  const result = await chainCms("validate-document", {
926
918
  id,
927
919
  documentType: { id: target.documentType.id },
928
920
  template: target.template ? { id: target.template.id } : null,
929
- parent,
921
+ parent: parent ? { id: parent.id } : null,
930
922
  values,
931
923
  variants
932
924
  });
@@ -1070,6 +1062,30 @@ function isBlockListOrGridValue(value) {
1070
1062
  function isRteWithBlocks(value) {
1071
1063
  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);
1072
1064
  }
1065
+
1066
+ // src/umbraco-api/tools/helpers/block-inspector.ts
1067
+ function blockPropertiesSchema(editTool) {
1068
+ return z.array(z.object({
1069
+ propertyAlias: z.string().describe("The property containing these blocks"),
1070
+ editorAlias: z.string().optional(),
1071
+ blocks: z.array(z.object({
1072
+ contentKey: z.string().describe(`The block's unique key \u2014 use this with ${editTool}`),
1073
+ contentTypeKey: z.string().describe("The block's element type ID"),
1074
+ settingsKey: z.string().optional().describe("The key of the block's settings entry. Absent when the block has no settings."),
1075
+ properties: z.array(z.object({
1076
+ alias: z.string(),
1077
+ value: z.any()
1078
+ }))
1079
+ }))
1080
+ }));
1081
+ }
1082
+ function extractBlocks(contentData) {
1083
+ return contentData.map((block) => ({
1084
+ contentKey: block?.key ?? "",
1085
+ contentTypeKey: block?.contentTypeKey ?? "",
1086
+ properties: Array.isArray(block?.values) ? block.values.map((v) => ({ alias: v?.alias ?? "", value: v?.value })) : []
1087
+ }));
1088
+ }
1073
1089
  function findSettingsKey(container, contentKey) {
1074
1090
  const layout = container?.layout;
1075
1091
  if (!layout || typeof layout !== "object") return void 0;
@@ -1096,6 +1112,94 @@ function searchLayout(entries, contentKey) {
1096
1112
  }
1097
1113
  return void 0;
1098
1114
  }
1115
+ function collectBlockProperties(values, propertyAlias) {
1116
+ const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
1117
+ return filtered.filter((v) => isBlockListOrGridValue(v.value) || isRteWithBlocks(v.value)).map((v) => {
1118
+ const value = v.value;
1119
+ const container = isRteWithBlocks(value) ? value.blocks : value;
1120
+ return {
1121
+ propertyAlias: v.alias,
1122
+ editorAlias: isRteWithBlocks(value) ? "Umbraco.RichText" : v.editorAlias ?? void 0,
1123
+ blocks: withSettingsKeys(extractBlocks(container.contentData), container)
1124
+ };
1125
+ });
1126
+ }
1127
+ var MAX_ENRICHED_BLOCKS = 50;
1128
+ var MAX_BLOCK_WALK_DEPTH = 20;
1129
+ function enrichBlockNotFoundError(errorResult, values, options = {}) {
1130
+ const problem = extractInnerProblemDetails(errorResult);
1131
+ const availableBlocks = problem.availableBlocks;
1132
+ if (!Array.isArray(availableBlocks)) return errorResult;
1133
+ const { propertyAlias, note } = options;
1134
+ const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
1135
+ const typeByKey = /* @__PURE__ */ new Map();
1136
+ for (const v of filtered) {
1137
+ const container = isRteWithBlocks(v.value) ? v.value.blocks : v.value;
1138
+ if (isBlockListOrGridValue(container)) {
1139
+ collectBlockEntryTypes(container, typeByKey, 0);
1140
+ }
1141
+ }
1142
+ const truncated = availableBlocks.length > MAX_ENRICHED_BLOCKS;
1143
+ const limitedBlocks = truncated ? availableBlocks.slice(0, MAX_ENRICHED_BLOCKS) : availableBlocks;
1144
+ const enrichedBlocks = limitedBlocks.map(
1145
+ (b) => b && typeof b === "object" && typeof b.key === "string" ? { ...b, contentTypeKey: typeByKey.get(b.key) ?? null } : b
1146
+ );
1147
+ return createToolResultError({
1148
+ ...problem,
1149
+ availableBlocks: enrichedBlocks,
1150
+ ...truncated ? { availableBlocksNote: `Showing ${MAX_ENRICHED_BLOCKS} of ${availableBlocks.length} available blocks \u2014 use inspect-blocks for the full list.` } : {},
1151
+ ...note ? { note } : {}
1152
+ });
1153
+ }
1154
+ function collectBlockEntryTypes(container, into, depth) {
1155
+ if (depth > MAX_BLOCK_WALK_DEPTH) return;
1156
+ for (const list of [container.contentData, container.settingsData]) {
1157
+ if (!Array.isArray(list)) continue;
1158
+ for (const block of list) {
1159
+ if (!block || typeof block !== "object") continue;
1160
+ const key = block.key;
1161
+ const contentTypeKey = block.contentTypeKey;
1162
+ if (typeof key === "string" && typeof contentTypeKey === "string") into.set(key, contentTypeKey);
1163
+ const nestedValues = block.values;
1164
+ if (!Array.isArray(nestedValues)) continue;
1165
+ for (const nested of nestedValues) {
1166
+ const nestedRaw = nested?.value;
1167
+ const nestedContainer = isRteWithBlocks(nestedRaw) ? nestedRaw.blocks : nestedRaw;
1168
+ if (isBlockListOrGridValue(nestedContainer)) {
1169
+ collectBlockEntryTypes(nestedContainer, into, depth + 1);
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+ function withSettingsKeys(blocks, container) {
1176
+ return blocks.map((block) => {
1177
+ const settingsKey = findSettingsKey(container, block.contentKey);
1178
+ return settingsKey ? { ...block, settingsKey } : block;
1179
+ });
1180
+ }
1181
+ var blockPropertyAliasSchema = z.string().regex(
1182
+ /^[A-Za-z_][A-Za-z0-9_]*$/,
1183
+ "Property alias must be a valid identifier (letters, digits, underscore; not starting with a digit)"
1184
+ );
1185
+ function classifyBlockUpdateResults(results, requestedCount, requestedAliases = [], expectedEntryCount = 1) {
1186
+ const list = results ?? [];
1187
+ const processedCount = list.reduce((sum, r) => sum + (r.updatedCount ?? 0) + (r.addedCount ?? 0), 0);
1188
+ const updatedEntryCount = list.filter((r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) > 0).length;
1189
+ const errors = list.flatMap((r) => r.errors ?? []);
1190
+ const warnings = list.flatMap((r) => r.warnings ?? []);
1191
+ const failureText = [...errors, ...warnings].join("; ");
1192
+ const unresolvedEntries = list.filter(
1193
+ (r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) === 0 && !r.errors?.length && !r.warnings?.length
1194
+ );
1195
+ const missingEntryCount = Math.max(0, expectedEntryCount - list.length);
1196
+ const unresolvedBlockCount = unresolvedEntries.length + missingEntryCount;
1197
+ const detail = [...errors, ...warnings, ...unresolvedEntries.map((r) => r.message).filter(Boolean)].join("; ") || list.map((r) => r.message).filter(Boolean).join("; ") || "no detail returned";
1198
+ const outcome = processedCount === 0 ? "failed" : processedCount < requestedCount ? "partial" : "clean";
1199
+ const failedFields = requestedAliases.filter((alias) => failureText.includes(`'${alias}'`));
1200
+ const savedFields = unresolvedBlockCount > 0 ? [] : requestedAliases.filter((alias) => !failedFields.includes(alias));
1201
+ return { outcome, processedCount, updatedEntryCount, detail, warnings, savedFields, failedFields, unresolvedBlockCount };
1202
+ }
1099
1203
 
1100
1204
  // src/umbraco-api/tools/content/get/inspect-blocks.ts
1101
1205
  var inputSchema6 = {
@@ -1106,41 +1210,11 @@ var outputSchema6 = z.object({
1106
1210
  id: z.string(),
1107
1211
  name: z.string(),
1108
1212
  previewUrl: previewUrlSchema,
1109
- blockProperties: z.array(z.object({
1110
- propertyAlias: z.string().describe("The document property containing these blocks"),
1111
- editorAlias: z.string().optional(),
1112
- blocks: z.array(z.object({
1113
- contentKey: z.string().describe("The block's unique key \u2014 use this with edit-block"),
1114
- contentTypeKey: z.string().describe("The block's element type ID"),
1115
- settingsKey: z.string().optional().describe("The key of the block's settings entry. Absent when the block has no settings."),
1116
- properties: z.array(z.object({
1117
- alias: z.string(),
1118
- value: z.any()
1119
- }))
1120
- }))
1121
- }))
1213
+ blockProperties: blockPropertiesSchema("edit-block")
1122
1214
  });
1123
- function isBlockListOrGridValue2(value) {
1124
- return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
1125
- }
1126
- function isRteWithBlocks2(value) {
1127
- 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);
1128
- }
1129
- function extractBlocks(contentData, container) {
1130
- return contentData.map((block) => {
1131
- const contentKey = block.key ?? "";
1132
- const settingsKey = findSettingsKey(container, contentKey);
1133
- return {
1134
- contentKey,
1135
- contentTypeKey: block.contentTypeKey ?? "",
1136
- ...settingsKey ? { settingsKey } : {},
1137
- properties: Array.isArray(block.values) ? block.values.map((v) => ({ alias: v.alias ?? "", value: v.value })) : []
1138
- };
1139
- });
1140
- }
1141
1215
  var tool6 = {
1142
1216
  name: "inspect-blocks",
1143
- 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.",
1217
+ 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.",
1144
1218
  inputSchema: inputSchema6,
1145
1219
  outputSchema: outputSchema6,
1146
1220
  slices: ["read"],
@@ -1149,28 +1223,11 @@ var tool6 = {
1149
1223
  const result = await chainCms("get-document-by-id", { id });
1150
1224
  if (!result.ok) return result.errorResult;
1151
1225
  const doc = result.data;
1152
- const allValues = doc.values ?? [];
1153
- const filtered = propertyAlias ? allValues.filter((v) => v.alias === propertyAlias) : allValues;
1154
- const blockProperties = filtered.filter((v) => isBlockListOrGridValue2(v.value) || isRteWithBlocks2(v.value)).map((v) => {
1155
- const value = v.value;
1156
- if (isRteWithBlocks2(value)) {
1157
- return {
1158
- propertyAlias: v.alias,
1159
- editorAlias: "Umbraco.RichText",
1160
- blocks: extractBlocks(value.blocks.contentData, value.blocks)
1161
- };
1162
- }
1163
- return {
1164
- propertyAlias: v.alias,
1165
- editorAlias: v.editorAlias ?? void 0,
1166
- blocks: extractBlocks(value.contentData, value)
1167
- };
1168
- });
1169
1226
  return createToolResult({
1170
1227
  id: doc.id,
1171
1228
  name: doc.variants?.[0]?.name ?? "Unknown",
1172
1229
  previewUrl: buildPreviewUrl(doc.id),
1173
- blockProperties
1230
+ blockProperties: collectBlockProperties(doc.values ?? [], propertyAlias)
1174
1231
  });
1175
1232
  }
1176
1233
  };
@@ -1498,7 +1555,8 @@ ${aliases.join("\n")}`
1498
1555
  const schemaResult = await chainCms("get-data-type-schema", { id: match.id });
1499
1556
  if (!schemaResult.ok) return schemaResult.errorResult;
1500
1557
  return createToolResult({
1501
- message: JSON.stringify(schemaResult.data, null, 2),
1558
+ message: `Value-shape template for ${editorAlias}:
1559
+ ${JSON.stringify(schemaResult.data, null, 2)}`,
1502
1560
  editorAlias
1503
1561
  });
1504
1562
  }
@@ -1645,7 +1703,7 @@ var outputSchema12 = z.object({
1645
1703
  });
1646
1704
  var tool12 = {
1647
1705
  name: "create-and-publish-page",
1648
- description: "Create a new content page and publish it \u2014 mirrors clicking 'Save and publish' (instead of 'Save') on the create screen in the Umbraco backoffice. This is a single atomic operation when the connected Umbraco instance supports it (17.6+); otherwise a two-call create-then-publish sequence is used. Call list-document-types first to find a valid documentTypeId. Use this as a starting point: pass `name`, `documentTypeId`, optional `parentId`, and at most a small number of simple initial values. Required-property validation runs at publish time, not create time: on the atomic path a validation failure leaves no page behind, but on the fallback path the draft can already have been created before publish fails, leaving an unpublished draft. Either way, check the response `message` before retrying \u2014 don't retry blindly, or you may pile up duplicate drafts. Use create-page followed by save-and-publish instead when you need to build up content across multiple calls before publishing.",
1706
+ description: "Create a new content page and publish it in one atomic operation \u2014 mirrors clicking 'Save and publish' (instead of 'Save') on the create screen in the Umbraco backoffice. Call list-document-types first to find a valid documentTypeId. Use this as a starting point: pass `name`, `documentTypeId`, optional `parentId`, and at most a small number of simple initial values. If the document type requires properties this doesn't set, or if the values fail validation, the whole operation fails and no page is created \u2014 use create-page followed by save-and-publish instead when you need to build up content across multiple calls before publishing.",
1649
1707
  inputSchema: inputSchema12,
1650
1708
  outputSchema: outputSchema12,
1651
1709
  slices: ["create", "publish"],
@@ -1653,42 +1711,14 @@ var tool12 = {
1653
1711
  handler: async ({ name, documentTypeId, parentId, values }) => {
1654
1712
  const resolved = await resolveEditorAliases(documentTypeId, values);
1655
1713
  if (!resolved.ok) return resolved.errorResult;
1656
- if (await isCmsToolAvailable("create-and-publish-document")) {
1657
- const createResult = await chainCms("create-and-publish-document", {
1658
- documentTypeId,
1659
- name,
1660
- values: resolved.values,
1661
- ...parentId ? { parentId } : {}
1662
- });
1663
- if (!createResult.ok) return createResult.errorResult;
1664
- const createdId2 = createResult.data.id;
1665
- return createToolResult({
1666
- message: `Created and published "${name}"`,
1667
- id: createdId2,
1668
- name,
1669
- publishedUrls: createdId2 ? await fetchPublishedUrls(createdId2) : []
1670
- });
1671
- }
1672
- const createDocumentResult = await chainCms("create-document", {
1714
+ const createResult = await chainCms("create-and-publish-document", {
1673
1715
  documentTypeId,
1674
1716
  name,
1675
1717
  values: resolved.values,
1676
1718
  ...parentId ? { parentId } : {}
1677
1719
  });
1678
- if (!createDocumentResult.ok) return createDocumentResult.errorResult;
1679
- const createdId = createDocumentResult.data.id;
1680
- const publishResult = await chainCms("publish-document", {
1681
- id: createdId,
1682
- data: { publishSchedules: [{ culture: null }] }
1683
- });
1684
- if (!publishResult.ok) {
1685
- return createToolResult({
1686
- message: `Created "${name}" as a draft but publish failed: ${publishResult.errorResult.content?.[0]?.text ?? "unknown error"}`,
1687
- id: createdId,
1688
- name,
1689
- publishedUrls: []
1690
- });
1691
- }
1720
+ if (!createResult.ok) return createResult.errorResult;
1721
+ const createdId = createResult.data.id;
1692
1722
  return createToolResult({
1693
1723
  message: `Created and published "${name}"`,
1694
1724
  id: createdId,
@@ -2026,78 +2056,6 @@ var tool17 = {
2026
2056
  }
2027
2057
  };
2028
2058
  var edit_page_default = withStandardDecorators(tool17);
2029
- var MAX_ENRICHED_BLOCKS = 50;
2030
- var MAX_BLOCK_WALK_DEPTH = 20;
2031
- function enrichBlockNotFoundError(errorResult, values, options = {}) {
2032
- const problem = extractInnerProblemDetails(errorResult);
2033
- const availableBlocks = problem.availableBlocks;
2034
- if (!Array.isArray(availableBlocks)) return errorResult;
2035
- const { propertyAlias, note } = options;
2036
- const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
2037
- const typeByKey = /* @__PURE__ */ new Map();
2038
- for (const v of filtered) {
2039
- const container = isRteWithBlocks(v.value) ? v.value.blocks : v.value;
2040
- if (isBlockListOrGridValue(container)) {
2041
- collectBlockEntryTypes(container, typeByKey, 0);
2042
- }
2043
- }
2044
- const truncated = availableBlocks.length > MAX_ENRICHED_BLOCKS;
2045
- const limitedBlocks = truncated ? availableBlocks.slice(0, MAX_ENRICHED_BLOCKS) : availableBlocks;
2046
- const enrichedBlocks = limitedBlocks.map(
2047
- (b) => b && typeof b === "object" && typeof b.key === "string" ? { ...b, contentTypeKey: typeByKey.get(b.key) ?? null } : b
2048
- );
2049
- return createToolResultError({
2050
- ...problem,
2051
- availableBlocks: enrichedBlocks,
2052
- ...truncated ? { availableBlocksNote: `Showing ${MAX_ENRICHED_BLOCKS} of ${availableBlocks.length} available blocks \u2014 use inspect-blocks for the full list.` } : {},
2053
- ...note ? { note } : {}
2054
- });
2055
- }
2056
- function collectBlockEntryTypes(container, into, depth) {
2057
- if (depth > MAX_BLOCK_WALK_DEPTH) return;
2058
- for (const list of [container.contentData, container.settingsData]) {
2059
- if (!Array.isArray(list)) continue;
2060
- for (const block of list) {
2061
- if (!block || typeof block !== "object") continue;
2062
- const key = block.key;
2063
- const contentTypeKey = block.contentTypeKey;
2064
- if (typeof key === "string" && typeof contentTypeKey === "string") into.set(key, contentTypeKey);
2065
- const nestedValues = block.values;
2066
- if (!Array.isArray(nestedValues)) continue;
2067
- for (const nested of nestedValues) {
2068
- const nestedRaw = nested?.value;
2069
- const nestedContainer = isRteWithBlocks(nestedRaw) ? nestedRaw.blocks : nestedRaw;
2070
- if (isBlockListOrGridValue(nestedContainer)) {
2071
- collectBlockEntryTypes(nestedContainer, into, depth + 1);
2072
- }
2073
- }
2074
- }
2075
- }
2076
- }
2077
- var blockPropertyAliasSchema = z.string().regex(
2078
- /^[A-Za-z_][A-Za-z0-9_]*$/,
2079
- "Property alias must be a valid identifier (letters, digits, underscore; not starting with a digit)"
2080
- );
2081
- function classifyBlockUpdateResults(results, requestedCount, requestedAliases = [], expectedEntryCount = 1) {
2082
- const list = results ?? [];
2083
- const processedCount = list.reduce((sum, r) => sum + (r.updatedCount ?? 0) + (r.addedCount ?? 0), 0);
2084
- const updatedEntryCount = list.filter((r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) > 0).length;
2085
- const errors = list.flatMap((r) => r.errors ?? []);
2086
- const warnings = list.flatMap((r) => r.warnings ?? []);
2087
- const failureText = [...errors, ...warnings].join("; ");
2088
- const unresolvedEntries = list.filter(
2089
- (r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) === 0 && !r.errors?.length && !r.warnings?.length
2090
- );
2091
- const missingEntryCount = Math.max(0, expectedEntryCount - list.length);
2092
- const unresolvedBlockCount = unresolvedEntries.length + missingEntryCount;
2093
- const detail = [...errors, ...warnings, ...unresolvedEntries.map((r) => r.message).filter(Boolean)].join("; ") || list.map((r) => r.message).filter(Boolean).join("; ") || "no detail returned";
2094
- const outcome = processedCount === 0 ? "failed" : processedCount < requestedCount ? "partial" : "clean";
2095
- const failedFields = requestedAliases.filter((alias) => failureText.includes(`'${alias}'`));
2096
- const savedFields = unresolvedBlockCount > 0 ? [] : requestedAliases.filter((alias) => !failedFields.includes(alias));
2097
- return { outcome, processedCount, updatedEntryCount, detail, warnings, savedFields, failedFields, unresolvedBlockCount };
2098
- }
2099
-
2100
- // src/umbraco-api/tools/content/put/edit-block.ts
2101
2059
  var inputSchema18 = {
2102
2060
  id: z.string().uuid().describe("The ID of the page containing the block"),
2103
2061
  propertyAlias: z.string().describe("The document property alias containing the blocks (e.g. 'mainContent'). Use inspect-blocks to find this."),
@@ -2122,7 +2080,7 @@ var outputSchema18 = z.object({
2122
2080
  });
2123
2081
  var tool18 = {
2124
2082
  name: "edit-block",
2125
- 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.",
2083
+ 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.",
2126
2084
  inputSchema: inputSchema18,
2127
2085
  outputSchema: outputSchema18,
2128
2086
  slices: ["update"],
@@ -2234,7 +2192,8 @@ var tool19 = {
2234
2192
  const targetCulture = culture ?? null;
2235
2193
  const docResult = await chainCms("get-document-by-id", { id });
2236
2194
  if (!docResult.ok) return docResult.errorResult;
2237
- const variants = docResult.data.variants ?? [];
2195
+ const doc = docResult.data;
2196
+ const variants = doc.variants ?? [];
2238
2197
  const targetVariant = variants.find((v) => matchesCulture(v, targetCulture));
2239
2198
  if (!targetVariant) {
2240
2199
  if (targetCulture) {
@@ -2268,8 +2227,8 @@ var tool19 = {
2268
2227
  previewUrl: buildPreviewUrl(id)
2269
2228
  });
2270
2229
  }
2271
- const renameResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2272
- if (!renameResult.ok) return renameResult.errorResult;
2230
+ const updateResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2231
+ if (!updateResult.ok) return updateResult.errorResult;
2273
2232
  return createToolResult({
2274
2233
  message: `Renamed page${cultureLabel} from "${previousName}" to "${name}" (saved, not published)`,
2275
2234
  id,
@@ -2749,17 +2708,36 @@ var outputSchema27 = z.object({
2749
2708
  updatedFields: z.array(z.string()),
2750
2709
  publishedUrls: publishedUrlsSchema
2751
2710
  });
2752
- function mergeValues(existing, updates) {
2753
- const key = (v) => `${v.alias}::${v.culture ?? ""}::${v.segment ?? ""}`;
2754
- const merged = new Map(existing.map((v) => [key(v), { alias: v.alias, value: v.value, culture: v.culture ?? null, segment: v.segment ?? null }]));
2755
- for (const u of updates) {
2756
- merged.set(key(u), { alias: u.alias, value: u.value, culture: u.culture ?? null, segment: u.segment ?? null });
2711
+ function valueKey2(value) {
2712
+ return `${value.alias}|${value.culture ?? ""}|${value.segment ?? ""}`;
2713
+ }
2714
+ function normaliseValue(value) {
2715
+ return {
2716
+ alias: value.alias,
2717
+ value: value.value,
2718
+ culture: value.culture ?? null,
2719
+ segment: value.segment ?? null
2720
+ };
2721
+ }
2722
+ function mergeValues(current, incoming) {
2723
+ const merged = current.map(normaliseValue);
2724
+ const indexByKey = new Map(merged.map((value, index) => [valueKey2(value), index]));
2725
+ for (const value of incoming) {
2726
+ const next = normaliseValue(value);
2727
+ const key = valueKey2(next);
2728
+ const existingIndex = indexByKey.get(key);
2729
+ if (existingIndex !== void 0) {
2730
+ merged[existingIndex] = next;
2731
+ } else {
2732
+ indexByKey.set(key, merged.length);
2733
+ merged.push(next);
2734
+ }
2757
2735
  }
2758
- return [...merged.values()];
2736
+ return merged;
2759
2737
  }
2760
2738
  var tool27 = {
2761
2739
  name: "save-and-publish",
2762
- description: "Save property changes and publish a content page \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. This is a single atomic operation when the connected Umbraco instance supports it (17.6+), otherwise a two-call save-then-publish sequence is used. Optionally publish descendants. Call get-page or get-document-type first to discover valid property aliases.",
2740
+ 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.",
2763
2741
  inputSchema: inputSchema27,
2764
2742
  outputSchema: outputSchema27,
2765
2743
  slices: ["publish", "update"],
@@ -2770,6 +2748,7 @@ var tool27 = {
2770
2748
  const doc = docResult.data;
2771
2749
  const pageName = doc.variants?.[0]?.name ?? "Unknown";
2772
2750
  const fieldNames = (values ?? []).map((v) => v.alias);
2751
+ const hasValues = (values?.length ?? 0) > 0;
2773
2752
  if (includeDescendants) {
2774
2753
  if (!await requestApproval(extra, `Publish "${pageName}" and all its descendants?`)) {
2775
2754
  return createToolResult({
@@ -2784,9 +2763,9 @@ var tool27 = {
2784
2763
  }
2785
2764
  }
2786
2765
  const variantCultures = (doc.variants ?? []).length ? doc.variants.map((v) => v.culture ?? null) : [null];
2787
- const saved = !!(values && values.length > 0);
2788
2766
  if (includeDescendants) {
2789
- if (saved) {
2767
+ let saved = false;
2768
+ if (hasValues) {
2790
2769
  const properties = values.map((v) => ({
2791
2770
  alias: v.alias,
2792
2771
  value: v.value,
@@ -2795,6 +2774,7 @@ var tool27 = {
2795
2774
  }));
2796
2775
  const updateResult = await chainCms("update-document-properties", { id, properties });
2797
2776
  if (!updateResult.ok) return updateResult.errorResult;
2777
+ saved = true;
2798
2778
  }
2799
2779
  const publishResult = await chainCms("publish-document-with-descendants", {
2800
2780
  id,
@@ -2817,85 +2797,74 @@ var tool27 = {
2817
2797
  }
2818
2798
  return publishResult.errorResult;
2819
2799
  }
2820
- } else {
2821
- const mergedValues = mergeValues(doc.values ?? [], values ?? []);
2822
- const variants = (doc.variants ?? []).map((v) => ({
2823
- culture: v.culture ?? null,
2824
- segment: v.segment ?? null,
2825
- name: v.name
2826
- }));
2827
- if (await isCmsToolAvailable("update-and-publish-document")) {
2828
- const updateAndPublishResult = await chainCms("update-and-publish-document", {
2829
- id,
2830
- data: {
2831
- values: mergedValues,
2832
- variants,
2833
- template: doc.template ?? null,
2834
- culturesToPublish: variantCultures.filter((c) => c !== null)
2835
- }
2836
- });
2837
- if (!updateAndPublishResult.ok) return updateAndPublishResult.errorResult;
2838
- } else {
2839
- const updateResult = await chainCms("update-document", {
2840
- id,
2841
- data: {
2842
- values: mergedValues,
2843
- variants,
2844
- template: doc.template ?? null
2845
- }
2800
+ const savedPart2 = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2801
+ return createToolResult({
2802
+ message: `${savedPart2}published "${pageName}" and all descendants`,
2803
+ id,
2804
+ name: pageName,
2805
+ saved,
2806
+ published: true,
2807
+ updatedFields: fieldNames,
2808
+ publishedUrls: await fetchPublishedUrls(id)
2809
+ });
2810
+ }
2811
+ if (hasValues) {
2812
+ const updateAndPublishResult = await chainCms("update-and-publish-document", {
2813
+ id,
2814
+ data: {
2815
+ culturesToPublish: [...new Set(variantCultures.filter((c) => c !== null))],
2816
+ template: doc.template ?? null,
2817
+ values: mergeValues(doc.values ?? [], values),
2818
+ variants: (doc.variants ?? []).map((v) => ({
2819
+ culture: v.culture ?? null,
2820
+ segment: v.segment ?? null,
2821
+ name: v.name
2822
+ }))
2823
+ }
2824
+ });
2825
+ if (!updateAndPublishResult.ok) {
2826
+ 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.`;
2827
+ const problem = extractInnerProblemDetails(updateAndPublishResult.errorResult);
2828
+ return createToolResultError({
2829
+ ...problem,
2830
+ status: typeof problem?.status === "number" ? problem.status : 500,
2831
+ title: "Save and publish failed",
2832
+ detail: problem?.detail ? `${String(problem.detail)} ${rolledBack}` : rolledBack
2846
2833
  });
2847
- if (!updateResult.ok) return updateResult.errorResult;
2848
- const publishResult = await chainCms("publish-document", {
2834
+ }
2835
+ } else {
2836
+ const publishResult = await chainCms("publish-document", {
2837
+ id,
2838
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
2839
+ });
2840
+ if (!publishResult.ok) return publishResult.errorResult;
2841
+ }
2842
+ const verifyError = await verifyDocumentPublished(id, variantCultures);
2843
+ if (verifyError) {
2844
+ if (hasValues) {
2845
+ return createToolResult({
2846
+ message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2849
2847
  id,
2850
- data: {
2851
- publishSchedules: variantCultures.map((c) => ({ culture: c }))
2852
- }
2853
- });
2854
- if (!publishResult.ok) {
2855
- if (saved) {
2856
- return createToolResult({
2857
- message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish failed: ${publishResult.errorResult.content?.[0]?.text ?? "unknown error"}`,
2858
- id,
2859
- name: pageName,
2860
- saved: true,
2861
- published: false,
2862
- updatedFields: fieldNames,
2863
- publishedUrls: []
2864
- });
2865
- }
2866
- return publishResult.errorResult;
2867
- }
2868
- }
2869
- }
2870
- if (!includeDescendants) {
2871
- const verifyError = await verifyDocumentPublished(id, variantCultures);
2872
- if (verifyError) {
2873
- if (saved) {
2874
- return createToolResult({
2875
- message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2876
- id,
2877
- name: pageName,
2878
- saved: true,
2879
- published: false,
2880
- updatedFields: fieldNames,
2881
- publishedUrls: []
2882
- });
2883
- }
2884
- return createToolResultError({
2885
- status: 500,
2886
- title: "Publish did not take effect",
2887
- detail: `"${pageName}": ${verifyError}`
2848
+ name: pageName,
2849
+ saved: true,
2850
+ published: false,
2851
+ updatedFields: fieldNames,
2852
+ publishedUrls: []
2888
2853
  });
2889
2854
  }
2855
+ return createToolResultError({
2856
+ status: 500,
2857
+ title: "Publish did not take effect",
2858
+ detail: `"${pageName}": ${verifyError}`
2859
+ });
2890
2860
  }
2891
2861
  const publishedUrls = await fetchPublishedUrls(id);
2892
- const savedPart = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2893
- const descPart = includeDescendants ? " and all descendants" : "";
2862
+ const savedPart = hasValues ? `Saved ${fieldNames.length} field(s) and ` : "";
2894
2863
  return createToolResult({
2895
- message: `${savedPart}published "${pageName}"${descPart}`,
2864
+ message: `${savedPart}published "${pageName}"`,
2896
2865
  id,
2897
2866
  name: pageName,
2898
- saved,
2867
+ saved: hasValues,
2899
2868
  published: true,
2900
2869
  updatedFields: fieldNames,
2901
2870
  publishedUrls
@@ -3966,263 +3935,967 @@ var collection5 = {
3966
3935
  };
3967
3936
  var media_management_default = collection5;
3968
3937
  var inputSchema46 = {
3969
- parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
3970
- take: z.number().optional().default(50).describe("Number of results to return"),
3971
- skip: z.number().optional().default(0).describe("Number of results to skip")
3938
+ id: z.string().uuid().describe("The unique ID of the element to retrieve")
3972
3939
  };
3973
3940
  var outputSchema46 = z.object({
3974
- items: z.array(z.object({
3975
- id: z.string(),
3976
- name: z.string(),
3977
- documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
3978
- })).describe("Available page blueprints"),
3979
- total: z.number()
3941
+ id: z.string(),
3942
+ name: z.string(),
3943
+ elementType: z.object({ id: z.string() }).describe("The element type (document type) this element is based on"),
3944
+ values: z.array(z.object({ alias: z.string(), value: z.any() }).passthrough()).describe("Property field values"),
3945
+ variants: z.array(z.object({ name: z.string() }).passthrough()).describe("Language/culture variants")
3980
3946
  });
3981
3947
  var tool46 = {
3982
- name: "list-blueprints",
3983
- description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
3948
+ name: "get-element",
3949
+ 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.",
3984
3950
  inputSchema: inputSchema46,
3985
3951
  outputSchema: outputSchema46,
3986
- slices: ["list"],
3952
+ slices: ["read"],
3987
3953
  annotations: { readOnlyHint: true },
3988
- handler: async ({ parentId, take, skip }) => {
3989
- const accessCheck = await checkSettingsAccess();
3990
- if (!accessCheck.ok) return accessCheck.errorResult;
3991
- if (!accessCheck.hasAccess) {
3992
- return createToolResultError({
3993
- status: 403,
3994
- title: "Settings access required",
3995
- detail: "Listing blueprints requires the signed-in Umbraco user to have access to the Settings section. Grant Settings-section access to the user's group in the Umbraco backoffice (Users \u2192 [group] \u2192 Sections), then retry."
3996
- });
3997
- }
3998
- const cursor = buildChainedCursor(skip, take);
3999
- const result = parentId ? await chainCms("get-document-blueprint-children", { parentId, cursor }) : await chainCms("get-document-blueprint-root", { cursor });
3954
+ handler: async ({ id }) => {
3955
+ const result = await chainCms("get-element-by-id", { id });
4000
3956
  if (!result.ok) return result.errorResult;
3957
+ const el = result.data;
4001
3958
  return createToolResult({
4002
- items: (result.data.items ?? []).map((item) => ({
4003
- id: item.id,
4004
- name: item.name ?? "Unknown",
4005
- documentType: item.documentType?.id ?? void 0
4006
- })),
4007
- total: result.data.total ?? 0
3959
+ id: el.id,
3960
+ name: el.variants?.[0]?.name ?? "Unknown",
3961
+ elementType: { id: el.documentType?.id ?? el.elementType?.id ?? "" },
3962
+ values: el.values ?? [],
3963
+ variants: el.variants ?? []
4008
3964
  });
4009
3965
  }
4010
3966
  };
4011
- var list_blueprints_default = withStandardDecorators(tool46);
3967
+ var get_element_default = withStandardDecorators(tool46);
4012
3968
  var inputSchema47 = {
4013
- id: z.string().uuid().describe("The ID of the blueprint to retrieve")
3969
+ 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)."),
3970
+ take: z.number().optional().default(20).describe("Number of results to return"),
3971
+ skip: z.number().optional().default(0).describe("Number of results to skip")
4014
3972
  };
4015
3973
  var outputSchema47 = z.object({
4016
- id: z.string(),
4017
- name: z.string(),
4018
- documentType: z.object({
4019
- id: z.string().optional(),
4020
- alias: z.string().optional(),
4021
- name: z.string().optional()
4022
- }).optional().describe("The document type this blueprint is based on"),
4023
- values: z.array(z.object({
4024
- alias: z.string(),
4025
- value: z.any(),
4026
- culture: z.string().nullable().optional(),
4027
- segment: z.string().nullable().optional()
4028
- })).optional().describe("Pre-filled property values"),
4029
- variants: z.array(z.object({
4030
- name: z.string().optional(),
4031
- culture: z.string().nullable().optional(),
4032
- segment: z.string().nullable().optional()
4033
- })).optional().describe("Variant information")
3974
+ items: z.array(z.object({
3975
+ id: z.string(),
3976
+ name: z.string(),
3977
+ isFolder: z.boolean().describe("True if this node is a folder that organises elements, false if it is an element item"),
3978
+ hasChildren: z.boolean()
3979
+ })).describe("Child folders and elements"),
3980
+ total: z.number().describe("Total number of children")
4034
3981
  });
4035
3982
  var tool47 = {
4036
- name: "get-blueprint",
4037
- 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.",
3983
+ name: "list-element-children",
3984
+ 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.",
4038
3985
  inputSchema: inputSchema47,
4039
3986
  outputSchema: outputSchema47,
4040
- slices: ["read"],
3987
+ slices: ["tree"],
4041
3988
  annotations: { readOnlyHint: true },
4042
- handler: async ({ id }) => {
4043
- const result = await chainCms("get-document-blueprint", { id });
3989
+ handler: async ({ parentId, take, skip }) => {
3990
+ const cursor = buildChainedCursor(skip, take);
3991
+ const result = parentId ? await chainCms("get-element-children", { parentId, cursor }) : await chainCms("get-element-root", { cursor });
4044
3992
  if (!result.ok) return result.errorResult;
4045
3993
  const data = result.data;
4046
- const dt = data.documentType;
4047
- const documentType = dt ? { id: dt.id ?? void 0, alias: dt.alias ?? void 0, name: dt.name ?? void 0 } : void 0;
4048
- const name = data.variants?.[0]?.name ?? "Unknown";
3994
+ const items = data.items ?? [];
4049
3995
  return createToolResult({
4050
- id: data.id,
4051
- name,
4052
- documentType,
4053
- values: data.values ?? [],
4054
- variants: (data.variants ?? []).map((v) => ({
4055
- name: v.name ?? void 0,
4056
- culture: v.culture ?? null,
4057
- segment: v.segment ?? null
4058
- }))
3996
+ items: items.map((item) => ({
3997
+ id: item.id,
3998
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown",
3999
+ isFolder: item.isFolder ?? false,
4000
+ hasChildren: item.hasChildren ?? false
4001
+ })),
4002
+ total: data.total ?? items.length
4059
4003
  });
4060
4004
  }
4061
4005
  };
4062
- var get_blueprint_default = withStandardDecorators(tool47);
4006
+ var list_element_children_default = withStandardDecorators(tool47);
4063
4007
  var inputSchema48 = {
4064
- pageId: z.string().uuid().describe("The ID of the source page to save as a blueprint"),
4065
- name: z.string().describe("The name for the new blueprint")
4008
+ query: z.string().describe("Search term to find Library elements by name"),
4009
+ take: z.number().optional().default(10).describe("Number of results to return (default 10)"),
4010
+ skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4066
4011
  };
4067
4012
  var outputSchema48 = z.object({
4068
- message: z.string(),
4069
- id: z.string(),
4070
- name: z.string()
4013
+ items: z.array(z.object({
4014
+ id: z.string(),
4015
+ name: z.string()
4016
+ })).describe("Matching Library elements"),
4017
+ total: z.number().describe("Total number of matches")
4071
4018
  });
4072
4019
  var tool48 = {
4073
- name: "create-blueprint",
4074
- description: "Save an existing page as a reusable blueprint (template). The blueprint preserves the page's document type and property values.",
4020
+ name: "search-elements",
4021
+ 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).",
4075
4022
  inputSchema: inputSchema48,
4076
4023
  outputSchema: outputSchema48,
4077
- slices: ["create"],
4078
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4079
- handler: async ({ pageId, name }) => {
4080
- let pageName = pageId;
4081
- const pageResult = await chainCms("get-document-by-id", { id: pageId });
4082
- if (pageResult.ok) {
4083
- pageName = pageResult.data.variants?.[0]?.name ?? pageId;
4084
- }
4085
- const createResult = await chainCms("create-document-blueprint-from-document", {
4086
- document: { id: pageId },
4087
- name
4088
- });
4089
- if (!createResult.ok) return createResult.errorResult;
4090
- const created = createResult.data;
4091
- let createdId = created?.id ?? "";
4092
- if (!createdId) {
4093
- const lookupResult = await chainCms("get-document-blueprint-root", {
4094
- cursor: encodeCursor({ s: 0, t: 100 })
4095
- });
4096
- if (lookupResult.ok) {
4097
- const match = (lookupResult.data.items ?? []).find((b) => b.name === name);
4098
- if (match?.id) createdId = match.id;
4099
- }
4100
- }
4024
+ slices: ["search"],
4025
+ annotations: { readOnlyHint: true },
4026
+ handler: async ({ query, take, skip }) => {
4027
+ const result = await chainCms("search-element", { query, cursor: buildChainedCursor(skip, take) });
4028
+ if (!result.ok) return result.errorResult;
4029
+ const data = result.data;
4030
+ const items = data.items ?? [];
4101
4031
  return createToolResult({
4102
- message: `Created blueprint "${name}" from page "${pageName}"`,
4103
- id: createdId,
4104
- name
4032
+ items: items.map((item) => ({
4033
+ id: item.id,
4034
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown"
4035
+ })),
4036
+ total: data.total ?? items.length
4105
4037
  });
4106
4038
  }
4107
4039
  };
4108
- var create_blueprint_default = withStandardDecorators(tool48);
4109
-
4110
- // src/umbraco-api/tools/blueprint/index.ts
4111
- var collection6 = {
4112
- metadata: {
4113
- name: "blueprint",
4114
- displayName: "Blueprints",
4115
- description: "List, view, and create page blueprints"
4116
- },
4117
- tools: () => [list_blueprints_default, get_blueprint_default, create_blueprint_default]
4118
- };
4119
- var blueprint_default = collection6;
4120
- async function checkVariesByCulture(documentId) {
4121
- const docResult = await chainCms("get-document-by-id", { id: documentId });
4122
- if (!docResult.ok) return docResult.errorResult;
4123
- const docTypeId = docResult.data.documentType.id;
4124
- const docTypeResult = await chainCms("get-document-type-by-id", { id: docTypeId });
4125
- if (!docTypeResult.ok) return docTypeResult.errorResult;
4126
- const variesByCulture = docTypeResult.data.variesByCulture === true;
4127
- if (!variesByCulture) {
4128
- const dt = docTypeResult.data;
4129
- return createToolResultError({
4130
- status: 400,
4131
- title: "Document type is invariant",
4132
- detail: `Document type "${dt.alias ?? dt.name ?? "(unknown)"}" does not allow culture variants. Enable 'Allow segmentation/variation by culture' on the document type in the Umbraco backoffice (Settings \u2192 Document Types) before creating or copying variants.`
4133
- });
4134
- }
4135
- return null;
4136
- }
4137
-
4138
- // src/umbraco-api/tools/translation/post/create-variant.ts
4040
+ var search_elements_default = withStandardDecorators(tool48);
4139
4041
  var inputSchema49 = {
4140
- id: z.string().uuid().describe("The ID of the page to add a language variant to"),
4141
- culture: z.string().describe("The target language ISO code (e.g. 'da-DK', 'fr-FR'). Call list-languages to find available cultures."),
4142
- values: z.array(z.object({
4143
- alias: z.string().describe("The property alias"),
4144
- value: z.any().describe("The property value"),
4145
- culture: z.string().optional().describe("Culture code \u2014 defaults to the target culture if omitted"),
4146
- segment: z.string().nullable().optional().describe("The segment for segmented content")
4147
- })).optional().describe("Optional property values to set on the new variant")
4042
+ id: z.string().uuid().describe("The ID of the Library element to inspect"),
4043
+ propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
4148
4044
  };
4149
4045
  var outputSchema49 = z.object({
4150
- message: z.string(),
4151
4046
  id: z.string(),
4152
4047
  name: z.string(),
4153
- culture: z.string(),
4154
- previewUrl: previewUrlSchema,
4155
- validation: validationResultSchema
4048
+ blockProperties: blockPropertiesSchema("edit-element-block")
4156
4049
  });
4157
4050
  var tool49 = {
4158
- name: "create-variant",
4159
- 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.",
4051
+ name: "inspect-element-blocks",
4052
+ 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).",
4160
4053
  inputSchema: inputSchema49,
4161
4054
  outputSchema: outputSchema49,
4162
- slices: ["create"],
4163
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4164
- handler: async ({ id, culture, values }) => {
4165
- const variesError = await checkVariesByCulture(id);
4166
- if (variesError) return variesError;
4167
- const docResult = await chainCms("get-document-by-id", { id });
4168
- if (!docResult.ok) return docResult.errorResult;
4169
- const doc = docResult.data;
4170
- const existingVariants = doc.variants ?? [];
4171
- const existingValues = doc.values ?? [];
4172
- const pageName = existingVariants[0]?.name ?? "Unknown";
4173
- const variantExists = existingVariants.some((v) => v.culture === culture);
4174
- if (variantExists) {
4175
- return createToolResultError({ isError: true, content: [{ type: "text", text: `Variant for ${culture} already exists on this page` }] });
4176
- }
4177
- const newVariant = { culture, name: pageName, segment: null };
4178
- const newCultureValues = (values ?? []).map((v) => ({
4179
- alias: v.alias,
4180
- value: v.value,
4181
- culture: v.culture ?? culture,
4182
- segment: v.segment ?? null
4183
- }));
4184
- const updateResult = await chainCms("update-document", {
4185
- id,
4186
- data: {
4187
- variants: [...existingVariants, newVariant],
4188
- values: [...existingValues, ...newCultureValues]
4189
- }
4190
- });
4191
- if (!updateResult.ok) return updateResult.errorResult;
4192
- const validation = await validateDocumentState(id);
4193
- const baseMessage = `Created ${culture} variant for "${pageName}"`;
4194
- const message = validation.valid ? baseMessage : `${baseMessage} \u2014 but ${validation.errors.length} validation error(s) must be resolved before this page can be published`;
4055
+ slices: ["read"],
4056
+ annotations: { readOnlyHint: true },
4057
+ handler: async ({ id, propertyAlias }) => {
4058
+ const result = await chainCms("get-element-by-id", { id });
4059
+ if (!result.ok) return result.errorResult;
4060
+ const element = result.data;
4195
4061
  return createToolResult({
4196
- message,
4197
- id,
4198
- name: pageName,
4199
- culture,
4200
- previewUrl: await fetchPreviewUrl(id, { culture }),
4201
- validation
4062
+ id: element.id,
4063
+ name: element.variants?.[0]?.name ?? "Unknown",
4064
+ blockProperties: collectBlockProperties(element.values ?? [], propertyAlias)
4202
4065
  });
4203
4066
  }
4204
4067
  };
4205
- var create_variant_default = withStandardDecorators(tool49);
4068
+ var inspect_element_blocks_default = withStandardDecorators(tool49);
4206
4069
  var inputSchema50 = {
4207
- id: z.string().uuid().describe("The ID of the page to copy a variant on"),
4208
- sourceCulture: z.string().describe("The source language ISO code to copy content from (e.g. 'en-US')"),
4209
- targetCulture: z.string().describe("The target language ISO code to copy content to (e.g. 'da-DK')")
4070
+ name: z.string().describe("The name of the element to create"),
4071
+ 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."),
4072
+ 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."),
4073
+ values: z.array(z.object({
4074
+ alias: z.string().describe("The property alias"),
4075
+ value: z.any().describe("The property value"),
4076
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4077
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4078
+ })).optional().describe("Initial property values to set on the new element")
4210
4079
  };
4211
4080
  var outputSchema50 = z.object({
4212
4081
  message: z.string(),
4213
4082
  id: z.string(),
4214
- name: z.string(),
4215
- sourceCulture: z.string(),
4216
- targetCulture: z.string(),
4217
- copiedFields: z.array(z.string()),
4218
- previewUrl: previewUrlSchema,
4219
- validation: validationResultSchema
4083
+ name: z.string()
4220
4084
  });
4221
4085
  var tool50 = {
4086
+ name: "create-element",
4087
+ 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.",
4088
+ inputSchema: inputSchema50,
4089
+ outputSchema: outputSchema50,
4090
+ slices: ["create"],
4091
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4092
+ handler: async ({ name, elementTypeId, parentId, values }) => {
4093
+ const resolved = await resolveEditorAliases(elementTypeId, values);
4094
+ if (!resolved.ok) return resolved.errorResult;
4095
+ const createResult = await chainCms("create-element", {
4096
+ documentTypeId: elementTypeId,
4097
+ name,
4098
+ values: resolved.values,
4099
+ ...parentId ? { parentId } : {}
4100
+ });
4101
+ if (!createResult.ok) return createResult.errorResult;
4102
+ return createToolResult({
4103
+ message: `Created draft element "${name}"`,
4104
+ id: createResult.data.id ?? "",
4105
+ name
4106
+ });
4107
+ }
4108
+ };
4109
+ var create_element_default = withStandardDecorators(tool50);
4110
+ var inputSchema51 = {
4111
+ name: z.string().describe("The name of the element to create"),
4112
+ 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."),
4113
+ 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."),
4114
+ values: z.array(z.object({
4115
+ alias: z.string().describe("The property alias"),
4116
+ value: z.any().describe("The property value"),
4117
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4118
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4119
+ })).optional().describe("Initial property values to set on the new element")
4120
+ };
4121
+ var outputSchema51 = z.object({
4122
+ message: z.string(),
4123
+ id: z.string(),
4124
+ name: z.string()
4125
+ });
4126
+ var tool51 = {
4127
+ name: "create-and-publish-element",
4128
+ 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.",
4129
+ inputSchema: inputSchema51,
4130
+ outputSchema: outputSchema51,
4131
+ slices: ["create", "publish"],
4132
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4133
+ handler: async ({ name, elementTypeId, parentId, values }) => {
4134
+ const createResult = await chainCms("create-and-publish-element", {
4135
+ documentTypeId: elementTypeId,
4136
+ name,
4137
+ values: (values ?? []).map((v) => ({
4138
+ alias: v.alias,
4139
+ value: v.value,
4140
+ culture: v.culture ?? null,
4141
+ segment: v.segment ?? null
4142
+ })),
4143
+ ...parentId ? { parentId } : {}
4144
+ });
4145
+ if (!createResult.ok) return createResult.errorResult;
4146
+ return createToolResult({
4147
+ message: `Created and published element "${name}"`,
4148
+ id: createResult.data.id ?? "",
4149
+ name
4150
+ });
4151
+ }
4152
+ };
4153
+ var create_and_publish_element_default = withStandardDecorators(tool51);
4154
+ var inputSchema52 = {
4155
+ name: z.string().describe("Name of the new folder"),
4156
+ parentId: z.string().uuid().optional().describe("ID of the parent folder in the Library (omit to create at the root)")
4157
+ };
4158
+ var outputSchema52 = z.object({
4159
+ message: z.string(),
4160
+ id: z.string(),
4161
+ name: z.string()
4162
+ });
4163
+ var tool52 = {
4164
+ name: "create-element-folder",
4165
+ 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.",
4166
+ inputSchema: inputSchema52,
4167
+ outputSchema: outputSchema52,
4168
+ slices: ["create"],
4169
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4170
+ handler: async ({ name, parentId }) => {
4171
+ const createResult = await chainCms("create-element-folder", { name, parent: parentId ? { id: parentId } : null });
4172
+ if (!createResult.ok) return createResult.errorResult;
4173
+ let createdId = createResult.data?.id ?? "";
4174
+ let location = "at the root";
4175
+ if (!createdId) {
4176
+ const listResult = parentId ? await chainCms("get-element-children", { parentId }) : await chainCms("get-element-root", {});
4177
+ if (listResult.ok) {
4178
+ const match = (listResult.data.items ?? []).filter((i) => i.isFolder).find((i) => (i.variants?.[0]?.name ?? i.name) === name);
4179
+ if (match) createdId = match.id;
4180
+ }
4181
+ }
4182
+ if (parentId) {
4183
+ const folderResult = await chainCms("get-element-folder", { id: parentId });
4184
+ if (folderResult.ok) location = `under "${folderResult.data.name ?? "Unknown"}"`;
4185
+ }
4186
+ return createToolResult({
4187
+ message: `Created Library folder "${name}" ${location}`,
4188
+ id: createdId,
4189
+ name
4190
+ });
4191
+ }
4192
+ };
4193
+ var create_element_folder_default = withStandardDecorators(tool52);
4194
+ var inputSchema53 = {
4195
+ id: z.string().uuid().describe("The ID of the element to publish")
4196
+ };
4197
+ var outputSchema53 = z.object({
4198
+ message: z.string(),
4199
+ id: z.string(),
4200
+ name: z.string()
4201
+ });
4202
+ var tool53 = {
4203
+ name: "publish-element",
4204
+ 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.",
4205
+ inputSchema: inputSchema53,
4206
+ outputSchema: outputSchema53,
4207
+ slices: ["publish"],
4208
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4209
+ handler: async ({ id }) => {
4210
+ const elResult = await chainCms("get-element-by-id", { id });
4211
+ if (!elResult.ok) return elResult.errorResult;
4212
+ const el = elResult.data;
4213
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4214
+ const variantCultures = (el.variants ?? []).length ? el.variants.map((v) => v.culture ?? null) : [null];
4215
+ const publishResult = await chainCms("publish-element", {
4216
+ id,
4217
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
4218
+ });
4219
+ if (!publishResult.ok) return publishResult.errorResult;
4220
+ return createToolResult({
4221
+ message: `Published element "${elementName}"`,
4222
+ id,
4223
+ name: elementName
4224
+ });
4225
+ }
4226
+ };
4227
+ var publish_element_default = withStandardDecorators(tool53);
4228
+ var inputSchema54 = {
4229
+ id: z.string().uuid().describe("The ID of the element to unpublish")
4230
+ };
4231
+ var outputSchema54 = z.object({
4232
+ message: z.string(),
4233
+ id: z.string(),
4234
+ name: z.string()
4235
+ });
4236
+ var tool54 = {
4237
+ name: "unpublish-element",
4238
+ description: "Unpublish a Library element, taking it offline. The element still exists as a draft. You will be asked to confirm before unpublishing.",
4239
+ inputSchema: inputSchema54,
4240
+ outputSchema: outputSchema54,
4241
+ slices: ["publish"],
4242
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4243
+ handler: async ({ id }, extra) => {
4244
+ const elResult = await chainCms("get-element-by-id", { id });
4245
+ if (!elResult.ok) return elResult.errorResult;
4246
+ const el = elResult.data;
4247
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4248
+ if (!await requestApproval(extra, `Unpublish element "${elementName}"? This will take it offline.`)) {
4249
+ return createToolResult({ message: "Unpublish cancelled", id, name: elementName });
4250
+ }
4251
+ const cultures = (el.variants ?? []).filter((v) => v.culture).map((v) => v.culture);
4252
+ const result = await chainCms("unpublish-element", {
4253
+ id,
4254
+ data: { cultures: cultures.length > 0 ? cultures : null }
4255
+ });
4256
+ if (!result.ok) return result.errorResult;
4257
+ return createToolResult({ message: `Unpublished element "${elementName}" \u2014 it is now a draft only`, id, name: elementName });
4258
+ }
4259
+ };
4260
+ var unpublish_element_default = withStandardDecorators(tool54);
4261
+ var inputSchema55 = {
4262
+ id: z.string().uuid().describe("The ID of the element to edit"),
4263
+ values: z.array(z.object({
4264
+ alias: z.string().describe("The property alias"),
4265
+ value: z.any().describe("The new property value"),
4266
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4267
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4268
+ })).describe("Property values to update on the element")
4269
+ };
4270
+ var outputSchema55 = z.object({
4271
+ message: z.string(),
4272
+ id: z.string(),
4273
+ name: z.string(),
4274
+ updatedFields: z.array(z.string())
4275
+ });
4276
+ var tool55 = {
4277
+ name: "edit-element",
4278
+ 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).",
4279
+ inputSchema: inputSchema55,
4280
+ outputSchema: outputSchema55,
4281
+ slices: ["update"],
4282
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4283
+ handler: async ({ id, values }) => {
4284
+ const elResult = await chainCms("get-element-by-id", { id });
4285
+ if (!elResult.ok) return elResult.errorResult;
4286
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4287
+ const fieldNames = values.map((v) => v.alias);
4288
+ const properties = values.map((v) => ({
4289
+ alias: v.alias,
4290
+ value: v.value,
4291
+ culture: v.culture ?? null,
4292
+ segment: v.segment ?? null
4293
+ }));
4294
+ const updateResult = await chainCms("update-element-properties", { id, properties });
4295
+ if (!updateResult.ok) return updateResult.errorResult;
4296
+ return createToolResult({
4297
+ message: `Updated ${fieldNames.length} field(s) on element "${elementName}" (saved, not published)`,
4298
+ id,
4299
+ name: elementName,
4300
+ updatedFields: fieldNames
4301
+ });
4302
+ }
4303
+ };
4304
+ var edit_element_default = withStandardDecorators(tool55);
4305
+ var inputSchema56 = {
4306
+ id: z.string().uuid().describe("The ID of the Library element containing the block"),
4307
+ propertyAlias: z.string().describe("The element property alias containing the blocks (e.g. 'mainContent'). Use inspect-element-blocks to find this."),
4308
+ 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'."),
4309
+ values: z.array(z.object({
4310
+ alias: blockPropertyAliasSchema.describe("The property alias within the block"),
4311
+ value: z.any().describe("The new value for the property")
4312
+ })).min(1).describe("Properties to update within the block"),
4313
+ blockType: z.enum(["content", "settings"]).optional().describe("Whether to update the block's content or its settings. Defaults to 'content'."),
4314
+ culture: z.string().nullable().optional().describe("Culture code if the element property is variant"),
4315
+ segment: z.string().nullable().optional().describe("Segment if the element property is variant")
4316
+ };
4317
+ var outputSchema56 = z.object({
4318
+ message: z.string(),
4319
+ id: z.string(),
4320
+ name: z.string(),
4321
+ contentKey: z.string(),
4322
+ updatedFields: z.array(z.string()),
4323
+ warnings: z.array(z.string()).optional()
4324
+ });
4325
+ var tool56 = {
4326
+ name: "edit-element-block",
4327
+ 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).",
4328
+ inputSchema: inputSchema56,
4329
+ outputSchema: outputSchema56,
4330
+ slices: ["update"],
4331
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4332
+ handler: async ({ id, propertyAlias, contentKey, values, blockType, culture, segment }) => {
4333
+ const elResult = await chainCms("get-element-by-id", { id });
4334
+ if (!elResult.ok) return elResult.errorResult;
4335
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4336
+ const fieldNames = values.map((v) => v.alias);
4337
+ const resolvedBlockType = blockType ?? "content";
4338
+ let targetKey = contentKey;
4339
+ if (resolvedBlockType === "settings") {
4340
+ const rawValue = (elResult.data.values ?? []).find(
4341
+ (v) => v.alias === propertyAlias && (v.culture ?? null) === (culture ?? null) && (v.segment ?? null) === (segment ?? null)
4342
+ )?.value;
4343
+ const container = isRteWithBlocks(rawValue) ? rawValue.blocks : rawValue;
4344
+ const settingsKey = findSettingsKey(container, contentKey);
4345
+ if (!settingsKey) {
4346
+ return createToolResultError(
4347
+ `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.`
4348
+ );
4349
+ }
4350
+ targetKey = settingsKey;
4351
+ }
4352
+ const propsTuple = values.map((v) => ({ alias: v.alias, value: v.value }));
4353
+ const updateResult = await chainCms("update-element-block-property", {
4354
+ elementId: id,
4355
+ propertyAlias,
4356
+ culture: culture ?? null,
4357
+ segment: segment ?? null,
4358
+ updates: [{
4359
+ contentKey: targetKey,
4360
+ blockType: resolvedBlockType,
4361
+ properties: propsTuple
4362
+ }]
4363
+ });
4364
+ if (!updateResult.ok) return updateResult.errorResult;
4365
+ const results = updateResult.data.results;
4366
+ if (!results || results.length === 0) {
4367
+ return createToolResultError(
4368
+ "update-element-block-property returned no per-block result \u2014 cannot confirm the write succeeded."
4369
+ );
4370
+ }
4371
+ const classification = classifyBlockUpdateResults(results, fieldNames.length, fieldNames, 1);
4372
+ if (classification.outcome === "failed") {
4373
+ return createToolResultError(
4374
+ `Block update failed: ${classification.detail || updateResult.data.message || "no detail returned"}`
4375
+ );
4376
+ }
4377
+ if (classification.outcome === "partial") {
4378
+ return createToolResultError({
4379
+ message: `Block update partially failed: ${classification.processedCount} of ${fieldNames.length} field(s) saved \u2014 ${classification.detail}`,
4380
+ savedFields: classification.savedFields,
4381
+ failedFields: classification.failedFields,
4382
+ ...classification.savedFields.length > 0 ? { note: "savedFields were written to the element and must not be retried." } : {},
4383
+ ...classification.warnings.length ? { warnings: classification.warnings } : {}
4384
+ });
4385
+ }
4386
+ const target = resolvedBlockType === "settings" ? "settings" : "content";
4387
+ const warnings = classification.warnings;
4388
+ return createToolResult({
4389
+ message: `Updated ${fieldNames.length} field(s) in block ${target} on element "${elementName}" (saved, not published)`,
4390
+ id,
4391
+ name: elementName,
4392
+ contentKey,
4393
+ updatedFields: fieldNames,
4394
+ ...warnings.length ? { warnings } : {}
4395
+ });
4396
+ }
4397
+ };
4398
+ var edit_element_block_default = withStandardDecorators(tool56);
4399
+ var inputSchema57 = {
4400
+ id: z.string().uuid().describe("The ID of the element to delete")
4401
+ };
4402
+ var outputSchema57 = z.object({
4403
+ message: z.string(),
4404
+ id: z.string(),
4405
+ name: z.string()
4406
+ });
4407
+ var tool57 = {
4408
+ name: "delete-element",
4409
+ description: "Move a Library element to the recycle bin. It can be restored later. You will be asked to confirm before deleting.",
4410
+ inputSchema: inputSchema57,
4411
+ outputSchema: outputSchema57,
4412
+ slices: ["delete"],
4413
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4414
+ handler: async ({ id }, extra) => {
4415
+ const elResult = await chainCms("get-element-by-id", { id });
4416
+ if (!elResult.ok) return elResult.errorResult;
4417
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4418
+ if (!await requestApproval(extra, `WARNING: Move element "${elementName}" to the recycle bin? This will remove it from the Library.`)) {
4419
+ return createToolResult({ message: "Delete cancelled", id, name: elementName });
4420
+ }
4421
+ const deleteResult = await chainCms("move-element-to-recycle-bin", { id });
4422
+ if (!deleteResult.ok) return deleteResult.errorResult;
4423
+ return createToolResult({ message: `Moved element "${elementName}" to the recycle bin`, id, name: elementName });
4424
+ }
4425
+ };
4426
+ var delete_element_default = withStandardDecorators(tool57);
4427
+
4428
+ // src/umbraco-api/tools/element/index.ts
4429
+ var collection6 = {
4430
+ metadata: {
4431
+ name: "element",
4432
+ displayName: "Library Elements",
4433
+ description: "Browse, view, edit (including blocks), publish, and organise reusable Library elements (Umbraco 18 Library section)"
4434
+ },
4435
+ tools: () => [
4436
+ get_element_default,
4437
+ list_element_children_default,
4438
+ search_elements_default,
4439
+ inspect_element_blocks_default,
4440
+ create_element_default,
4441
+ create_and_publish_element_default,
4442
+ create_element_folder_default,
4443
+ edit_element_default,
4444
+ edit_element_block_default,
4445
+ publish_element_default,
4446
+ unpublish_element_default,
4447
+ delete_element_default
4448
+ ]
4449
+ };
4450
+ var element_default = collection6;
4451
+ var inputSchema58 = {
4452
+ parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
4453
+ take: z.number().optional().default(50).describe("Number of results to return"),
4454
+ skip: z.number().optional().default(0).describe("Number of results to skip")
4455
+ };
4456
+ var outputSchema58 = z.object({
4457
+ items: z.array(z.object({
4458
+ id: z.string(),
4459
+ name: z.string(),
4460
+ documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
4461
+ })).describe("Available page blueprints"),
4462
+ total: z.number()
4463
+ });
4464
+ var tool58 = {
4465
+ name: "list-blueprints",
4466
+ description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
4467
+ inputSchema: inputSchema58,
4468
+ outputSchema: outputSchema58,
4469
+ slices: ["list"],
4470
+ annotations: { readOnlyHint: true },
4471
+ handler: async ({ parentId, take, skip }) => {
4472
+ const accessCheck = await checkSettingsAccess();
4473
+ if (!accessCheck.ok) return accessCheck.errorResult;
4474
+ if (!accessCheck.hasAccess) {
4475
+ return createToolResultError({
4476
+ status: 403,
4477
+ title: "Settings access required",
4478
+ detail: "Listing blueprints requires the signed-in Umbraco user to have access to the Settings section. Grant Settings-section access to the user's group in the Umbraco backoffice (Users \u2192 [group] \u2192 Sections), then retry."
4479
+ });
4480
+ }
4481
+ const cursor = buildChainedCursor(skip, take);
4482
+ const result = parentId ? await chainCms("get-document-blueprint-children", { parentId, cursor }) : await chainCms("get-document-blueprint-root", { cursor });
4483
+ if (!result.ok) return result.errorResult;
4484
+ return createToolResult({
4485
+ items: (result.data.items ?? []).map((item) => ({
4486
+ id: item.id,
4487
+ name: item.name ?? "Unknown",
4488
+ documentType: item.documentType?.id ?? void 0
4489
+ })),
4490
+ total: result.data.total ?? 0
4491
+ });
4492
+ }
4493
+ };
4494
+ var list_blueprints_default = withStandardDecorators(tool58);
4495
+ var inputSchema59 = {
4496
+ id: z.string().uuid().describe("The ID of the blueprint to retrieve")
4497
+ };
4498
+ var outputSchema59 = z.object({
4499
+ id: z.string(),
4500
+ name: z.string(),
4501
+ documentType: z.object({
4502
+ id: z.string().optional(),
4503
+ alias: z.string().optional(),
4504
+ name: z.string().optional()
4505
+ }).optional().describe("The document type this blueprint is based on"),
4506
+ values: z.array(z.object({
4507
+ alias: z.string(),
4508
+ value: z.any(),
4509
+ culture: z.string().nullable().optional(),
4510
+ segment: z.string().nullable().optional()
4511
+ })).optional().describe("Pre-filled property values"),
4512
+ variants: z.array(z.object({
4513
+ name: z.string().optional(),
4514
+ culture: z.string().nullable().optional(),
4515
+ segment: z.string().nullable().optional()
4516
+ })).optional().describe("Variant information")
4517
+ });
4518
+ var tool59 = {
4519
+ name: "get-blueprint",
4520
+ 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.",
4521
+ inputSchema: inputSchema59,
4522
+ outputSchema: outputSchema59,
4523
+ slices: ["read"],
4524
+ annotations: { readOnlyHint: true },
4525
+ handler: async ({ id }) => {
4526
+ const result = await chainCms("get-document-blueprint", { id });
4527
+ if (!result.ok) return result.errorResult;
4528
+ const data = result.data;
4529
+ const dt = data.documentType;
4530
+ const documentType = dt ? { id: dt.id ?? void 0, alias: dt.alias ?? void 0, name: dt.name ?? void 0 } : void 0;
4531
+ const name = data.variants?.[0]?.name ?? "Unknown";
4532
+ return createToolResult({
4533
+ id: data.id,
4534
+ name,
4535
+ documentType,
4536
+ values: data.values ?? [],
4537
+ variants: (data.variants ?? []).map((v) => ({
4538
+ name: v.name ?? void 0,
4539
+ culture: v.culture ?? null,
4540
+ segment: v.segment ?? null
4541
+ }))
4542
+ });
4543
+ }
4544
+ };
4545
+ var get_blueprint_default = withStandardDecorators(tool59);
4546
+ var inputSchema60 = {
4547
+ pageId: z.string().uuid().describe("The ID of the source page to save as a blueprint"),
4548
+ name: z.string().describe("The name for the new blueprint")
4549
+ };
4550
+ var outputSchema60 = z.object({
4551
+ message: z.string(),
4552
+ id: z.string(),
4553
+ name: z.string()
4554
+ });
4555
+ var tool60 = {
4556
+ name: "create-blueprint",
4557
+ description: "Save an existing page as a reusable blueprint (template). The blueprint preserves the page's document type and property values.",
4558
+ inputSchema: inputSchema60,
4559
+ outputSchema: outputSchema60,
4560
+ slices: ["create"],
4561
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4562
+ handler: async ({ pageId, name }) => {
4563
+ let pageName = pageId;
4564
+ const pageResult = await chainCms("get-document-by-id", { id: pageId });
4565
+ if (pageResult.ok) {
4566
+ pageName = pageResult.data.variants?.[0]?.name ?? pageId;
4567
+ }
4568
+ const createResult = await chainCms("create-document-blueprint-from-document", {
4569
+ document: { id: pageId },
4570
+ name
4571
+ });
4572
+ if (!createResult.ok) return createResult.errorResult;
4573
+ const created = createResult.data;
4574
+ let createdId = created?.id ?? "";
4575
+ if (!createdId) {
4576
+ const lookupResult = await chainCms("get-document-blueprint-root", {
4577
+ cursor: encodeCursor({ s: 0, t: 100 })
4578
+ });
4579
+ if (lookupResult.ok) {
4580
+ const match = (lookupResult.data.items ?? []).find((b) => b.name === name);
4581
+ if (match?.id) createdId = match.id;
4582
+ }
4583
+ }
4584
+ return createToolResult({
4585
+ message: `Created blueprint "${name}" from page "${pageName}"`,
4586
+ id: createdId,
4587
+ name
4588
+ });
4589
+ }
4590
+ };
4591
+ var create_blueprint_default = withStandardDecorators(tool60);
4592
+
4593
+ // src/umbraco-api/tools/blueprint/index.ts
4594
+ var collection7 = {
4595
+ metadata: {
4596
+ name: "blueprint",
4597
+ displayName: "Blueprints",
4598
+ description: "List, view, and create page blueprints"
4599
+ },
4600
+ tools: () => [list_blueprints_default, get_blueprint_default, create_blueprint_default]
4601
+ };
4602
+ var blueprint_default = collection7;
4603
+ var inputSchema61 = {
4604
+ take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4605
+ skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4606
+ };
4607
+ var outputSchema61 = z.object({
4608
+ items: z.array(z.object({
4609
+ isoCode: z.string().describe("ISO language code (e.g. en-US)"),
4610
+ name: z.string().describe("Display name of the language"),
4611
+ isDefault: z.boolean().describe("Whether this is the default language"),
4612
+ isMandatory: z.boolean().describe("Whether this language is mandatory")
4613
+ })).describe("List of configured languages"),
4614
+ total: z.number().describe("Total number of languages")
4615
+ });
4616
+ var tool61 = {
4617
+ name: "list-languages",
4618
+ description: "List all languages configured on the Umbraco site. Shows the ISO code, name, and whether each language is the default or mandatory.",
4619
+ inputSchema: inputSchema61,
4620
+ outputSchema: outputSchema61,
4621
+ slices: ["list"],
4622
+ annotations: { readOnlyHint: true },
4623
+ handler: async ({ take, skip }) => {
4624
+ const result = await chainCms("get-language", { cursor: buildChainedCursor(skip, take) });
4625
+ if (!result.ok) return result.errorResult;
4626
+ const data = result.data;
4627
+ return createToolResult({
4628
+ items: (data.items ?? []).map((item) => ({
4629
+ isoCode: item.isoCode,
4630
+ name: item.name,
4631
+ isDefault: item.isDefault,
4632
+ isMandatory: item.isMandatory
4633
+ })),
4634
+ total: data.total ?? 0
4635
+ });
4636
+ }
4637
+ };
4638
+ var list_languages_default = withStandardDecorators(tool61);
4639
+ var inputSchema62 = {
4640
+ isoCode: z.string().describe("ISO language code (e.g. en-US)")
4641
+ };
4642
+ var outputSchema62 = z.object({
4643
+ isoCode: z.string().describe("ISO language code"),
4644
+ name: z.string().describe("Display name of the language"),
4645
+ isDefault: z.boolean().describe("Whether this is the default language"),
4646
+ isMandatory: z.boolean().describe("Whether this language is mandatory"),
4647
+ fallbackIsoCode: z.string().nullable().describe("ISO code of the fallback language, if set")
4648
+ });
4649
+ var tool62 = {
4650
+ name: "get-language",
4651
+ 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.",
4652
+ inputSchema: inputSchema62,
4653
+ outputSchema: outputSchema62,
4654
+ slices: ["read"],
4655
+ annotations: { readOnlyHint: true },
4656
+ handler: async ({ isoCode }) => {
4657
+ const result = await chainCms("get-language-by-iso-code", { isoCode });
4658
+ if (!result.ok) return result.errorResult;
4659
+ const data = result.data;
4660
+ return createToolResult({
4661
+ isoCode: data.isoCode,
4662
+ name: data.name,
4663
+ isDefault: data.isDefault ?? false,
4664
+ isMandatory: data.isMandatory ?? false,
4665
+ fallbackIsoCode: data.fallbackIsoCode ?? null
4666
+ });
4667
+ }
4668
+ };
4669
+ var get_language_default = withStandardDecorators(tool62);
4670
+ var inputSchema63 = {
4671
+ isoCode: z.string().describe("ISO language code to add (e.g. fr-FR)"),
4672
+ name: z.string().optional().describe("Display name for the language (e.g. 'French'). Defaults to the ISO code if not provided."),
4673
+ isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4674
+ isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4675
+ fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4676
+ };
4677
+ var outputSchema63 = z.object({
4678
+ message: z.string(),
4679
+ isoCode: z.string(),
4680
+ name: z.string()
4681
+ });
4682
+ var tool63 = {
4683
+ name: "create-language",
4684
+ 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.",
4685
+ inputSchema: inputSchema63,
4686
+ outputSchema: outputSchema63,
4687
+ slices: ["create"],
4688
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4689
+ handler: async ({ isoCode, name: displayName, isDefault, isMandatory, fallbackIsoCode }) => {
4690
+ const langName = displayName || isoCode;
4691
+ const result = await chainCms("create-language", {
4692
+ name: langName,
4693
+ isoCode,
4694
+ isDefault: isDefault ?? false,
4695
+ isMandatory: isMandatory ?? false,
4696
+ fallbackIsoCode
4697
+ });
4698
+ if (!result.ok) return result.errorResult;
4699
+ return createToolResult({
4700
+ message: `Language "${langName}" (${isoCode}) added successfully`,
4701
+ isoCode: result.data.isoCode,
4702
+ name: langName
4703
+ });
4704
+ }
4705
+ };
4706
+ var create_language_default = withStandardDecorators(tool63);
4707
+ var inputSchema64 = {
4708
+ isoCode: z.string().describe("ISO language code of the language to update (e.g. en-US)"),
4709
+ isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4710
+ isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4711
+ fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4712
+ };
4713
+ var outputSchema64 = z.object({
4714
+ message: z.string(),
4715
+ isoCode: z.string(),
4716
+ name: z.string()
4717
+ });
4718
+ var tool64 = {
4719
+ name: "update-language",
4720
+ description: "Update a language's settings (default, mandatory, fallback).",
4721
+ inputSchema: inputSchema64,
4722
+ outputSchema: outputSchema64,
4723
+ slices: ["update"],
4724
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4725
+ handler: async ({ isoCode, isDefault, isMandatory, fallbackIsoCode }) => {
4726
+ const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4727
+ if (!langResult.ok) return langResult.errorResult;
4728
+ const lang = langResult.data;
4729
+ const name = lang.name ?? isoCode;
4730
+ const result = await chainCms("update-language", {
4731
+ isoCode,
4732
+ data: {
4733
+ name,
4734
+ isDefault: isDefault ?? lang.isDefault ?? false,
4735
+ isMandatory: isMandatory ?? lang.isMandatory ?? false,
4736
+ fallbackIsoCode: fallbackIsoCode ?? lang.fallbackIsoCode ?? void 0
4737
+ }
4738
+ });
4739
+ if (!result.ok) return result.errorResult;
4740
+ return createToolResult({
4741
+ message: `Language "${name}" (${isoCode}) updated successfully`,
4742
+ isoCode,
4743
+ name
4744
+ });
4745
+ }
4746
+ };
4747
+ var update_language_default = withStandardDecorators(tool64);
4748
+ var inputSchema65 = {
4749
+ isoCode: z.string().describe("ISO language code of the language to delete (e.g. fr-FR)")
4750
+ };
4751
+ var outputSchema65 = z.object({
4752
+ message: z.string(),
4753
+ isoCode: z.string(),
4754
+ name: z.string()
4755
+ });
4756
+ var tool65 = {
4757
+ name: "delete-language",
4758
+ description: "Remove a language from the site. Content variants in this language will become inaccessible. You will be asked to confirm before deleting.",
4759
+ inputSchema: inputSchema65,
4760
+ outputSchema: outputSchema65,
4761
+ slices: ["delete"],
4762
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4763
+ handler: async ({ isoCode }, extra) => {
4764
+ const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4765
+ if (!langResult.ok) return langResult.errorResult;
4766
+ const lang = langResult.data;
4767
+ const name = lang.name ?? isoCode;
4768
+ const confirmMessage = `Delete language "${name}" (${isoCode})? All content variants in this language will become inaccessible.`;
4769
+ if (!await requestApproval(extra, confirmMessage)) {
4770
+ return createToolResult({ message: "Delete cancelled", isoCode, name });
4771
+ }
4772
+ const deleteResult = await chainCms("delete-language", { isoCode });
4773
+ if (!deleteResult.ok) return deleteResult.errorResult;
4774
+ return createToolResult({
4775
+ message: `Language "${name}" (${isoCode}) deleted successfully`,
4776
+ isoCode,
4777
+ name
4778
+ });
4779
+ }
4780
+ };
4781
+ var delete_language_default = withStandardDecorators(tool65);
4782
+
4783
+ // src/umbraco-api/tools/language/index.ts
4784
+ var collection8 = {
4785
+ metadata: {
4786
+ name: "language",
4787
+ displayName: "Languages",
4788
+ description: "Manage languages configured on the Umbraco site"
4789
+ },
4790
+ tools: () => [list_languages_default, get_language_default, create_language_default, update_language_default, delete_language_default]
4791
+ };
4792
+ var language_default = collection8;
4793
+ async function checkVariesByCulture(documentId) {
4794
+ const docResult = await chainCms("get-document-by-id", { id: documentId });
4795
+ if (!docResult.ok) return docResult.errorResult;
4796
+ const docTypeId = docResult.data.documentType.id;
4797
+ const docTypeResult = await chainCms("get-document-type-by-id", { id: docTypeId });
4798
+ if (!docTypeResult.ok) return docTypeResult.errorResult;
4799
+ const variesByCulture = docTypeResult.data.variesByCulture === true;
4800
+ if (!variesByCulture) {
4801
+ const dt = docTypeResult.data;
4802
+ return createToolResultError({
4803
+ status: 400,
4804
+ title: "Document type is invariant",
4805
+ detail: `Document type "${dt.alias ?? dt.name ?? "(unknown)"}" does not allow culture variants. Enable 'Allow segmentation/variation by culture' on the document type in the Umbraco backoffice (Settings \u2192 Document Types) before creating or copying variants.`
4806
+ });
4807
+ }
4808
+ return null;
4809
+ }
4810
+
4811
+ // src/umbraco-api/tools/translation/post/create-variant.ts
4812
+ var inputSchema66 = {
4813
+ id: z.string().uuid().describe("The ID of the page to add a language variant to"),
4814
+ culture: z.string().describe("The target language ISO code (e.g. 'da-DK', 'fr-FR'). Call list-languages to find available cultures."),
4815
+ values: z.array(z.object({
4816
+ alias: z.string().describe("The property alias"),
4817
+ value: z.any().describe("The property value"),
4818
+ culture: z.string().optional().describe("Culture code \u2014 defaults to the target culture if omitted"),
4819
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4820
+ })).optional().describe("Optional property values to set on the new variant")
4821
+ };
4822
+ var outputSchema66 = z.object({
4823
+ message: z.string(),
4824
+ id: z.string(),
4825
+ name: z.string(),
4826
+ culture: z.string(),
4827
+ previewUrl: previewUrlSchema,
4828
+ validation: validationResultSchema
4829
+ });
4830
+ var tool66 = {
4831
+ name: "create-variant",
4832
+ 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.",
4833
+ inputSchema: inputSchema66,
4834
+ outputSchema: outputSchema66,
4835
+ slices: ["create"],
4836
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4837
+ handler: async ({ id, culture, values }) => {
4838
+ const variesError = await checkVariesByCulture(id);
4839
+ if (variesError) return variesError;
4840
+ const docResult = await chainCms("get-document-by-id", { id });
4841
+ if (!docResult.ok) return docResult.errorResult;
4842
+ const doc = docResult.data;
4843
+ const existingVariants = doc.variants ?? [];
4844
+ const existingValues = doc.values ?? [];
4845
+ const pageName = existingVariants[0]?.name ?? "Unknown";
4846
+ const variantExists = existingVariants.some((v) => v.culture === culture);
4847
+ if (variantExists) {
4848
+ return createToolResultError({ isError: true, content: [{ type: "text", text: `Variant for ${culture} already exists on this page` }] });
4849
+ }
4850
+ const newVariant = { culture, name: pageName, segment: null };
4851
+ const newCultureValues = (values ?? []).map((v) => ({
4852
+ alias: v.alias,
4853
+ value: v.value,
4854
+ culture: v.culture ?? culture,
4855
+ segment: v.segment ?? null
4856
+ }));
4857
+ const updateResult = await chainCms("update-document", {
4858
+ id,
4859
+ data: {
4860
+ variants: [...existingVariants, newVariant],
4861
+ values: [...existingValues, ...newCultureValues]
4862
+ }
4863
+ });
4864
+ if (!updateResult.ok) return updateResult.errorResult;
4865
+ const validation = await validateDocumentState(id);
4866
+ const baseMessage = `Created ${culture} variant for "${pageName}"`;
4867
+ const message = validation.valid ? baseMessage : `${baseMessage} \u2014 but ${validation.errors.length} validation error(s) must be resolved before this page can be published`;
4868
+ return createToolResult({
4869
+ message,
4870
+ id,
4871
+ name: pageName,
4872
+ culture,
4873
+ previewUrl: await fetchPreviewUrl(id, { culture }),
4874
+ validation
4875
+ });
4876
+ }
4877
+ };
4878
+ var create_variant_default = withStandardDecorators(tool66);
4879
+ var inputSchema67 = {
4880
+ id: z.string().uuid().describe("The ID of the page to copy a variant on"),
4881
+ sourceCulture: z.string().describe("The source language ISO code to copy content from (e.g. 'en-US')"),
4882
+ targetCulture: z.string().describe("The target language ISO code to copy content to (e.g. 'da-DK')")
4883
+ };
4884
+ var outputSchema67 = z.object({
4885
+ message: z.string(),
4886
+ id: z.string(),
4887
+ name: z.string(),
4888
+ sourceCulture: z.string(),
4889
+ targetCulture: z.string(),
4890
+ copiedFields: z.array(z.string()),
4891
+ previewUrl: previewUrlSchema,
4892
+ validation: validationResultSchema
4893
+ });
4894
+ var tool67 = {
4222
4895
  name: "copy-variant",
4223
4896
  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.",
4224
- inputSchema: inputSchema50,
4225
- outputSchema: outputSchema50,
4897
+ inputSchema: inputSchema67,
4898
+ outputSchema: outputSchema67,
4226
4899
  slices: ["create"],
4227
4900
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4228
4901
  handler: async ({ id, sourceCulture, targetCulture }, extra) => {
@@ -4276,14 +4949,14 @@ var tool50 = {
4276
4949
  });
4277
4950
  }
4278
4951
  };
4279
- var copy_variant_default = withStandardDecorators(tool50);
4280
- var inputSchema51 = {
4952
+ var copy_variant_default = withStandardDecorators(tool67);
4953
+ var inputSchema68 = {
4281
4954
  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."),
4282
4955
  parentId: z.string().uuid().optional().describe("Parent page ID to search under. Omit to search root-level pages."),
4283
4956
  take: z.number().optional().default(20).describe("Number of results to return"),
4284
4957
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4285
4958
  };
4286
- var outputSchema51 = z.object({
4959
+ var outputSchema68 = z.object({
4287
4960
  items: z.array(z.object({
4288
4961
  id: z.string(),
4289
4962
  name: z.string(),
@@ -4291,11 +4964,11 @@ var outputSchema51 = z.object({
4291
4964
  })).describe("Pages that are missing the specified language variant"),
4292
4965
  total: z.number().describe("Total number of pages missing the variant (before pagination)")
4293
4966
  });
4294
- var tool51 = {
4967
+ var tool68 = {
4295
4968
  name: "list-untranslated",
4296
4969
  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.",
4297
- inputSchema: inputSchema51,
4298
- outputSchema: outputSchema51,
4970
+ inputSchema: inputSchema68,
4971
+ outputSchema: outputSchema68,
4299
4972
  slices: ["search"],
4300
4973
  annotations: { readOnlyHint: true },
4301
4974
  handler: async ({ culture, parentId, take, skip }) => {
@@ -4328,10 +5001,10 @@ var tool51 = {
4328
5001
  return createToolResult({ items: paged, total });
4329
5002
  }
4330
5003
  };
4331
- var list_untranslated_default = withStandardDecorators(tool51);
5004
+ var list_untranslated_default = withStandardDecorators(tool68);
4332
5005
 
4333
5006
  // src/umbraco-api/tools/translation/index.ts
4334
- var collection7 = {
5007
+ var collection9 = {
4335
5008
  metadata: {
4336
5009
  name: "translation",
4337
5010
  displayName: "Translation",
@@ -4339,203 +5012,13 @@ var collection7 = {
4339
5012
  },
4340
5013
  tools: () => [create_variant_default, copy_variant_default, list_untranslated_default]
4341
5014
  };
4342
- var translation_default = collection7;
4343
- var inputSchema52 = {
4344
- take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4345
- skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4346
- };
4347
- var outputSchema52 = z.object({
4348
- items: z.array(z.object({
4349
- isoCode: z.string().describe("ISO language code (e.g. en-US)"),
4350
- name: z.string().describe("Display name of the language"),
4351
- isDefault: z.boolean().describe("Whether this is the default language"),
4352
- isMandatory: z.boolean().describe("Whether this language is mandatory")
4353
- })).describe("List of configured languages"),
4354
- total: z.number().describe("Total number of languages")
4355
- });
4356
- var tool52 = {
4357
- name: "list-languages",
4358
- description: "List all languages configured on the Umbraco site. Shows the ISO code, name, and whether each language is the default or mandatory.",
4359
- inputSchema: inputSchema52,
4360
- outputSchema: outputSchema52,
4361
- slices: ["list"],
4362
- annotations: { readOnlyHint: true },
4363
- handler: async ({ take, skip }) => {
4364
- const result = await chainCms("get-language", { cursor: buildChainedCursor(skip, take) });
4365
- if (!result.ok) return result.errorResult;
4366
- const data = result.data;
4367
- return createToolResult({
4368
- items: (data.items ?? []).map((item) => ({
4369
- isoCode: item.isoCode,
4370
- name: item.name,
4371
- isDefault: item.isDefault,
4372
- isMandatory: item.isMandatory
4373
- })),
4374
- total: data.total ?? 0
4375
- });
4376
- }
4377
- };
4378
- var list_languages_default = withStandardDecorators(tool52);
4379
- var inputSchema53 = {
4380
- isoCode: z.string().describe("ISO language code (e.g. en-US)")
4381
- };
4382
- var outputSchema53 = z.object({
4383
- isoCode: z.string().describe("ISO language code"),
4384
- name: z.string().describe("Display name of the language"),
4385
- isDefault: z.boolean().describe("Whether this is the default language"),
4386
- isMandatory: z.boolean().describe("Whether this language is mandatory"),
4387
- fallbackIsoCode: z.string().nullable().describe("ISO code of the fallback language, if set")
4388
- });
4389
- var tool53 = {
4390
- name: "get-language",
4391
- 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.",
4392
- inputSchema: inputSchema53,
4393
- outputSchema: outputSchema53,
4394
- slices: ["read"],
4395
- annotations: { readOnlyHint: true },
4396
- handler: async ({ isoCode }) => {
4397
- const result = await chainCms("get-language-by-iso-code", { isoCode });
4398
- if (!result.ok) return result.errorResult;
4399
- const data = result.data;
4400
- return createToolResult({
4401
- isoCode: data.isoCode,
4402
- name: data.name,
4403
- isDefault: data.isDefault ?? false,
4404
- isMandatory: data.isMandatory ?? false,
4405
- fallbackIsoCode: data.fallbackIsoCode ?? null
4406
- });
4407
- }
4408
- };
4409
- var get_language_default = withStandardDecorators(tool53);
4410
- var inputSchema54 = {
4411
- isoCode: z.string().describe("ISO language code to add (e.g. fr-FR)"),
4412
- name: z.string().optional().describe("Display name for the language (e.g. 'French'). Defaults to the ISO code if not provided."),
4413
- isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4414
- isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4415
- fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4416
- };
4417
- var outputSchema54 = z.object({
4418
- message: z.string(),
4419
- isoCode: z.string(),
4420
- name: z.string()
4421
- });
4422
- var tool54 = {
4423
- name: "create-language",
4424
- 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.",
4425
- inputSchema: inputSchema54,
4426
- outputSchema: outputSchema54,
4427
- slices: ["create"],
4428
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4429
- handler: async ({ isoCode, name: displayName, isDefault, isMandatory, fallbackIsoCode }) => {
4430
- const langName = displayName || isoCode;
4431
- const result = await chainCms("create-language", {
4432
- name: langName,
4433
- isoCode,
4434
- isDefault: isDefault ?? false,
4435
- isMandatory: isMandatory ?? false,
4436
- fallbackIsoCode
4437
- });
4438
- if (!result.ok) return result.errorResult;
4439
- return createToolResult({
4440
- message: `Language "${langName}" (${isoCode}) added successfully`,
4441
- isoCode: result.data.isoCode,
4442
- name: langName
4443
- });
4444
- }
4445
- };
4446
- var create_language_default = withStandardDecorators(tool54);
4447
- var inputSchema55 = {
4448
- isoCode: z.string().describe("ISO language code of the language to update (e.g. en-US)"),
4449
- isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4450
- isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4451
- fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4452
- };
4453
- var outputSchema55 = z.object({
4454
- message: z.string(),
4455
- isoCode: z.string(),
4456
- name: z.string()
4457
- });
4458
- var tool55 = {
4459
- name: "update-language",
4460
- description: "Update a language's settings (default, mandatory, fallback).",
4461
- inputSchema: inputSchema55,
4462
- outputSchema: outputSchema55,
4463
- slices: ["update"],
4464
- annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4465
- handler: async ({ isoCode, isDefault, isMandatory, fallbackIsoCode }) => {
4466
- const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4467
- if (!langResult.ok) return langResult.errorResult;
4468
- const lang = langResult.data;
4469
- const name = lang.name ?? isoCode;
4470
- const result = await chainCms("update-language", {
4471
- isoCode,
4472
- data: {
4473
- name,
4474
- isDefault: isDefault ?? lang.isDefault ?? false,
4475
- isMandatory: isMandatory ?? lang.isMandatory ?? false,
4476
- fallbackIsoCode: fallbackIsoCode ?? lang.fallbackIsoCode ?? void 0
4477
- }
4478
- });
4479
- if (!result.ok) return result.errorResult;
4480
- return createToolResult({
4481
- message: `Language "${name}" (${isoCode}) updated successfully`,
4482
- isoCode,
4483
- name
4484
- });
4485
- }
4486
- };
4487
- var update_language_default = withStandardDecorators(tool55);
4488
- var inputSchema56 = {
4489
- isoCode: z.string().describe("ISO language code of the language to delete (e.g. fr-FR)")
4490
- };
4491
- var outputSchema56 = z.object({
4492
- message: z.string(),
4493
- isoCode: z.string(),
4494
- name: z.string()
4495
- });
4496
- var tool56 = {
4497
- name: "delete-language",
4498
- description: "Remove a language from the site. Content variants in this language will become inaccessible. You will be asked to confirm before deleting.",
4499
- inputSchema: inputSchema56,
4500
- outputSchema: outputSchema56,
4501
- slices: ["delete"],
4502
- annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4503
- handler: async ({ isoCode }, extra) => {
4504
- const langResult = await chainCms("get-language-by-iso-code", { isoCode });
4505
- if (!langResult.ok) return langResult.errorResult;
4506
- const lang = langResult.data;
4507
- const name = lang.name ?? isoCode;
4508
- const confirmMessage = `Delete language "${name}" (${isoCode})? All content variants in this language will become inaccessible.`;
4509
- if (!await requestApproval(extra, confirmMessage)) {
4510
- return createToolResult({ message: "Delete cancelled", isoCode, name });
4511
- }
4512
- const deleteResult = await chainCms("delete-language", { isoCode });
4513
- if (!deleteResult.ok) return deleteResult.errorResult;
4514
- return createToolResult({
4515
- message: `Language "${name}" (${isoCode}) deleted successfully`,
4516
- isoCode,
4517
- name
4518
- });
4519
- }
4520
- };
4521
- var delete_language_default = withStandardDecorators(tool56);
4522
-
4523
- // src/umbraco-api/tools/language/index.ts
4524
- var collection8 = {
4525
- metadata: {
4526
- name: "language",
4527
- displayName: "Languages",
4528
- description: "Manage languages configured on the Umbraco site"
4529
- },
4530
- tools: () => [list_languages_default, get_language_default, create_language_default, update_language_default, delete_language_default]
4531
- };
4532
- var language_default = collection8;
4533
- var inputSchema57 = {
5015
+ var translation_default = collection9;
5016
+ var inputSchema69 = {
4534
5017
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to list root-level entries"),
4535
5018
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4536
5019
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4537
5020
  };
4538
- var outputSchema57 = z.object({
5021
+ var outputSchema69 = z.object({
4539
5022
  items: z.array(
4540
5023
  z.object({
4541
5024
  id: z.string(),
@@ -4545,11 +5028,11 @@ var outputSchema57 = z.object({
4545
5028
  ).describe("Dictionary items"),
4546
5029
  total: z.number().describe("Total number of items")
4547
5030
  });
4548
- var tool57 = {
5031
+ var tool69 = {
4549
5032
  name: "list-dictionary",
4550
5033
  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.",
4551
- inputSchema: inputSchema57,
4552
- outputSchema: outputSchema57,
5034
+ inputSchema: inputSchema69,
5035
+ outputSchema: outputSchema69,
4553
5036
  slices: ["list", "tree"],
4554
5037
  annotations: { readOnlyHint: true },
4555
5038
  handler: async ({ parentId, take, skip }) => {
@@ -4575,11 +5058,11 @@ var tool57 = {
4575
5058
  });
4576
5059
  }
4577
5060
  };
4578
- var list_dictionary_default = withStandardDecorators(tool57);
4579
- var inputSchema58 = {
5061
+ var list_dictionary_default = withStandardDecorators(tool69);
5062
+ var inputSchema70 = {
4580
5063
  query: z.string().describe("Search term to match against dictionary item key names")
4581
5064
  };
4582
- var outputSchema58 = z.object({
5065
+ var outputSchema70 = z.object({
4583
5066
  items: z.array(
4584
5067
  z.object({
4585
5068
  id: z.string(),
@@ -4588,11 +5071,11 @@ var outputSchema58 = z.object({
4588
5071
  ).describe("Matching dictionary items"),
4589
5072
  total: z.number().describe("Total number of matching items")
4590
5073
  });
4591
- var tool58 = {
5074
+ var tool70 = {
4592
5075
  name: "search-dictionary",
4593
5076
  description: "Search for dictionary items by key name. Use get-dictionary to see all translations for a specific item.",
4594
- inputSchema: inputSchema58,
4595
- outputSchema: outputSchema58,
5077
+ inputSchema: inputSchema70,
5078
+ outputSchema: outputSchema70,
4596
5079
  slices: ["search"],
4597
5080
  annotations: { readOnlyHint: true },
4598
5081
  handler: async ({ query }) => {
@@ -4607,11 +5090,11 @@ var tool58 = {
4607
5090
  });
4608
5091
  }
4609
5092
  };
4610
- var search_dictionary_default = withStandardDecorators(tool58);
4611
- var inputSchema59 = {
5093
+ var search_dictionary_default = withStandardDecorators(tool70);
5094
+ var inputSchema71 = {
4612
5095
  id: z.string().uuid().describe("UUID of the dictionary item to retrieve")
4613
5096
  };
4614
- var outputSchema59 = z.object({
5097
+ var outputSchema71 = z.object({
4615
5098
  id: z.string(),
4616
5099
  name: z.string(),
4617
5100
  translations: z.array(
@@ -4622,11 +5105,11 @@ var outputSchema59 = z.object({
4622
5105
  })
4623
5106
  ).describe("All translations for this dictionary item")
4624
5107
  });
4625
- var tool59 = {
5108
+ var tool71 = {
4626
5109
  name: "get-dictionary",
4627
5110
  description: "Get a dictionary item with all its translations across languages. Shows the key name and each language's translation value.",
4628
- inputSchema: inputSchema59,
4629
- outputSchema: outputSchema59,
5111
+ inputSchema: inputSchema71,
5112
+ outputSchema: outputSchema71,
4630
5113
  slices: ["read"],
4631
5114
  annotations: { readOnlyHint: true },
4632
5115
  handler: async ({ id }) => {
@@ -4648,8 +5131,8 @@ var tool59 = {
4648
5131
  });
4649
5132
  }
4650
5133
  };
4651
- var get_dictionary_default = withStandardDecorators(tool59);
4652
- var inputSchema60 = {
5134
+ var get_dictionary_default = withStandardDecorators(tool71);
5135
+ var inputSchema72 = {
4653
5136
  name: z.string().describe("The dictionary key name"),
4654
5137
  translations: z.array(
4655
5138
  z.object({
@@ -4659,16 +5142,16 @@ var inputSchema60 = {
4659
5142
  ).describe("Translations to set for this dictionary item"),
4660
5143
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to create at the root")
4661
5144
  };
4662
- var outputSchema60 = z.object({
5145
+ var outputSchema72 = z.object({
4663
5146
  message: z.string(),
4664
5147
  id: z.string(),
4665
5148
  name: z.string()
4666
5149
  });
4667
- var tool60 = {
5150
+ var tool72 = {
4668
5151
  name: "create-dictionary",
4669
5152
  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.",
4670
- inputSchema: inputSchema60,
4671
- outputSchema: outputSchema60,
5153
+ inputSchema: inputSchema72,
5154
+ outputSchema: outputSchema72,
4672
5155
  slices: ["create"],
4673
5156
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4674
5157
  handler: async ({ name, translations, parentId }) => {
@@ -4685,8 +5168,8 @@ var tool60 = {
4685
5168
  });
4686
5169
  }
4687
5170
  };
4688
- var create_dictionary_default = withStandardDecorators(tool60);
4689
- var inputSchema61 = {
5171
+ var create_dictionary_default = withStandardDecorators(tool72);
5172
+ var inputSchema73 = {
4690
5173
  id: z.string().uuid().describe("UUID of the dictionary item to update"),
4691
5174
  translations: z.array(
4692
5175
  z.object({
@@ -4695,17 +5178,17 @@ var inputSchema61 = {
4695
5178
  })
4696
5179
  ).describe("Translations to update. Languages not listed here will keep their existing translations.")
4697
5180
  };
4698
- var outputSchema61 = z.object({
5181
+ var outputSchema73 = z.object({
4699
5182
  message: z.string(),
4700
5183
  id: z.string(),
4701
5184
  name: z.string(),
4702
5185
  updatedLanguages: z.array(z.string()).describe("ISO codes of languages that were updated")
4703
5186
  });
4704
- var tool61 = {
5187
+ var tool73 = {
4705
5188
  name: "update-dictionary",
4706
5189
  description: "Update translations for a dictionary item. Call get-dictionary first to see existing translations.",
4707
- inputSchema: inputSchema61,
4708
- outputSchema: outputSchema61,
5190
+ inputSchema: inputSchema73,
5191
+ outputSchema: outputSchema73,
4709
5192
  slices: ["update"],
4710
5193
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4711
5194
  handler: async ({ id, translations }) => {
@@ -4737,21 +5220,21 @@ var tool61 = {
4737
5220
  });
4738
5221
  }
4739
5222
  };
4740
- var update_dictionary_default = withStandardDecorators(tool61);
4741
- var inputSchema62 = {
5223
+ var update_dictionary_default = withStandardDecorators(tool73);
5224
+ var inputSchema74 = {
4742
5225
  id: z.string().uuid().describe("UUID of the dictionary item to move"),
4743
5226
  targetParentId: z.string().uuid().optional().describe("UUID of the destination parent dictionary item, or omit to move to the root")
4744
5227
  };
4745
- var outputSchema62 = z.object({
5228
+ var outputSchema74 = z.object({
4746
5229
  message: z.string(),
4747
5230
  id: z.string(),
4748
5231
  name: z.string()
4749
5232
  });
4750
- var tool62 = {
5233
+ var tool74 = {
4751
5234
  name: "move-dictionary",
4752
5235
  description: "Move a dictionary item to a different parent in the dictionary tree, or to the root. You will be asked to confirm.",
4753
- inputSchema: inputSchema62,
4754
- outputSchema: outputSchema62,
5236
+ inputSchema: inputSchema74,
5237
+ outputSchema: outputSchema74,
4755
5238
  slices: ["move"],
4756
5239
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4757
5240
  handler: async ({ id, targetParentId }, extra) => {
@@ -4782,10 +5265,10 @@ var tool62 = {
4782
5265
  });
4783
5266
  }
4784
5267
  };
4785
- var move_dictionary_default = withStandardDecorators(tool62);
5268
+ var move_dictionary_default = withStandardDecorators(tool74);
4786
5269
 
4787
5270
  // src/umbraco-api/tools/dictionary/index.ts
4788
- var collection9 = {
5271
+ var collection10 = {
4789
5272
  metadata: {
4790
5273
  name: "dictionary",
4791
5274
  displayName: "Dictionary",
@@ -4793,13 +5276,13 @@ var collection9 = {
4793
5276
  },
4794
5277
  tools: () => [list_dictionary_default, search_dictionary_default, get_dictionary_default, create_dictionary_default, update_dictionary_default, move_dictionary_default]
4795
5278
  };
4796
- var dictionary_default = collection9;
4797
- var inputSchema63 = {
5279
+ var dictionary_default = collection10;
5280
+ var inputSchema75 = {
4798
5281
  tagGroup: z.string().optional().describe("Filter tags by group name, or omit to list all tags"),
4799
5282
  take: z.number().optional().default(50).describe("Number of tags to return"),
4800
5283
  skip: z.number().optional().default(0).describe("Number of tags to skip for pagination")
4801
5284
  };
4802
- var outputSchema63 = z.object({
5285
+ var outputSchema75 = z.object({
4803
5286
  items: z.array(
4804
5287
  z.object({
4805
5288
  id: z.number(),
@@ -4810,11 +5293,11 @@ var outputSchema63 = z.object({
4810
5293
  ).describe("Tags in use across the site"),
4811
5294
  total: z.number().describe("Total number of tags")
4812
5295
  });
4813
- var tool63 = {
5296
+ var tool75 = {
4814
5297
  name: "list-tags",
4815
5298
  description: "List tags in use across the site. Optionally filter by tag group. Shows how many content items use each tag.",
4816
- inputSchema: inputSchema63,
4817
- outputSchema: outputSchema63,
5299
+ inputSchema: inputSchema75,
5300
+ outputSchema: outputSchema75,
4818
5301
  slices: ["list"],
4819
5302
  annotations: { readOnlyHint: true },
4820
5303
  handler: async ({ tagGroup, take, skip }) => {
@@ -4831,10 +5314,10 @@ var tool63 = {
4831
5314
  });
4832
5315
  }
4833
5316
  };
4834
- var list_tags_default = withStandardDecorators(tool63);
5317
+ var list_tags_default = withStandardDecorators(tool75);
4835
5318
 
4836
5319
  // src/umbraco-api/tools/tag/index.ts
4837
- var collection10 = {
5320
+ var collection11 = {
4838
5321
  metadata: {
4839
5322
  name: "tag",
4840
5323
  displayName: "Tags",
@@ -4842,13 +5325,13 @@ var collection10 = {
4842
5325
  },
4843
5326
  tools: () => [list_tags_default]
4844
5327
  };
4845
- var tag_default = collection10;
5328
+ var tag_default = collection11;
4846
5329
  var TITLE_ALIASES = ["pageTitle", "title", "metaTitle", "seoTitle"];
4847
5330
  var META_DESC_ALIASES = ["metaDescription", "seoMetaDescription", "description"];
4848
- var inputSchema64 = {
5331
+ var inputSchema76 = {
4849
5332
  id: z.string().uuid().describe("The ID of the content page to audit")
4850
5333
  };
4851
- var outputSchema64 = z.object({
5334
+ var outputSchema76 = z.object({
4852
5335
  id: z.string().describe("Page ID"),
4853
5336
  name: z.string().describe("Page name"),
4854
5337
  url: z.string().describe("Page URL"),
@@ -4865,11 +5348,11 @@ var outputSchema64 = z.object({
4865
5348
  headings: z.array(z.object({ level: z.number(), text: z.string() })).describe("Headings found in body content"),
4866
5349
  images: z.array(z.object({ src: z.string(), alt: z.string(), hasAlt: z.boolean() })).describe("Images found in body content with alt text status")
4867
5350
  });
4868
- var tool64 = {
5351
+ var tool76 = {
4869
5352
  name: "audit-page-seo",
4870
5353
  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.",
4871
- inputSchema: inputSchema64,
4872
- outputSchema: outputSchema64,
5354
+ inputSchema: inputSchema76,
5355
+ outputSchema: outputSchema76,
4873
5356
  slices: ["read"],
4874
5357
  annotations: { readOnlyHint: true },
4875
5358
  handler: async ({ id }) => {
@@ -4913,13 +5396,13 @@ var tool64 = {
4913
5396
  });
4914
5397
  }
4915
5398
  };
4916
- var audit_page_seo_default = withStandardDecorators(tool64);
5399
+ var audit_page_seo_default = withStandardDecorators(tool76);
4917
5400
  var META_DESC_ALIASES2 = ["metaDescription", "seoMetaDescription", "description"];
4918
5401
  var BODY_CONTENT_MAX = 2e3;
4919
- var inputSchema65 = {
5402
+ var inputSchema77 = {
4920
5403
  id: z.string().uuid().describe("The ID of the content page to audit")
4921
5404
  };
4922
- var outputSchema65 = z.object({
5405
+ var outputSchema77 = z.object({
4923
5406
  id: z.string().describe("Page ID"),
4924
5407
  name: z.string().describe("Page name"),
4925
5408
  url: z.string().describe("Page URL"),
@@ -4930,11 +5413,11 @@ var outputSchema65 = z.object({
4930
5413
  documentType: z.string().describe("The document type name"),
4931
5414
  lastModified: z.string().describe("ISO date string of last modification")
4932
5415
  });
4933
- var tool65 = {
5416
+ var tool77 = {
4934
5417
  name: "audit-page-content",
4935
5418
  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.",
4936
- inputSchema: inputSchema65,
4937
- outputSchema: outputSchema65,
5419
+ inputSchema: inputSchema77,
5420
+ outputSchema: outputSchema77,
4938
5421
  slices: ["read"],
4939
5422
  annotations: { readOnlyHint: true },
4940
5423
  handler: async ({ id }) => {
@@ -4971,10 +5454,10 @@ var tool65 = {
4971
5454
  });
4972
5455
  }
4973
5456
  };
4974
- var audit_page_content_default = withStandardDecorators(tool65);
5457
+ var audit_page_content_default = withStandardDecorators(tool77);
4975
5458
 
4976
5459
  // src/umbraco-api/tools/content-health/index.ts
4977
- var collection11 = {
5460
+ var collection12 = {
4978
5461
  metadata: {
4979
5462
  name: "content-health",
4980
5463
  displayName: "Content Health",
@@ -4982,8 +5465,8 @@ var collection11 = {
4982
5465
  },
4983
5466
  tools: () => [audit_page_seo_default, audit_page_content_default]
4984
5467
  };
4985
- var content_health_default = collection11;
4986
- var inputSchema66 = {
5468
+ var content_health_default = collection12;
5469
+ var inputSchema78 = {
4987
5470
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
4988
5471
  maxDepth: z.number().optional().default(5).describe("How many levels deep to scan (default 5)")
4989
5472
  };
@@ -4998,7 +5481,7 @@ var treeNodeSchema = z.lazy(
4998
5481
  children: z.array(treeNodeSchema)
4999
5482
  })
5000
5483
  );
5001
- var outputSchema66 = z.object({
5484
+ var outputSchema78 = z.object({
5002
5485
  tree: z.array(treeNodeSchema).describe("Hierarchical site tree with children nested inside each node"),
5003
5486
  totalPages: z.number().describe("Total number of pages found across all levels"),
5004
5487
  maxDepthFound: z.number().describe("The deepest level actually found during the scan"),
@@ -5039,11 +5522,11 @@ async function buildTreeNodes(parentId, depth, maxDepth, pagesPerLevel, totalRef
5039
5522
  }
5040
5523
  return nodes;
5041
5524
  }
5042
- var tool66 = {
5525
+ var tool78 = {
5043
5526
  name: "report-site-tree-summary",
5044
5527
  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.",
5045
- inputSchema: inputSchema66,
5046
- outputSchema: outputSchema66,
5528
+ inputSchema: inputSchema78,
5529
+ outputSchema: outputSchema78,
5047
5530
  slices: ["read"],
5048
5531
  annotations: { readOnlyHint: true },
5049
5532
  handler: async ({ parentId, maxDepth }) => {
@@ -5060,14 +5543,14 @@ var tool66 = {
5060
5543
  });
5061
5544
  }
5062
5545
  };
5063
- var report_site_tree_summary_default = withStandardDecorators(tool66);
5064
- var inputSchema67 = {
5546
+ var report_site_tree_summary_default = withStandardDecorators(tool78);
5547
+ var inputSchema79 = {
5065
5548
  depthThreshold: z.number().optional().default(4).describe("Pages deeper than this level are reported (default 4)"),
5066
5549
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
5067
5550
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
5068
5551
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
5069
5552
  };
5070
- var outputSchema67 = z.object({
5553
+ var outputSchema79 = z.object({
5071
5554
  items: z.array(
5072
5555
  z.object({
5073
5556
  id: z.string(),
@@ -5082,11 +5565,11 @@ var outputSchema67 = z.object({
5082
5565
  scannedPages: z.number().describe("Total number of pages scanned during the walk"),
5083
5566
  threshold: z.number().describe("The depth threshold used for this scan")
5084
5567
  });
5085
- var tool67 = {
5568
+ var tool79 = {
5086
5569
  name: "report-deep-pages",
5087
5570
  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.",
5088
- inputSchema: inputSchema67,
5089
- outputSchema: outputSchema67,
5571
+ inputSchema: inputSchema79,
5572
+ outputSchema: outputSchema79,
5090
5573
  slices: ["read"],
5091
5574
  annotations: { readOnlyHint: true },
5092
5575
  handler: async ({ depthThreshold, parentId, take, skip }) => {
@@ -5133,10 +5616,10 @@ var tool67 = {
5133
5616
  });
5134
5617
  }
5135
5618
  };
5136
- var report_deep_pages_default = withStandardDecorators(tool67);
5619
+ var report_deep_pages_default = withStandardDecorators(tool79);
5137
5620
 
5138
5621
  // src/umbraco-api/tools/site-structure/index.ts
5139
- var collection12 = {
5622
+ var collection13 = {
5140
5623
  metadata: {
5141
5624
  name: "site-structure",
5142
5625
  displayName: "Site Structure",
@@ -5144,12 +5627,12 @@ var collection12 = {
5144
5627
  },
5145
5628
  tools: () => [report_site_tree_summary_default, report_deep_pages_default]
5146
5629
  };
5147
- var site_structure_default = collection12;
5148
- var inputSchema68 = {
5630
+ var site_structure_default = collection13;
5631
+ var inputSchema80 = {
5149
5632
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to publish (max 10)"),
5150
5633
  includeDescendants: z.boolean().optional().default(false).describe("Whether to also publish all child pages of each page")
5151
5634
  };
5152
- var outputSchema68 = z.object({
5635
+ var outputSchema80 = z.object({
5153
5636
  message: z.string(),
5154
5637
  results: z.array(z.object({
5155
5638
  id: z.string(),
@@ -5163,11 +5646,11 @@ var outputSchema68 = z.object({
5163
5646
  failureCount: z.number(),
5164
5647
  skippedCount: z.number()
5165
5648
  });
5166
- var tool68 = {
5649
+ var tool80 = {
5167
5650
  name: "bulk-publish",
5168
5651
  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.",
5169
- inputSchema: inputSchema68,
5170
- outputSchema: outputSchema68,
5652
+ inputSchema: inputSchema80,
5653
+ outputSchema: outputSchema80,
5171
5654
  slices: ["publish"],
5172
5655
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5173
5656
  handler: async ({ ids, includeDescendants }, extra) => {
@@ -5219,11 +5702,11 @@ ${nameList}`;
5219
5702
  return createToolResult(buildBulkOutput("Published", results));
5220
5703
  }
5221
5704
  };
5222
- var bulk_publish_default = withStandardDecorators(tool68);
5223
- var inputSchema69 = {
5705
+ var bulk_publish_default = withStandardDecorators(tool80);
5706
+ var inputSchema81 = {
5224
5707
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to unpublish (max 10)")
5225
5708
  };
5226
- var outputSchema69 = z.object({
5709
+ var outputSchema81 = z.object({
5227
5710
  message: z.string(),
5228
5711
  results: z.array(z.object({
5229
5712
  id: z.string(),
@@ -5237,11 +5720,11 @@ var outputSchema69 = z.object({
5237
5720
  failureCount: z.number(),
5238
5721
  skippedCount: z.number()
5239
5722
  });
5240
- var tool69 = {
5723
+ var tool81 = {
5241
5724
  name: "bulk-unpublish",
5242
5725
  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.",
5243
- inputSchema: inputSchema69,
5244
- outputSchema: outputSchema69,
5726
+ inputSchema: inputSchema81,
5727
+ outputSchema: outputSchema81,
5245
5728
  slices: ["publish"],
5246
5729
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5247
5730
  handler: async ({ ids }, extra) => {
@@ -5297,7 +5780,7 @@ ${nameList}`;
5297
5780
  return createToolResult(buildBulkOutput("Unpublished", results));
5298
5781
  }
5299
5782
  };
5300
- var bulk_unpublish_default = withStandardDecorators(tool69);
5783
+ var bulk_unpublish_default = withStandardDecorators(tool81);
5301
5784
 
5302
5785
  // src/umbraco-api/tools/helpers/format-date.ts
5303
5786
  function formatDate(iso) {
@@ -5311,11 +5794,11 @@ function formatDate(iso) {
5311
5794
  }
5312
5795
 
5313
5796
  // src/umbraco-api/tools/bulk-operations/post/bulk-schedule-publish.ts
5314
- var inputSchema70 = {
5797
+ var inputSchema82 = {
5315
5798
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to schedule for publishing (max 10)"),
5316
5799
  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.")
5317
5800
  };
5318
- var outputSchema70 = z.object({
5801
+ var outputSchema82 = z.object({
5319
5802
  message: z.string(),
5320
5803
  results: z.array(z.object({
5321
5804
  id: z.string(),
@@ -5329,11 +5812,11 @@ var outputSchema70 = z.object({
5329
5812
  failureCount: z.number(),
5330
5813
  skippedCount: z.number()
5331
5814
  });
5332
- var tool70 = {
5815
+ var tool82 = {
5333
5816
  name: "bulk-schedule-publish",
5334
5817
  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.",
5335
- inputSchema: inputSchema70,
5336
- outputSchema: outputSchema70,
5818
+ inputSchema: inputSchema82,
5819
+ outputSchema: outputSchema82,
5337
5820
  slices: ["publish"],
5338
5821
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5339
5822
  handler: async ({ ids, publishDate }, extra) => {
@@ -5378,15 +5861,15 @@ ${nameList}`;
5378
5861
  return createToolResult(buildBulkOutput("Scheduled", results));
5379
5862
  }
5380
5863
  };
5381
- var bulk_schedule_publish_default = withStandardDecorators(tool70);
5382
- var inputSchema71 = {
5864
+ var bulk_schedule_publish_default = withStandardDecorators(tool82);
5865
+ var inputSchema83 = {
5383
5866
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5384
5867
  alias: z.string().describe("The property alias to set (call get-page first to verify it exists on the document type)"),
5385
5868
  value: z.any().describe("The value to set on the property"),
5386
5869
  culture: z.string().optional().describe("The culture code for variant content (omit for invariant properties)"),
5387
5870
  segment: z.string().optional().describe("The segment for segmented content (omit if not using segments)")
5388
5871
  };
5389
- var outputSchema71 = z.object({
5872
+ var outputSchema83 = z.object({
5390
5873
  message: z.string(),
5391
5874
  results: z.array(z.object({
5392
5875
  id: z.string(),
@@ -5401,11 +5884,11 @@ var outputSchema71 = z.object({
5401
5884
  failureCount: z.number(),
5402
5885
  skippedCount: z.number()
5403
5886
  });
5404
- var tool71 = {
5887
+ var tool83 = {
5405
5888
  name: "bulk-set-property",
5406
5889
  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.",
5407
- inputSchema: inputSchema71,
5408
- outputSchema: outputSchema71,
5890
+ inputSchema: inputSchema83,
5891
+ outputSchema: outputSchema83,
5409
5892
  slices: ["update"],
5410
5893
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5411
5894
  handler: async ({ ids, alias, value, culture, segment }, extra) => {
@@ -5452,12 +5935,12 @@ ${nameList}`;
5452
5935
  return createToolResult(buildBulkOutput("Updated", results));
5453
5936
  }
5454
5937
  };
5455
- var bulk_set_property_default = withStandardDecorators(tool71);
5456
- var inputSchema72 = {
5938
+ var bulk_set_property_default = withStandardDecorators(tool83);
5939
+ var inputSchema84 = {
5457
5940
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to move (max 10)"),
5458
5941
  targetParentId: z.string().uuid().describe("The ID of the destination parent page to move the pages into")
5459
5942
  };
5460
- var outputSchema72 = z.object({
5943
+ var outputSchema84 = z.object({
5461
5944
  message: z.string(),
5462
5945
  results: z.array(z.object({
5463
5946
  id: z.string(),
@@ -5471,11 +5954,11 @@ var outputSchema72 = z.object({
5471
5954
  failureCount: z.number(),
5472
5955
  skippedCount: z.number()
5473
5956
  });
5474
- var tool72 = {
5957
+ var tool84 = {
5475
5958
  name: "bulk-move",
5476
5959
  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.",
5477
- inputSchema: inputSchema72,
5478
- outputSchema: outputSchema72,
5960
+ inputSchema: inputSchema84,
5961
+ outputSchema: outputSchema84,
5479
5962
  slices: ["move"],
5480
5963
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5481
5964
  handler: async ({ ids, targetParentId }, extra) => {
@@ -5528,8 +6011,8 @@ ${nameList}`;
5528
6011
  return createToolResult(buildBulkOutput("Moved", results));
5529
6012
  }
5530
6013
  };
5531
- var bulk_move_default = withStandardDecorators(tool72);
5532
- var inputSchema73 = {
6014
+ var bulk_move_default = withStandardDecorators(tool84);
6015
+ var inputSchema85 = {
5533
6016
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5534
6017
  contentTypeKey: z.string().uuid().describe("The block element type key to target. Use inspect-blocks to find this."),
5535
6018
  propertyAlias: z.string().describe("The document property alias containing the blocks (e.g. 'contentRows'). Use inspect-blocks to find this."),
@@ -5540,7 +6023,7 @@ var inputSchema73 = {
5540
6023
  culture: z.string().nullable().optional().describe("Culture code if the document property is variant"),
5541
6024
  segment: z.string().nullable().optional().describe("Segment if the document property is variant")
5542
6025
  };
5543
- var outputSchema73 = z.object({
6026
+ var outputSchema85 = z.object({
5544
6027
  message: z.string(),
5545
6028
  results: z.array(z.object({
5546
6029
  id: z.string(),
@@ -5558,10 +6041,10 @@ var outputSchema73 = z.object({
5558
6041
  skippedCount: z.number(),
5559
6042
  totalBlocksUpdated: z.number()
5560
6043
  });
5561
- function isBlockListOrGridValue3(value) {
6044
+ function isBlockListOrGridValue2(value) {
5562
6045
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
5563
6046
  }
5564
- function isRteWithBlocks3(value) {
6047
+ function isRteWithBlocks2(value) {
5565
6048
  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);
5566
6049
  }
5567
6050
  function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
@@ -5569,18 +6052,18 @@ function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
5569
6052
  const prop = allValues.find((v) => v.alias === propertyAlias);
5570
6053
  if (!prop) return [];
5571
6054
  let contentData = [];
5572
- if (isBlockListOrGridValue3(prop.value)) {
6055
+ if (isBlockListOrGridValue2(prop.value)) {
5573
6056
  contentData = prop.value.contentData;
5574
- } else if (isRteWithBlocks3(prop.value)) {
6057
+ } else if (isRteWithBlocks2(prop.value)) {
5575
6058
  contentData = prop.value.blocks.contentData;
5576
6059
  }
5577
6060
  return contentData.filter((block) => block.contentTypeKey === contentTypeKey).map((block) => ({ contentKey: block.key ?? "" })).filter((b) => b.contentKey !== "");
5578
6061
  }
5579
- var tool73 = {
6062
+ var tool85 = {
5580
6063
  name: "bulk-set-block-property",
5581
6064
  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.",
5582
- inputSchema: inputSchema73,
5583
- outputSchema: outputSchema73,
6065
+ inputSchema: inputSchema85,
6066
+ outputSchema: outputSchema85,
5584
6067
  slices: ["update"],
5585
6068
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5586
6069
  handler: async ({ ids, contentTypeKey, propertyAlias, values, culture, segment }, extra) => {
@@ -5760,10 +6243,10 @@ Changes will be saved but not published.`;
5760
6243
  });
5761
6244
  }
5762
6245
  };
5763
- var bulk_set_block_property_default = withStandardDecorators(tool73);
6246
+ var bulk_set_block_property_default = withStandardDecorators(tool85);
5764
6247
 
5765
6248
  // src/umbraco-api/tools/bulk-operations/index.ts
5766
- var collection13 = {
6249
+ var collection14 = {
5767
6250
  metadata: {
5768
6251
  name: "bulk-operations",
5769
6252
  displayName: "Bulk Operations",
@@ -5771,7 +6254,7 @@ var collection13 = {
5771
6254
  },
5772
6255
  tools: () => [bulk_publish_default, bulk_unpublish_default, bulk_schedule_publish_default, bulk_set_property_default, bulk_move_default, bulk_set_block_property_default]
5773
6256
  };
5774
- var bulk_operations_default = collection13;
6257
+ var bulk_operations_default = collection14;
5775
6258
 
5776
6259
  // src/umbraco-api/tools/member-reporting/get/member-type-helper.ts
5777
6260
  function memberTypeToString(memberType) {
@@ -5785,12 +6268,12 @@ function memberTypeToString(memberType) {
5785
6268
  }
5786
6269
 
5787
6270
  // src/umbraco-api/tools/member/get/search-members.ts
5788
- var inputSchema74 = {
6271
+ var inputSchema86 = {
5789
6272
  query: z.string().describe("Search term to find members by name or email address"),
5790
6273
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
5791
6274
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5792
6275
  };
5793
- var outputSchema74 = z.object({
6276
+ var outputSchema86 = z.object({
5794
6277
  items: z.array(z.object({
5795
6278
  id: z.string(),
5796
6279
  name: z.string(),
@@ -5801,11 +6284,11 @@ var outputSchema74 = z.object({
5801
6284
  })).describe("Matching members"),
5802
6285
  total: z.number().describe("Total number of matches")
5803
6286
  });
5804
- var tool74 = {
6287
+ var tool86 = {
5805
6288
  name: "search-members",
5806
6289
  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.",
5807
- inputSchema: inputSchema74,
5808
- outputSchema: outputSchema74,
6290
+ inputSchema: inputSchema86,
6291
+ outputSchema: outputSchema86,
5809
6292
  slices: ["search"],
5810
6293
  annotations: { readOnlyHint: true },
5811
6294
  handler: async ({ query, take, skip }) => {
@@ -5825,7 +6308,7 @@ var tool74 = {
5825
6308
  });
5826
6309
  }
5827
6310
  };
5828
- var search_members_default = withStandardDecorators(tool74);
6311
+ var search_members_default = withStandardDecorators(tool86);
5829
6312
 
5830
6313
  // src/umbraco-api/tools/member/sensitive-data-access.ts
5831
6314
  async function checkSensitiveDataAccess() {
@@ -5835,10 +6318,10 @@ async function checkSensitiveDataAccess() {
5835
6318
  }
5836
6319
 
5837
6320
  // src/umbraco-api/tools/member/get/get-member.ts
5838
- var inputSchema75 = {
6321
+ var inputSchema87 = {
5839
6322
  id: z.string().uuid().describe("The ID of the member to retrieve")
5840
6323
  };
5841
- var outputSchema75 = z.object({
6324
+ var outputSchema87 = z.object({
5842
6325
  id: z.string(),
5843
6326
  name: z.string(),
5844
6327
  email: z.string(),
@@ -5858,11 +6341,11 @@ var outputSchema75 = z.object({
5858
6341
  lastPasswordChangeDate: z.string().nullable(),
5859
6342
  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.")
5860
6343
  });
5861
- var tool75 = {
6344
+ var tool87 = {
5862
6345
  name: "get-member",
5863
6346
  description: "Get the full profile of a member including their groups, properties, approval status, and login history.",
5864
- inputSchema: inputSchema75,
5865
- outputSchema: outputSchema75,
6347
+ inputSchema: inputSchema87,
6348
+ outputSchema: outputSchema87,
5866
6349
  slices: ["read"],
5867
6350
  annotations: { readOnlyHint: true },
5868
6351
  handler: async ({ id }) => {
@@ -5888,12 +6371,12 @@ var tool75 = {
5888
6371
  });
5889
6372
  }
5890
6373
  };
5891
- var get_member_default = withStandardDecorators(tool75);
5892
- var inputSchema76 = {
6374
+ var get_member_default = withStandardDecorators(tool87);
6375
+ var inputSchema88 = {
5893
6376
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
5894
6377
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5895
6378
  };
5896
- var outputSchema76 = z.object({
6379
+ var outputSchema88 = z.object({
5897
6380
  items: z.array(z.object({
5898
6381
  id: z.string(),
5899
6382
  alias: z.string(),
@@ -5901,11 +6384,11 @@ var outputSchema76 = z.object({
5901
6384
  })).describe("Available member types"),
5902
6385
  total: z.number().describe("Total number of member types")
5903
6386
  });
5904
- var tool76 = {
6387
+ var tool88 = {
5905
6388
  name: "list-member-types",
5906
6389
  description: "List available member types. Use this before create-member to find a valid member type ID.",
5907
- inputSchema: inputSchema76,
5908
- outputSchema: outputSchema76,
6390
+ inputSchema: inputSchema88,
6391
+ outputSchema: outputSchema88,
5909
6392
  slices: ["list"],
5910
6393
  annotations: { readOnlyHint: true },
5911
6394
  handler: async ({ take, skip }) => {
@@ -5921,8 +6404,8 @@ var tool76 = {
5921
6404
  });
5922
6405
  }
5923
6406
  };
5924
- var list_member_types_default = withStandardDecorators(tool76);
5925
- var inputSchema77 = {
6407
+ var list_member_types_default = withStandardDecorators(tool88);
6408
+ var inputSchema89 = {
5926
6409
  email: z.string().email().describe("The email address for the new member"),
5927
6410
  username: z.string().describe("The username for the new member"),
5928
6411
  name: z.string().describe("The display name for the new member"),
@@ -5935,17 +6418,17 @@ var inputSchema77 = {
5935
6418
  value: z.any().describe("The property value")
5936
6419
  })).optional().describe("Custom property values to set on the new member")
5937
6420
  };
5938
- var outputSchema77 = z.object({
6421
+ var outputSchema89 = z.object({
5939
6422
  message: z.string(),
5940
6423
  id: z.string(),
5941
6424
  name: z.string(),
5942
6425
  email: z.string()
5943
6426
  });
5944
- var tool77 = {
6427
+ var tool89 = {
5945
6428
  name: "create-member",
5946
6429
  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.",
5947
- inputSchema: inputSchema77,
5948
- outputSchema: outputSchema77,
6430
+ inputSchema: inputSchema89,
6431
+ outputSchema: outputSchema89,
5949
6432
  slices: ["create"],
5950
6433
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
5951
6434
  handler: async ({ email, username, name, password, memberTypeId, isApproved, groups, values }) => {
@@ -5999,8 +6482,8 @@ var tool77 = {
5999
6482
  });
6000
6483
  }
6001
6484
  };
6002
- var create_member_default = withStandardDecorators(tool77);
6003
- var inputSchema78 = {
6485
+ var create_member_default = withStandardDecorators(tool89);
6486
+ var inputSchema90 = {
6004
6487
  id: z.string().uuid().describe("The ID of the member to update"),
6005
6488
  name: z.string().optional().describe("The new display name for the member"),
6006
6489
  email: z.string().email().optional().describe("The new email address for the member"),
@@ -6015,17 +6498,17 @@ var inputSchema78 = {
6015
6498
  value: z.any().describe("The new property value")
6016
6499
  })).optional().describe("Custom property values to update")
6017
6500
  };
6018
- var outputSchema78 = z.object({
6501
+ var outputSchema90 = z.object({
6019
6502
  message: z.string(),
6020
6503
  id: z.string(),
6021
6504
  name: z.string(),
6022
6505
  email: z.string()
6023
6506
  });
6024
- var tool78 = {
6507
+ var tool90 = {
6025
6508
  name: "update-member",
6026
6509
  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.",
6027
- inputSchema: inputSchema78,
6028
- outputSchema: outputSchema78,
6510
+ inputSchema: inputSchema90,
6511
+ outputSchema: outputSchema90,
6029
6512
  slices: ["update"],
6030
6513
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
6031
6514
  handler: async ({ id, name, email, username, newPassword, isTwoFactorEnabled, isApproved, isLockedOut, groups, values }, extra) => {
@@ -6081,21 +6564,21 @@ var tool78 = {
6081
6564
  });
6082
6565
  }
6083
6566
  };
6084
- var update_member_default = withStandardDecorators(tool78);
6085
- var inputSchema79 = {
6567
+ var update_member_default = withStandardDecorators(tool90);
6568
+ var inputSchema91 = {
6086
6569
  id: z.string().uuid().describe("The ID of the member to permanently delete")
6087
6570
  };
6088
- var outputSchema79 = z.object({
6571
+ var outputSchema91 = z.object({
6089
6572
  message: z.string(),
6090
6573
  id: z.string(),
6091
6574
  name: z.string(),
6092
6575
  email: z.string()
6093
6576
  });
6094
- var tool79 = {
6577
+ var tool91 = {
6095
6578
  name: "delete-member",
6096
6579
  description: "Permanently delete a member. This cannot be undone \u2014 there is no recycle bin for members. You will be asked to confirm.",
6097
- inputSchema: inputSchema79,
6098
- outputSchema: outputSchema79,
6580
+ inputSchema: inputSchema91,
6581
+ outputSchema: outputSchema91,
6099
6582
  slices: ["delete"],
6100
6583
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6101
6584
  handler: async ({ id }, extra) => {
@@ -6117,10 +6600,10 @@ var tool79 = {
6117
6600
  });
6118
6601
  }
6119
6602
  };
6120
- var delete_member_default = withStandardDecorators(tool79);
6603
+ var delete_member_default = withStandardDecorators(tool91);
6121
6604
 
6122
6605
  // src/umbraco-api/tools/member/index.ts
6123
- var collection14 = {
6606
+ var collection15 = {
6124
6607
  metadata: {
6125
6608
  name: "member",
6126
6609
  displayName: "Members",
@@ -6128,23 +6611,23 @@ var collection14 = {
6128
6611
  },
6129
6612
  tools: () => [search_members_default, get_member_default, list_member_types_default, create_member_default, update_member_default, delete_member_default]
6130
6613
  };
6131
- var member_default = collection14;
6132
- var inputSchema80 = {
6614
+ var member_default = collection15;
6615
+ var inputSchema92 = {
6133
6616
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6134
6617
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
6135
6618
  };
6136
- var outputSchema80 = z.object({
6619
+ var outputSchema92 = z.object({
6137
6620
  items: z.array(z.object({
6138
6621
  id: z.string(),
6139
6622
  name: z.string()
6140
6623
  })).describe("Member groups"),
6141
6624
  total: z.number().describe("Total number of member groups")
6142
6625
  });
6143
- var tool80 = {
6626
+ var tool92 = {
6144
6627
  name: "list-member-groups",
6145
6628
  description: "List all member groups. Use group names when creating or updating members to assign them to groups.",
6146
- inputSchema: inputSchema80,
6147
- outputSchema: outputSchema80,
6629
+ inputSchema: inputSchema92,
6630
+ outputSchema: outputSchema92,
6148
6631
  slices: ["list"],
6149
6632
  annotations: { readOnlyHint: true },
6150
6633
  handler: async ({ take, skip }) => {
@@ -6160,20 +6643,20 @@ var tool80 = {
6160
6643
  });
6161
6644
  }
6162
6645
  };
6163
- var list_member_groups_default = withStandardDecorators(tool80);
6164
- var inputSchema81 = {
6646
+ var list_member_groups_default = withStandardDecorators(tool92);
6647
+ var inputSchema93 = {
6165
6648
  name: z.string().describe("The name of the new member group")
6166
6649
  };
6167
- var outputSchema81 = z.object({
6650
+ var outputSchema93 = z.object({
6168
6651
  message: z.string(),
6169
6652
  id: z.string(),
6170
6653
  name: z.string()
6171
6654
  });
6172
- var tool81 = {
6655
+ var tool93 = {
6173
6656
  name: "create-member-group",
6174
6657
  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.",
6175
- inputSchema: inputSchema81,
6176
- outputSchema: outputSchema81,
6658
+ inputSchema: inputSchema93,
6659
+ outputSchema: outputSchema93,
6177
6660
  slices: ["create"],
6178
6661
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6179
6662
  handler: async ({ name }) => {
@@ -6186,20 +6669,20 @@ var tool81 = {
6186
6669
  });
6187
6670
  }
6188
6671
  };
6189
- var create_member_group_default = withStandardDecorators(tool81);
6190
- var inputSchema82 = {
6672
+ var create_member_group_default = withStandardDecorators(tool93);
6673
+ var inputSchema94 = {
6191
6674
  id: z.string().uuid().describe("The ID of the member group to delete")
6192
6675
  };
6193
- var outputSchema82 = z.object({
6676
+ var outputSchema94 = z.object({
6194
6677
  message: z.string(),
6195
6678
  id: z.string(),
6196
6679
  name: z.string()
6197
6680
  });
6198
- var tool82 = {
6681
+ var tool94 = {
6199
6682
  name: "delete-member-group",
6200
6683
  description: "Delete a member group. Members in this group will lose the group assignment. You will be asked to confirm.",
6201
- inputSchema: inputSchema82,
6202
- outputSchema: outputSchema82,
6684
+ inputSchema: inputSchema94,
6685
+ outputSchema: outputSchema94,
6203
6686
  slices: ["delete"],
6204
6687
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6205
6688
  handler: async ({ id }, extra) => {
@@ -6220,10 +6703,10 @@ var tool82 = {
6220
6703
  });
6221
6704
  }
6222
6705
  };
6223
- var delete_member_group_default = withStandardDecorators(tool82);
6706
+ var delete_member_group_default = withStandardDecorators(tool94);
6224
6707
 
6225
6708
  // src/umbraco-api/tools/member-group/index.ts
6226
- var collection15 = {
6709
+ var collection16 = {
6227
6710
  metadata: {
6228
6711
  name: "member-group",
6229
6712
  displayName: "Member Groups",
@@ -6231,74 +6714,82 @@ var collection15 = {
6231
6714
  },
6232
6715
  tools: () => [list_member_groups_default, create_member_group_default, delete_member_group_default]
6233
6716
  };
6234
- var member_group_default = collection15;
6235
- var inputSchema83 = {};
6236
- var outputSchema83 = z.object({
6237
- totalMembers: z.number().describe("Total number of members across all types and groups"),
6717
+ var member_group_default = collection16;
6718
+ var inputSchema95 = {};
6719
+ var outputSchema95 = z.object({
6720
+ totalMembers: z.number().describe("Total number of members across all types and groups (exact, server-reported \u2014 not capped by the sample)."),
6238
6721
  byType: z.array(z.object({
6239
6722
  memberType: z.string().describe("Member type alias or name"),
6240
6723
  count: z.number()
6241
- })).describe("Member counts grouped by member type. Maps naturally to a pie or bar chart."),
6724
+ })).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."),
6242
6725
  byGroup: z.array(z.object({
6243
6726
  group: z.string().describe("Member group name"),
6244
6727
  count: z.number()
6245
- })).describe("Member counts grouped by member group. Members with no group are excluded.")
6728
+ })).describe("Member counts grouped by member group \u2014 exact, server-reported per-group totals (uncapped). Members with no group are excluded.")
6246
6729
  });
6247
6730
  var PAGE_SIZE = 100;
6248
6731
  var MEMBER_CAP = 500;
6249
- var tool83 = {
6732
+ var tool95 = {
6250
6733
  name: "report-member-count",
6251
- 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.",
6252
- inputSchema: inputSchema83,
6253
- outputSchema: outputSchema83,
6734
+ 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.",
6735
+ inputSchema: inputSchema95,
6736
+ outputSchema: outputSchema95,
6254
6737
  slices: ["read"],
6255
6738
  annotations: { readOnlyHint: true },
6256
6739
  handler: async () => {
6257
- const allMembers = [];
6740
+ const sampledMembers = [];
6741
+ let totalMembers = 0;
6258
6742
  let cursor = encodeCursor({ s: 0, t: PAGE_SIZE });
6259
- while (allMembers.length < MEMBER_CAP) {
6743
+ while (sampledMembers.length < MEMBER_CAP) {
6260
6744
  const result = await chainCms("find-member", { cursor, orderBy: "username" });
6261
6745
  if (!result.ok) return result.errorResult;
6262
6746
  const data = result.data;
6263
6747
  const items = data.items ?? [];
6264
- allMembers.push(...items);
6748
+ if (typeof data.total === "number") totalMembers = data.total;
6749
+ sampledMembers.push(...items);
6265
6750
  const nextCursor = data.nextCursor;
6266
6751
  if (!nextCursor || items.length === 0) break;
6267
6752
  cursor = nextCursor;
6268
6753
  }
6754
+ if (totalMembers === 0 && sampledMembers.length > 0) totalMembers = sampledMembers.length;
6269
6755
  const typeCounts = /* @__PURE__ */ new Map();
6270
- for (const member of allMembers) {
6756
+ for (const member of sampledMembers) {
6271
6757
  const memberType = memberTypeToString(member.memberType);
6272
6758
  typeCounts.set(memberType, (typeCounts.get(memberType) ?? 0) + 1);
6273
6759
  }
6274
6760
  const groupResult = await chainCms("get-all-member-groups", {});
6275
6761
  if (!groupResult.ok) return groupResult.errorResult;
6276
6762
  const allGroups = groupResult.data.items ?? [];
6763
+ const named = allGroups.filter((g) => typeof g.name === "string");
6764
+ const perGroupResults = await Promise.all(
6765
+ named.map(
6766
+ (g) => chainCms("find-member", {
6767
+ memberGroupName: g.name,
6768
+ cursor: encodeCursor({ s: 0, t: 1 }),
6769
+ orderBy: "username"
6770
+ })
6771
+ )
6772
+ );
6277
6773
  const byGroup = [];
6278
- for (const group of allGroups) {
6279
- if (!group.name) continue;
6280
- const countResult = await chainCms("find-member", {
6281
- memberGroupName: group.name,
6282
- cursor: encodeCursor({ s: 0, t: 1 }),
6283
- orderBy: "username"
6284
- });
6285
- if (!countResult.ok) return countResult.errorResult;
6286
- byGroup.push({ group: group.name, count: countResult.data.total ?? 0 });
6774
+ for (let i = 0; i < named.length; i++) {
6775
+ const r = perGroupResults[i];
6776
+ if (!r.ok) return r.errorResult;
6777
+ byGroup.push({ group: named[i].name, count: r.data.total ?? 0 });
6287
6778
  }
6288
6779
  return createToolResult({
6289
- totalMembers: allMembers.length,
6780
+ totalMembers,
6290
6781
  byType: Array.from(typeCounts.entries()).map(([memberType, count]) => ({ memberType, count })).sort((a, b) => b.count - a.count),
6291
6782
  byGroup: byGroup.sort((a, b) => b.count - a.count)
6292
6783
  });
6293
6784
  }
6294
6785
  };
6295
- var report_member_count_default = withStandardDecorators(tool83);
6296
- var inputSchema84 = {
6786
+ var report_member_count_default = withStandardDecorators(tool95);
6787
+ var inputSchema96 = {
6297
6788
  groupName: z.string().describe("The name of the member group to filter by. Use list-member-groups to find valid group names."),
6298
6789
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6299
6790
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6300
6791
  };
6301
- var outputSchema84 = z.object({
6792
+ var outputSchema96 = z.object({
6302
6793
  groupName: z.string().describe("The group name used for this query"),
6303
6794
  items: z.array(z.object({
6304
6795
  id: z.string(),
@@ -6309,11 +6800,11 @@ var outputSchema84 = z.object({
6309
6800
  })).describe("Members belonging to the specified group"),
6310
6801
  total: z.number().describe("Total number of members in this group")
6311
6802
  });
6312
- var tool84 = {
6803
+ var tool96 = {
6313
6804
  name: "report-members-by-group",
6314
6805
  description: "List members belonging to a specific group. Use list-member-groups to find valid group names.",
6315
- inputSchema: inputSchema84,
6316
- outputSchema: outputSchema84,
6806
+ inputSchema: inputSchema96,
6807
+ outputSchema: outputSchema96,
6317
6808
  slices: ["read"],
6318
6809
  annotations: { readOnlyHint: true },
6319
6810
  handler: async ({ groupName, take, skip }) => {
@@ -6329,8 +6820,9 @@ var tool84 = {
6329
6820
  detail: `No member group named "${groupName}". Use list-member-groups to see existing group names.`
6330
6821
  });
6331
6822
  }
6823
+ const canonicalGroupName = groupMatch.name ?? groupName;
6332
6824
  const result = await chainCms("find-member", {
6333
- memberGroupName: groupMatch.name,
6825
+ memberGroupName: canonicalGroupName,
6334
6826
  cursor: buildChainedCursor(skip, take),
6335
6827
  orderBy: "username"
6336
6828
  });
@@ -6349,13 +6841,13 @@ var tool84 = {
6349
6841
  });
6350
6842
  }
6351
6843
  };
6352
- var report_members_by_group_default = withStandardDecorators(tool84);
6353
- var inputSchema85 = {
6844
+ var report_members_by_group_default = withStandardDecorators(tool96);
6845
+ var inputSchema97 = {
6354
6846
  inactiveDays: z.number().optional().default(90).describe("Number of days without a login before a member is considered inactive (default 90)"),
6355
6847
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
6356
6848
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6357
6849
  };
6358
- var outputSchema85 = z.object({
6850
+ var outputSchema97 = z.object({
6359
6851
  items: z.array(z.object({
6360
6852
  id: z.string(),
6361
6853
  name: z.string(),
@@ -6370,11 +6862,11 @@ var outputSchema85 = z.object({
6370
6862
  });
6371
6863
  var PAGE_SIZE2 = 100;
6372
6864
  var MEMBER_CAP2 = 500;
6373
- var tool85 = {
6865
+ var tool97 = {
6374
6866
  name: "report-member-activity",
6375
6867
  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.",
6376
- inputSchema: inputSchema85,
6377
- outputSchema: outputSchema85,
6868
+ inputSchema: inputSchema97,
6869
+ outputSchema: outputSchema97,
6378
6870
  slices: ["read"],
6379
6871
  annotations: { readOnlyHint: true },
6380
6872
  handler: async ({ inactiveDays, take, skip }) => {
@@ -6428,10 +6920,10 @@ var tool85 = {
6428
6920
  });
6429
6921
  }
6430
6922
  };
6431
- var report_member_activity_default = withStandardDecorators(tool85);
6923
+ var report_member_activity_default = withStandardDecorators(tool97);
6432
6924
 
6433
6925
  // src/umbraco-api/tools/member-reporting/index.ts
6434
- var collection16 = {
6926
+ var collection17 = {
6435
6927
  metadata: {
6436
6928
  name: "member-reporting",
6437
6929
  displayName: "Member Reporting",
@@ -6439,22 +6931,22 @@ var collection16 = {
6439
6931
  },
6440
6932
  tools: () => [report_member_count_default, report_members_by_group_default, report_member_activity_default]
6441
6933
  };
6442
- var member_reporting_default = collection16;
6443
- var inputSchema86 = {
6934
+ var member_reporting_default = collection17;
6935
+ var inputSchema98 = {
6444
6936
  id: z.string().uuid().describe("The ID of the page to check publish status for")
6445
6937
  };
6446
- var outputSchema86 = z.object({
6938
+ var outputSchema98 = z.object({
6447
6939
  id: z.string(),
6448
6940
  name: z.string(),
6449
6941
  isPublished: z.boolean(),
6450
6942
  state: z.string(),
6451
6943
  variants: z.array(publishStatusVariantSchema)
6452
6944
  });
6453
- var tool86 = {
6945
+ var tool98 = {
6454
6946
  name: "get-publish-status",
6455
6947
  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.",
6456
- inputSchema: inputSchema86,
6457
- outputSchema: outputSchema86,
6948
+ inputSchema: inputSchema98,
6949
+ outputSchema: outputSchema98,
6458
6950
  slices: ["read"],
6459
6951
  annotations: { readOnlyHint: true },
6460
6952
  handler: async ({ id }) => {
@@ -6470,24 +6962,24 @@ var tool86 = {
6470
6962
  });
6471
6963
  }
6472
6964
  };
6473
- var get_publish_status_default = withStandardDecorators(tool86);
6474
- var inputSchema87 = {
6965
+ var get_publish_status_default = withStandardDecorators(tool98);
6966
+ var inputSchema99 = {
6475
6967
  id: z.string().uuid().describe("The ID of the page to schedule for publish"),
6476
6968
  publishDate: z.string().datetime().describe("The date and time to publish the page (ISO 8601 format, must be in the future)"),
6477
6969
  culture: z.string().optional().describe("Culture code for variant-specific scheduling (e.g. 'en-US'). Omit for invariant content.")
6478
6970
  };
6479
- var outputSchema87 = z.object({
6971
+ var outputSchema99 = z.object({
6480
6972
  message: z.string(),
6481
6973
  id: z.string(),
6482
6974
  name: z.string(),
6483
6975
  scheduledDate: z.string(),
6484
6976
  previewUrl: previewUrlSchema
6485
6977
  });
6486
- var tool87 = {
6978
+ var tool99 = {
6487
6979
  name: "schedule-publish",
6488
6980
  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.",
6489
- inputSchema: inputSchema87,
6490
- outputSchema: outputSchema87,
6981
+ inputSchema: inputSchema99,
6982
+ outputSchema: outputSchema99,
6491
6983
  slices: ["publish"],
6492
6984
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6493
6985
  handler: async ({ id, publishDate, culture }, extra) => {
@@ -6512,22 +7004,22 @@ var tool87 = {
6512
7004
  });
6513
7005
  }
6514
7006
  };
6515
- var schedule_publish_default = withStandardDecorators(tool87);
6516
- var inputSchema88 = {
7007
+ var schedule_publish_default = withStandardDecorators(tool99);
7008
+ var inputSchema100 = {
6517
7009
  id: z.string().uuid().describe("The ID of the page whose scheduled publish should be cancelled"),
6518
7010
  culture: z.string().optional().describe("Culture code to check for a scheduled variant (e.g. 'en-US'). Omit for invariant content.")
6519
7011
  };
6520
- var outputSchema88 = z.object({
7012
+ var outputSchema100 = z.object({
6521
7013
  message: z.string(),
6522
7014
  id: z.string(),
6523
7015
  name: z.string(),
6524
7016
  previewUrl: previewUrlSchema
6525
7017
  });
6526
- var tool88 = {
7018
+ var tool100 = {
6527
7019
  name: "cancel-schedule",
6528
7020
  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.",
6529
- inputSchema: inputSchema88,
6530
- outputSchema: outputSchema88,
7021
+ inputSchema: inputSchema100,
7022
+ outputSchema: outputSchema100,
6531
7023
  slices: ["publish"],
6532
7024
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6533
7025
  handler: async ({ id, culture }, extra) => {
@@ -6565,10 +7057,10 @@ var tool88 = {
6565
7057
  });
6566
7058
  }
6567
7059
  };
6568
- var cancel_schedule_default = withStandardDecorators(tool88);
7060
+ var cancel_schedule_default = withStandardDecorators(tool100);
6569
7061
 
6570
7062
  // src/umbraco-api/tools/scheduling/index.ts
6571
- var collection17 = {
7063
+ var collection18 = {
6572
7064
  metadata: {
6573
7065
  name: "scheduling",
6574
7066
  displayName: "Scheduling",
@@ -6576,13 +7068,13 @@ var collection17 = {
6576
7068
  },
6577
7069
  tools: () => [get_publish_status_default, schedule_publish_default, cancel_schedule_default]
6578
7070
  };
6579
- var scheduling_default = collection17;
6580
- var inputSchema89 = {
7071
+ var scheduling_default = collection18;
7072
+ var inputSchema101 = {
6581
7073
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6582
7074
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination"),
6583
7075
  filter: z.string().optional().describe("Filter redirects by URL")
6584
7076
  };
6585
- var outputSchema89 = z.object({
7077
+ var outputSchema101 = z.object({
6586
7078
  items: z.array(
6587
7079
  z.object({
6588
7080
  id: z.string(),
@@ -6594,11 +7086,11 @@ var outputSchema89 = z.object({
6594
7086
  ).describe("URL redirects"),
6595
7087
  total: z.number().describe("Total number of redirects")
6596
7088
  });
6597
- var tool89 = {
7089
+ var tool101 = {
6598
7090
  name: "list-redirects",
6599
7091
  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.",
6600
- inputSchema: inputSchema89,
6601
- outputSchema: outputSchema89,
7092
+ inputSchema: inputSchema101,
7093
+ outputSchema: outputSchema101,
6602
7094
  slices: ["list"],
6603
7095
  annotations: { readOnlyHint: true },
6604
7096
  handler: async ({ take, skip, filter }) => {
@@ -6620,11 +7112,11 @@ var tool89 = {
6620
7112
  });
6621
7113
  }
6622
7114
  };
6623
- var list_redirects_default = withStandardDecorators(tool89);
6624
- var inputSchema90 = {
7115
+ var list_redirects_default = withStandardDecorators(tool101);
7116
+ var inputSchema102 = {
6625
7117
  id: z.string().uuid().describe("The ID of the redirect to retrieve")
6626
7118
  };
6627
- var outputSchema90 = z.object({
7119
+ var outputSchema102 = z.object({
6628
7120
  id: z.string(),
6629
7121
  originalUrl: z.string(),
6630
7122
  destinationUrl: z.string(),
@@ -6632,11 +7124,11 @@ var outputSchema90 = z.object({
6632
7124
  isAutomatic: z.boolean(),
6633
7125
  createDate: z.string()
6634
7126
  });
6635
- var tool90 = {
7127
+ var tool102 = {
6636
7128
  name: "get-redirect",
6637
7129
  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.",
6638
- inputSchema: inputSchema90,
6639
- outputSchema: outputSchema90,
7130
+ inputSchema: inputSchema102,
7131
+ outputSchema: outputSchema102,
6640
7132
  slices: ["read"],
6641
7133
  annotations: { readOnlyHint: true },
6642
7134
  handler: async ({ id }) => {
@@ -6653,17 +7145,17 @@ var tool90 = {
6653
7145
  });
6654
7146
  }
6655
7147
  };
6656
- var get_redirect_default = withStandardDecorators(tool90);
6657
- var inputSchema91 = {};
6658
- var outputSchema91 = z.object({
7148
+ var get_redirect_default = withStandardDecorators(tool102);
7149
+ var inputSchema103 = {};
7150
+ var outputSchema103 = z.object({
6659
7151
  isEnabled: z.boolean(),
6660
7152
  message: z.string()
6661
7153
  });
6662
- var tool91 = {
7154
+ var tool103 = {
6663
7155
  name: "get-redirect-status",
6664
7156
  description: "Check whether automatic URL redirect tracking is enabled on the site. When enabled, Umbraco automatically creates redirects when pages are moved or renamed.",
6665
- inputSchema: inputSchema91,
6666
- outputSchema: outputSchema91,
7157
+ inputSchema: inputSchema103,
7158
+ outputSchema: outputSchema103,
6667
7159
  slices: ["read"],
6668
7160
  annotations: { readOnlyHint: true },
6669
7161
  handler: async () => {
@@ -6676,20 +7168,20 @@ var tool91 = {
6676
7168
  });
6677
7169
  }
6678
7170
  };
6679
- var get_redirect_status_default = withStandardDecorators(tool91);
6680
- var inputSchema92 = {
7171
+ var get_redirect_status_default = withStandardDecorators(tool103);
7172
+ var inputSchema104 = {
6681
7173
  id: z.string().uuid().describe("The ID of the redirect to delete")
6682
7174
  };
6683
- var outputSchema92 = z.object({
7175
+ var outputSchema104 = z.object({
6684
7176
  message: z.string(),
6685
7177
  id: z.string(),
6686
7178
  originalUrl: z.string()
6687
7179
  });
6688
- var tool92 = {
7180
+ var tool104 = {
6689
7181
  name: "delete-redirect",
6690
7182
  description: "Delete a URL redirect. Visitors following the original URL will get a 404 error. You will be asked to confirm.",
6691
- inputSchema: inputSchema92,
6692
- outputSchema: outputSchema92,
7183
+ inputSchema: inputSchema104,
7184
+ outputSchema: outputSchema104,
6693
7185
  slices: ["delete"],
6694
7186
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6695
7187
  handler: async ({ id }, extra) => {
@@ -6720,10 +7212,10 @@ var tool92 = {
6720
7212
  });
6721
7213
  }
6722
7214
  };
6723
- var delete_redirect_default = withStandardDecorators(tool92);
7215
+ var delete_redirect_default = withStandardDecorators(tool104);
6724
7216
 
6725
7217
  // src/umbraco-api/tools/redirect/index.ts
6726
- var collection18 = {
7218
+ var collection19 = {
6727
7219
  metadata: {
6728
7220
  name: "redirect",
6729
7221
  displayName: "Redirects",
@@ -6731,12 +7223,12 @@ var collection18 = {
6731
7223
  },
6732
7224
  tools: () => [list_redirects_default, get_redirect_default, get_redirect_status_default, delete_redirect_default]
6733
7225
  };
6734
- var redirect_default = collection18;
6735
- var inputSchema93 = {
7226
+ var redirect_default = collection19;
7227
+ var inputSchema105 = {
6736
7228
  id: z.string().uuid().describe("The ID of the content page or media item to look up references for"),
6737
7229
  type: z.enum(["document", "media"]).describe("Whether the ID refers to a content document or a media item")
6738
7230
  };
6739
- var outputSchema93 = z.object({
7231
+ var outputSchema105 = z.object({
6740
7232
  id: z.string(),
6741
7233
  name: z.string(),
6742
7234
  url: z.string(),
@@ -6771,11 +7263,11 @@ async function buildReferencedBy(refItems) {
6771
7263
  };
6772
7264
  });
6773
7265
  }
6774
- var tool93 = {
7266
+ var tool105 = {
6775
7267
  name: "report-content-references",
6776
7268
  description: "Find which pages reference a given content page or media item. Useful before deleting or restructuring content to understand the impact.",
6777
- inputSchema: inputSchema93,
6778
- outputSchema: outputSchema93,
7269
+ inputSchema: inputSchema105,
7270
+ outputSchema: outputSchema105,
6779
7271
  slices: ["read"],
6780
7272
  annotations: { readOnlyHint: true },
6781
7273
  handler: async ({ id, type }) => {
@@ -6825,18 +7317,18 @@ var tool93 = {
6825
7317
  }
6826
7318
  }
6827
7319
  };
6828
- var report_content_references_default = withStandardDecorators(tool93);
7320
+ var report_content_references_default = withStandardDecorators(tool105);
6829
7321
 
6830
7322
  // src/umbraco-api/tools/helpers/link-extractor.ts
6831
7323
  var UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
6832
- function isBlockListOrGridValue4(value) {
7324
+ function isBlockListOrGridValue3(value) {
6833
7325
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
6834
7326
  }
6835
- function isRteWithBlocks4(value) {
7327
+ function isRteWithBlocks3(value) {
6836
7328
  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);
6837
7329
  }
6838
7330
  function isPlainRteValue(value) {
6839
- return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks4(value);
7331
+ return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks3(value);
6840
7332
  }
6841
7333
  function extractHrefUrls(html) {
6842
7334
  const urls = [];
@@ -6946,7 +7438,7 @@ function extractLinksFromValues(values) {
6946
7438
  return;
6947
7439
  }
6948
7440
  if (typeof val === "object") {
6949
- if (isRteWithBlocks4(val)) {
7441
+ if (isRteWithBlocks3(val)) {
6950
7442
  processHtml(val.markup);
6951
7443
  const blockValues = extractBlockValues(val.blocks.contentData);
6952
7444
  for (const bv of blockValues) processValue(bv);
@@ -6956,7 +7448,7 @@ function extractLinksFromValues(values) {
6956
7448
  processHtml(val.markup);
6957
7449
  return;
6958
7450
  }
6959
- if (isBlockListOrGridValue4(val)) {
7451
+ if (isBlockListOrGridValue3(val)) {
6960
7452
  const blockValues = extractBlockValues(val.contentData);
6961
7453
  for (const bv of blockValues) processValue(bv);
6962
7454
  return;
@@ -7023,10 +7515,10 @@ async function resolveOutboundIds(candidateIds, excludeId) {
7023
7515
  }
7024
7516
 
7025
7517
  // src/umbraco-api/tools/relationships/get/report-outbound-links.ts
7026
- var inputSchema94 = {
7518
+ var inputSchema106 = {
7027
7519
  id: z.string().uuid().describe("The ID of the page to analyze for outbound links")
7028
7520
  };
7029
- var outputSchema94 = z.object({
7521
+ var outputSchema106 = z.object({
7030
7522
  id: z.string(),
7031
7523
  name: z.string(),
7032
7524
  url: z.string(),
@@ -7058,11 +7550,11 @@ var outputSchema94 = z.object({
7058
7550
  totalLinks: z.number()
7059
7551
  })
7060
7552
  });
7061
- var tool94 = {
7553
+ var tool106 = {
7062
7554
  name: "report-outbound-links",
7063
7555
  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.",
7064
- inputSchema: inputSchema94,
7065
- outputSchema: outputSchema94,
7556
+ inputSchema: inputSchema106,
7557
+ outputSchema: outputSchema106,
7066
7558
  slices: ["read"],
7067
7559
  annotations: { readOnlyHint: true },
7068
7560
  handler: async ({ id }) => {
@@ -7091,10 +7583,10 @@ var tool94 = {
7091
7583
  });
7092
7584
  }
7093
7585
  };
7094
- var report_outbound_links_default = withStandardDecorators(tool94);
7586
+ var report_outbound_links_default = withStandardDecorators(tool106);
7095
7587
 
7096
7588
  // src/umbraco-api/tools/relationships/index.ts
7097
- var collection19 = {
7589
+ var collection20 = {
7098
7590
  metadata: {
7099
7591
  name: "relationships",
7100
7592
  displayName: "Content Relationships",
@@ -7102,11 +7594,11 @@ var collection19 = {
7102
7594
  },
7103
7595
  tools: () => [report_content_references_default, report_outbound_links_default]
7104
7596
  };
7105
- var relationships_default = collection19;
7106
- var inputSchema95 = {
7597
+ var relationships_default = collection20;
7598
+ var inputSchema107 = {
7107
7599
  id: z.string().uuid().describe("The ID of the content page to read public access settings for")
7108
7600
  };
7109
- var outputSchema95 = z.object({
7601
+ var outputSchema107 = z.object({
7110
7602
  hasRestrictions: z.boolean().describe("True if the page has public access rules configured"),
7111
7603
  memberGroups: z.array(z.object({
7112
7604
  id: z.string(),
@@ -7117,11 +7609,11 @@ var outputSchema95 = z.object({
7117
7609
  errorPageId: z.string().nullable().describe("The ID of the page shown when an authenticated visitor is denied access"),
7118
7610
  message: z.string().describe("Human-readable summary of the access rules")
7119
7611
  });
7120
- var tool95 = {
7612
+ var tool107 = {
7121
7613
  name: "get-public-access",
7122
7614
  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.",
7123
- inputSchema: inputSchema95,
7124
- outputSchema: outputSchema95,
7615
+ inputSchema: inputSchema107,
7616
+ outputSchema: outputSchema107,
7125
7617
  slices: ["read"],
7126
7618
  annotations: { readOnlyHint: true },
7127
7619
  handler: async ({ id }) => {
@@ -7154,15 +7646,15 @@ var tool95 = {
7154
7646
  });
7155
7647
  }
7156
7648
  };
7157
- var get_public_access_default = withStandardDecorators(tool95);
7158
- var inputSchema96 = {
7649
+ var get_public_access_default = withStandardDecorators(tool107);
7650
+ var inputSchema108 = {
7159
7651
  id: z.string().uuid().describe("The ID of the content page to restrict"),
7160
7652
  memberGroupNames: z.array(z.string()).describe("Names of member groups allowed to view the page. Use list-member-groups to look up existing groups."),
7161
7653
  loginPageId: z.string().uuid().describe("The ID of the page visitors are redirected to when login is required"),
7162
7654
  errorPageId: z.string().uuid().describe("The ID of the page shown when an authenticated visitor is denied access"),
7163
7655
  memberUserNames: z.array(z.string()).optional().describe("Optional: specific member usernames allowed to view the page (in addition to group members)")
7164
7656
  };
7165
- var outputSchema96 = z.object({
7657
+ var outputSchema108 = z.object({
7166
7658
  message: z.string(),
7167
7659
  id: z.string(),
7168
7660
  memberGroupNames: z.array(z.string()),
@@ -7170,11 +7662,11 @@ var outputSchema96 = z.object({
7170
7662
  loginPageId: z.string(),
7171
7663
  errorPageId: z.string()
7172
7664
  });
7173
- var tool96 = {
7665
+ var tool108 = {
7174
7666
  name: "set-public-access",
7175
7667
  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.",
7176
- inputSchema: inputSchema96,
7177
- outputSchema: outputSchema96,
7668
+ inputSchema: inputSchema108,
7669
+ outputSchema: outputSchema108,
7178
7670
  slices: ["update"],
7179
7671
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
7180
7672
  handler: async ({ id, memberGroupNames, loginPageId, errorPageId, memberUserNames }, extra) => {
@@ -7212,19 +7704,19 @@ var tool96 = {
7212
7704
  });
7213
7705
  }
7214
7706
  };
7215
- var set_public_access_default = withStandardDecorators(tool96);
7216
- var inputSchema97 = {
7707
+ var set_public_access_default = withStandardDecorators(tool108);
7708
+ var inputSchema109 = {
7217
7709
  id: z.string().uuid().describe("The ID of the content page to remove public access restrictions from")
7218
7710
  };
7219
- var outputSchema97 = z.object({
7711
+ var outputSchema109 = z.object({
7220
7712
  message: z.string(),
7221
7713
  id: z.string()
7222
7714
  });
7223
- var tool97 = {
7715
+ var tool109 = {
7224
7716
  name: "remove-public-access",
7225
7717
  description: "Remove all public access restrictions from a content page, making it publicly viewable again. You will be asked to confirm.",
7226
- inputSchema: inputSchema97,
7227
- outputSchema: outputSchema97,
7718
+ inputSchema: inputSchema109,
7719
+ outputSchema: outputSchema109,
7228
7720
  slices: ["delete"],
7229
7721
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
7230
7722
  handler: async ({ id }, extra) => {
@@ -7239,10 +7731,10 @@ var tool97 = {
7239
7731
  });
7240
7732
  }
7241
7733
  };
7242
- var remove_public_access_default = withStandardDecorators(tool97);
7734
+ var remove_public_access_default = withStandardDecorators(tool109);
7243
7735
 
7244
7736
  // src/umbraco-api/tools/public-access/index.ts
7245
- var collection20 = {
7737
+ var collection21 = {
7246
7738
  metadata: {
7247
7739
  name: "public-access",
7248
7740
  displayName: "Public Access",
@@ -7250,7 +7742,7 @@ var collection20 = {
7250
7742
  },
7251
7743
  tools: () => [get_public_access_default, set_public_access_default, remove_public_access_default]
7252
7744
  };
7253
- var public_access_default = collection20;
7745
+ var public_access_default = collection21;
7254
7746
 
7255
7747
  // src/umbraco-api/tools/helpers/runtime.ts
7256
7748
  var isHostedRuntime = () => {
@@ -7260,7 +7752,7 @@ var isHostedRuntime = () => {
7260
7752
  };
7261
7753
 
7262
7754
  // src/umbraco-api/tools/notifications/get/get-content-notifications.ts
7263
- var inputSchema98 = {
7755
+ var inputSchema110 = {
7264
7756
  id: z.string().uuid().describe("UUID of the content page to read notification subscriptions for")
7265
7757
  };
7266
7758
  var subscriptionSchema = z.object({
@@ -7268,16 +7760,16 @@ var subscriptionSchema = z.object({
7268
7760
  alias: z.string().describe("Human-readable action alias (e.g. publish, unpublish, save, delete)"),
7269
7761
  subscribed: z.boolean().describe("True if the current user is subscribed to this action")
7270
7762
  });
7271
- var outputSchema98 = z.object({
7763
+ var outputSchema110 = z.object({
7272
7764
  id: z.string(),
7273
7765
  subscriptions: z.array(subscriptionSchema),
7274
7766
  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")
7275
7767
  });
7276
- var tool98 = {
7768
+ var tool110 = {
7277
7769
  name: "get-content-notifications",
7278
7770
  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.",
7279
- inputSchema: inputSchema98,
7280
- outputSchema: outputSchema98,
7771
+ inputSchema: inputSchema110,
7772
+ outputSchema: outputSchema110,
7281
7773
  slices: ["read"],
7282
7774
  annotations: { readOnlyHint: true },
7283
7775
  enabled: isHostedRuntime,
@@ -7293,21 +7785,21 @@ var tool98 = {
7293
7785
  return createToolResult({ id, subscriptions, subscribedActionIds });
7294
7786
  }
7295
7787
  };
7296
- var get_content_notifications_default = withStandardDecorators(tool98);
7297
- var inputSchema99 = {
7788
+ var get_content_notifications_default = withStandardDecorators(tool110);
7789
+ var inputSchema111 = {
7298
7790
  id: z.string().uuid().describe("UUID of the content page to update notification subscriptions for"),
7299
7791
  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.")
7300
7792
  };
7301
- var outputSchema99 = z.object({
7793
+ var outputSchema111 = z.object({
7302
7794
  message: z.string(),
7303
7795
  id: z.string(),
7304
7796
  subscribedActionIds: z.array(z.string())
7305
7797
  });
7306
- var tool99 = {
7798
+ var tool111 = {
7307
7799
  name: "set-content-notifications",
7308
7800
  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.",
7309
- inputSchema: inputSchema99,
7310
- outputSchema: outputSchema99,
7801
+ inputSchema: inputSchema111,
7802
+ outputSchema: outputSchema111,
7311
7803
  slices: ["update"],
7312
7804
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
7313
7805
  enabled: isHostedRuntime,
@@ -7325,10 +7817,10 @@ var tool99 = {
7325
7817
  });
7326
7818
  }
7327
7819
  };
7328
- var set_content_notifications_default = withStandardDecorators(tool99);
7820
+ var set_content_notifications_default = withStandardDecorators(tool111);
7329
7821
 
7330
7822
  // src/umbraco-api/tools/notifications/index.ts
7331
- var collection21 = {
7823
+ var collection22 = {
7332
7824
  metadata: {
7333
7825
  name: "notifications",
7334
7826
  displayName: "Content Notifications",
@@ -7336,7 +7828,7 @@ var collection21 = {
7336
7828
  },
7337
7829
  tools: () => isHostedRuntime() ? [get_content_notifications_default, set_content_notifications_default] : []
7338
7830
  };
7339
- var notifications_default = collection21;
7831
+ var notifications_default = collection22;
7340
7832
  var mediaTools = {
7341
7833
  listRoot: "get-recycle-bin-media-root",
7342
7834
  listChildren: "get-recycle-bin-media-children",
@@ -7399,13 +7891,13 @@ function formatNamePreview(names, total) {
7399
7891
  }
7400
7892
 
7401
7893
  // src/umbraco-api/tools/recycle-bin/get/list-recycle-bin.ts
7402
- var inputSchema100 = {
7894
+ var inputSchema112 = {
7403
7895
  type: z.enum(["content", "media"]).describe("Which recycle bin to list: content (pages) or media."),
7404
7896
  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."),
7405
7897
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
7406
7898
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
7407
7899
  };
7408
- var outputSchema100 = z.object({
7900
+ var outputSchema112 = z.object({
7409
7901
  items: z.array(z.object({
7410
7902
  id: z.string(),
7411
7903
  name: z.string(),
@@ -7414,11 +7906,11 @@ var outputSchema100 = z.object({
7414
7906
  })).describe("Trashed items at this level of the recycle bin"),
7415
7907
  total: z.number().describe("Total number of trashed items at this level (before pagination)")
7416
7908
  });
7417
- var tool100 = {
7909
+ var tool112 = {
7418
7910
  name: "list-recycle-bin",
7419
7911
  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.",
7420
- inputSchema: inputSchema100,
7421
- outputSchema: outputSchema100,
7912
+ inputSchema: inputSchema112,
7913
+ outputSchema: outputSchema112,
7422
7914
  slices: ["list", "tree"],
7423
7915
  annotations: { readOnlyHint: true },
7424
7916
  handler: async ({ type, parentId, take, skip }) => {
@@ -7441,22 +7933,22 @@ var tool100 = {
7441
7933
  });
7442
7934
  }
7443
7935
  };
7444
- var list_recycle_bin_default = withStandardDecorators(tool100);
7445
- var inputSchema101 = {
7936
+ var list_recycle_bin_default = withStandardDecorators(tool112);
7937
+ var inputSchema113 = {
7446
7938
  id: z.string().uuid().describe("ID of the trashed item to permanently delete."),
7447
7939
  type: z.enum(["content", "media"]).describe("Which recycle bin the item is in.")
7448
7940
  };
7449
- var outputSchema101 = z.object({
7941
+ var outputSchema113 = z.object({
7450
7942
  message: z.string(),
7451
7943
  id: z.string(),
7452
7944
  name: z.string(),
7453
7945
  descendantCount: z.number().optional().describe("Descendants also deleted when the item was a folder")
7454
7946
  });
7455
- var tool101 = {
7947
+ var tool113 = {
7456
7948
  name: "permanent-delete-recycle-bin-item",
7457
7949
  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.",
7458
- inputSchema: inputSchema101,
7459
- outputSchema: outputSchema101,
7950
+ inputSchema: inputSchema113,
7951
+ outputSchema: outputSchema113,
7460
7952
  slices: ["delete"],
7461
7953
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7462
7954
  handler: async ({ id, type }, extra) => {
@@ -7503,20 +7995,20 @@ var tool101 = {
7503
7995
  });
7504
7996
  }
7505
7997
  };
7506
- var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool101);
7507
- var inputSchema102 = {
7998
+ var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool113);
7999
+ var inputSchema114 = {
7508
8000
  type: z.enum(["content", "media"]).describe("Which recycle bin to empty.")
7509
8001
  };
7510
- var outputSchema102 = z.object({
8002
+ var outputSchema114 = z.object({
7511
8003
  message: z.string(),
7512
8004
  type: z.enum(["content", "media"]),
7513
8005
  topLevelCount: z.number().describe("Number of top-level items that were in the bin before emptying (descendants are not counted).")
7514
8006
  });
7515
- var tool102 = {
8007
+ var tool114 = {
7516
8008
  name: "empty-recycle-bin",
7517
8009
  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.",
7518
- inputSchema: inputSchema102,
7519
- outputSchema: outputSchema102,
8010
+ inputSchema: inputSchema114,
8011
+ outputSchema: outputSchema114,
7520
8012
  slices: ["delete"],
7521
8013
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7522
8014
  handler: async ({ type }, extra) => {
@@ -7561,10 +8053,10 @@ var tool102 = {
7561
8053
  });
7562
8054
  }
7563
8055
  };
7564
- var empty_recycle_bin_default = withStandardDecorators(tool102);
8056
+ var empty_recycle_bin_default = withStandardDecorators(tool114);
7565
8057
 
7566
8058
  // src/umbraco-api/tools/recycle-bin/index.ts
7567
- var collection22 = {
8059
+ var collection23 = {
7568
8060
  metadata: {
7569
8061
  name: "recycle-bin",
7570
8062
  displayName: "Recycle Bin",
@@ -7572,9 +8064,9 @@ var collection22 = {
7572
8064
  },
7573
8065
  tools: () => [list_recycle_bin_default, permanent_delete_recycle_bin_item_default, empty_recycle_bin_default]
7574
8066
  };
7575
- var recycle_bin_default = collection22;
7576
- var inputSchema103 = {};
7577
- var outputSchema103 = z.object({
8067
+ var recycle_bin_default = collection23;
8068
+ var inputSchema115 = {};
8069
+ var outputSchema115 = z.object({
7578
8070
  id: z.string(),
7579
8071
  name: z.string(),
7580
8072
  userName: z.string(),
@@ -7596,11 +8088,11 @@ var outputSchema103 = z.object({
7596
8088
  documentStartNodeIds: z.array(z.string()).describe("Content node IDs the user is restricted to. Empty when hasDocumentRootAccess is true."),
7597
8089
  mediaStartNodeIds: z.array(z.string()).describe("Media node IDs the user is restricted to. Empty when hasMediaRootAccess is true.")
7598
8090
  });
7599
- var tool103 = {
8091
+ var tool115 = {
7600
8092
  name: "get-current-user",
7601
8093
  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.",
7602
- inputSchema: inputSchema103,
7603
- outputSchema: outputSchema103,
8094
+ inputSchema: inputSchema115,
8095
+ outputSchema: outputSchema115,
7604
8096
  slices: ["read"],
7605
8097
  annotations: { readOnlyHint: true },
7606
8098
  handler: async () => {
@@ -7639,10 +8131,10 @@ var tool103 = {
7639
8131
  });
7640
8132
  }
7641
8133
  };
7642
- var get_current_user_default = withStandardDecorators(tool103);
8134
+ var get_current_user_default = withStandardDecorators(tool115);
7643
8135
 
7644
8136
  // src/umbraco-api/tools/account/index.ts
7645
- var collection23 = {
8137
+ var collection24 = {
7646
8138
  metadata: {
7647
8139
  name: "account",
7648
8140
  displayName: "Account",
@@ -7650,22 +8142,7 @@ var collection23 = {
7650
8142
  },
7651
8143
  tools: () => [get_current_user_default]
7652
8144
  };
7653
- var account_default = collection23;
7654
- var toolSliceNames = [
7655
- // Base slices from toolkit (create, read, update, delete, list)
7656
- ...baseSliceNames,
7657
- // Query
7658
- "search",
7659
- // Navigation
7660
- "tree",
7661
- // Workflow
7662
- "publish",
7663
- // Versioning
7664
- "version",
7665
- // Movement
7666
- "move"
7667
- ];
7668
- var allSliceNames = [...toolSliceNames, "other"];
8145
+ var account_default = collection24;
7669
8146
 
7670
8147
  // src/config/mode-registry.ts
7671
8148
  var toolModes = [
@@ -7681,6 +8158,12 @@ var toolModes = [
7681
8158
  description: "Browse, search, upload, and manage media files and folders",
7682
8159
  collections: ["media", "media-management"]
7683
8160
  },
8161
+ {
8162
+ name: "library",
8163
+ displayName: "Library Elements",
8164
+ description: "Browse, view, and manage reusable Library elements (Umbraco 18 Library section)",
8165
+ collections: ["element"]
8166
+ },
7684
8167
  {
7685
8168
  name: "blueprints",
7686
8169
  displayName: "Blueprints",
@@ -7768,6 +8251,49 @@ var toolModes = [
7768
8251
  ];
7769
8252
  var allModes = [...toolModes];
7770
8253
  var allModeNames = toolModes.map((m) => m.name);
8254
+ var toolSliceNames = [
8255
+ // Base slices from toolkit (create, read, update, delete, list)
8256
+ ...baseSliceNames,
8257
+ // Query
8258
+ "search",
8259
+ // Navigation
8260
+ "tree",
8261
+ // Workflow
8262
+ "publish",
8263
+ // Versioning
8264
+ "version",
8265
+ // Movement
8266
+ "move"
8267
+ ];
8268
+ var allSliceNames = [...toolSliceNames, "other"];
8269
+
8270
+ // src/collections.ts
8271
+ var collections = [
8272
+ content_default,
8273
+ publishing_default,
8274
+ versioning_default,
8275
+ media_default,
8276
+ media_management_default,
8277
+ element_default,
8278
+ blueprint_default,
8279
+ language_default,
8280
+ translation_default,
8281
+ dictionary_default,
8282
+ tag_default,
8283
+ content_health_default,
8284
+ site_structure_default,
8285
+ bulk_operations_default,
8286
+ member_default,
8287
+ member_group_default,
8288
+ member_reporting_default,
8289
+ scheduling_default,
8290
+ redirect_default,
8291
+ relationships_default,
8292
+ public_access_default,
8293
+ notifications_default,
8294
+ recycle_bin_default,
8295
+ account_default
8296
+ ];
7771
8297
  var customFields = [
7772
8298
  {
7773
8299
  name: "disableMcpChaining",
@@ -7893,31 +8419,7 @@ initializeUmbracoFetch({
7893
8419
  clientSecret: serverConfig.umbraco.auth.clientSecret
7894
8420
  });
7895
8421
  var filterConfig = configLoader.loadFromConfig(serverConfig.umbraco);
7896
- var collections = [
7897
- content_default,
7898
- publishing_default,
7899
- versioning_default,
7900
- media_default,
7901
- media_management_default,
7902
- blueprint_default,
7903
- translation_default,
7904
- language_default,
7905
- dictionary_default,
7906
- tag_default,
7907
- content_health_default,
7908
- site_structure_default,
7909
- bulk_operations_default,
7910
- member_default,
7911
- member_group_default,
7912
- member_reporting_default,
7913
- scheduling_default,
7914
- redirect_default,
7915
- relationships_default,
7916
- public_access_default,
7917
- notifications_default,
7918
- recycle_bin_default,
7919
- account_default
7920
- ];
8422
+ var registeredCollections = collections;
7921
8423
  async function main() {
7922
8424
  const chainingEnabled = mcpServers.length > 0 && !serverConfig.custom.disableMcpChaining;
7923
8425
  let availableChainedTools;
@@ -7939,23 +8441,23 @@ async function main() {
7939
8441
  }
7940
8442
  let registeredToolCount = 0;
7941
8443
  let skippedByDeps = 0;
7942
- for (const collection24 of collections) {
7943
- const collectionName = collection24.metadata.name;
7944
- const tools = collection24.tools({});
7945
- for (const tool104 of tools) {
7946
- const toolWithDeps = CHAINED_DEPS[tool104.name] && !tool104.chainedDeps ? { ...tool104, chainedDeps: CHAINED_DEPS[tool104.name] } : tool104;
8444
+ for (const collection25 of registeredCollections) {
8445
+ const collectionName = collection25.metadata.name;
8446
+ const tools = collection25.tools({});
8447
+ for (const tool116 of tools) {
8448
+ const toolWithDeps = CHAINED_DEPS[tool116.name] && !tool116.chainedDeps ? { ...tool116, chainedDeps: CHAINED_DEPS[tool116.name] } : tool116;
7947
8449
  if (!shouldIncludeTool(toolWithDeps, { collectionName, config: filterConfig, availableChainedTools })) {
7948
- if (availableChainedTools && CHAINED_DEPS[tool104.name]) skippedByDeps++;
8450
+ if (availableChainedTools && CHAINED_DEPS[tool116.name]) skippedByDeps++;
7949
8451
  continue;
7950
8452
  }
7951
- const annotations = createToolAnnotations(tool104);
7952
- server.registerTool(tool104.name, {
7953
- description: tool104.description,
7954
- inputSchema: tool104.inputSchema,
7955
- outputSchema: tool104.outputSchema,
8453
+ const annotations = createToolAnnotations(tool116);
8454
+ server.registerTool(tool116.name, {
8455
+ description: tool116.description,
8456
+ inputSchema: tool116.inputSchema,
8457
+ outputSchema: tool116.outputSchema,
7956
8458
  annotations,
7957
- ...tool104._meta ? { _meta: tool104._meta } : {}
7958
- }, tool104.handler);
8459
+ ...tool116._meta ? { _meta: tool116._meta } : {}
8460
+ }, tool116.handler);
7959
8461
  registeredToolCount++;
7960
8462
  }
7961
8463
  }
@@ -7963,7 +8465,7 @@ async function main() {
7963
8465
  const transport = new StdioServerTransport();
7964
8466
  await server.connect(transport);
7965
8467
  console.error(
7966
- `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)` : "")
8468
+ `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)` : "")
7967
8469
  );
7968
8470
  }
7969
8471
  process.on("SIGINT", async () => {