@umbraco-cms/mcp-editor 17.6.0-beta.7 → 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.
@@ -7,8 +7,7 @@ import { resolve } from 'path';
7
7
 
8
8
  // src/config/mcp-servers.ts
9
9
  async function buildServers() {
10
- const isWorkersRuntime = typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers";
11
- if (isWorkersRuntime || typeof process === "undefined" || !process.env) return [];
10
+ if (typeof process === "undefined" || !process.env) return [];
12
11
  const useMockChain = process.env.USE_MOCK_MCP_CHAIN === "true";
13
12
  if (useMockChain) {
14
13
  const path2 = await import('path');
@@ -110,14 +109,6 @@ function truncateAvailableTools(message) {
110
109
  }
111
110
  return message.slice(0, availableToolsIndex + 1);
112
111
  }
113
- async function isCmsToolAvailable(toolName) {
114
- try {
115
- const { tools } = await mcpClientManager.listTools("cms");
116
- return (tools ?? []).some((t) => t.name === toolName);
117
- } catch {
118
- return true;
119
- }
120
- }
121
112
  async function chainCms(toolName, args) {
122
113
  let result;
123
114
  try {
@@ -141,78 +132,21 @@ async function chainCms(toolName, args) {
141
132
  }
142
133
  return { ok: true, data: extractChainedResult(result) };
143
134
  }
144
- function buildChainedCursor(skip, take) {
145
- return encodeCursor({ s: skip, t: take });
146
- }
147
- function stripHtml(html) {
148
- return (html || "").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
149
- }
150
- function countWords(text) {
151
- const stripped = stripHtml(text);
152
- if (!stripped) return 0;
153
- return stripped.split(/\s+/).filter(Boolean).length;
154
- }
155
- function extractTextFromBlockValues(innerValues) {
156
- const parts = [];
157
- for (const v of innerValues || []) {
158
- const text = extractTextFromValue(v.value, v.editorAlias);
159
- if (text) parts.push(text);
160
- }
161
- return parts.join(" ");
162
- }
163
- function extractTextFromValue(value, editorAlias) {
164
- if (typeof value === "string") {
165
- return stripHtml(value);
166
- }
167
- if (value && typeof value === "object" && typeof value.markup === "string") {
168
- const markupText = stripHtml(value.markup);
169
- const blockText = extractTextFromContentData(value.blocks?.contentData);
170
- return [markupText, blockText].filter(Boolean).join(" ");
171
- }
172
- if (value && typeof value === "object" && Array.isArray(value.contentData)) {
173
- return extractTextFromContentData(value.contentData);
174
- }
175
- return "";
176
- }
177
- function extractTextFromContentData(contentData) {
178
- const parts = [];
179
- for (const block of contentData || []) {
180
- const blockText = extractTextFromBlockValues(block.values || []);
181
- if (blockText) parts.push(blockText);
182
- }
183
- return parts.join(" ");
184
- }
185
- function extractTextContent(values) {
186
- const parts = [];
187
- for (const v of values || []) {
188
- const text = extractTextFromValue(v.value, v.editorAlias);
189
- if (text) parts.push(text);
190
- }
191
- return parts.filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
192
- }
193
- function extractHeadings(html) {
194
- const headings = [];
195
- const regex = /<h([1-6])[^>]*>(.*?)<\/h[1-6]>/gi;
196
- let match;
197
- while ((match = regex.exec(html)) !== null) {
198
- headings.push({ level: parseInt(match[1]), text: stripHtml(match[2]) });
199
- }
200
- return headings;
135
+ var DEFAULT_PROVIDER_ALIAS = "umbDocumentUrlProvider";
136
+ var URL_BATCH_CHUNK_SIZE = 40;
137
+ function describeChainError(errorResult) {
138
+ const problem = extractInnerProblemDetails(errorResult);
139
+ const title = typeof problem.title === "string" ? problem.title : void 0;
140
+ const detail = typeof problem.detail === "string" ? problem.detail : void 0;
141
+ return [title, detail].filter(Boolean).join(": ") || "unknown error";
201
142
  }
202
- function extractImages(html) {
203
- const images = [];
204
- const regex = /<img[^>]*>/gi;
205
- let match;
206
- while ((match = regex.exec(html)) !== null) {
207
- const srcMatch = match[0].match(/src="([^"]*)"/i);
208
- const altMatch = match[0].match(/alt="([^"]*)"/i);
209
- const src = srcMatch?.[1] ?? "";
210
- const alt = altMatch?.[1] ?? "";
211
- images.push({ src, alt, hasAlt: !!altMatch && alt.length > 0 });
143
+ function chunkIds(ids, size) {
144
+ const chunks = [];
145
+ for (let i = 0; i < ids.length; i += size) {
146
+ chunks.push(ids.slice(i, i + size));
212
147
  }
213
- return images;
148
+ return chunks;
214
149
  }
215
- var DEFAULT_PROVIDER_ALIAS = "umbDocumentUrlProvider";
216
150
  var cachedBaseUrl = null;
217
151
  var cachedMtimeMs = null;
218
152
  function readBaseUrlFromEnvFile(envPath) {
@@ -318,26 +252,131 @@ function flattenPublishedUrls(urls) {
318
252
  async function fetchPublishedUrls(id) {
319
253
  try {
320
254
  const result = await chainCms("get-document-urls", { id: [id] });
321
- if (!result.ok) return [];
255
+ if (!result.ok) {
256
+ console.warn(
257
+ `fetchPublishedUrls: get-document-urls failed for id ${id} \u2014 returning no published URLs: ${describeChainError(result.errorResult)}`
258
+ );
259
+ return [];
260
+ }
322
261
  return flattenPublishedUrls(result.data.items);
323
- } catch {
262
+ } catch (error) {
263
+ const message = error instanceof Error ? error.message : String(error);
264
+ console.warn(
265
+ `fetchPublishedUrls: unexpected error fetching published URLs for id ${id} \u2014 returning no published URLs: ${message}`
266
+ );
324
267
  return [];
325
268
  }
326
269
  }
327
270
  async function fetchPublishedUrlsBatch(ids) {
328
271
  const out = /* @__PURE__ */ new Map();
329
272
  if (ids.length === 0) return out;
330
- try {
331
- const result = await chainCms("get-document-urls", { id: ids });
332
- if (!result.ok) return out;
333
- for (const entry of result.data.items ?? []) {
334
- if (!entry?.id) continue;
335
- out.set(entry.id, flattenPublishedUrls([entry]));
273
+ for (const idChunk of chunkIds(ids, URL_BATCH_CHUNK_SIZE)) {
274
+ try {
275
+ const result = await chainCms("get-document-urls", { id: idChunk });
276
+ if (!result.ok) {
277
+ console.warn(
278
+ `fetchPublishedUrlsBatch: get-document-urls failed for a chunk of ${idChunk.length} ids \u2014 those ids will have no published URL: ${describeChainError(result.errorResult)}`
279
+ );
280
+ continue;
281
+ }
282
+ for (const entry of result.data.items ?? []) {
283
+ if (!entry?.id) continue;
284
+ out.set(entry.id, flattenPublishedUrls([entry]));
285
+ }
286
+ } catch (error) {
287
+ const message = error instanceof Error ? error.message : String(error);
288
+ console.warn(
289
+ `fetchPublishedUrlsBatch: unexpected error processing a chunk of ${idChunk.length} ids \u2014 those ids will have no published URL: ${message}`
290
+ );
336
291
  }
337
- } catch {
338
292
  }
339
293
  return out;
340
294
  }
295
+ async function fetchPrimaryPublishedUrl(id) {
296
+ const urls = await fetchPublishedUrls(id);
297
+ return urls[0] ?? "";
298
+ }
299
+ async function fetchPrimaryPublishedUrlsBatch(ids) {
300
+ const batch = await fetchPublishedUrlsBatch(ids);
301
+ const out = /* @__PURE__ */ new Map();
302
+ for (const id of ids) {
303
+ out.set(id, batch.get(id)?.[0] ?? "");
304
+ }
305
+ return out;
306
+ }
307
+
308
+ // src/umbraco-api/tools/helpers/tree-walker.ts
309
+ function buildChainedCursor(skip, take) {
310
+ return encodeCursor({ s: skip, t: take });
311
+ }
312
+ function stripHtml(html) {
313
+ return (html || "").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
314
+ }
315
+ function countWords(text) {
316
+ const stripped = stripHtml(text);
317
+ if (!stripped) return 0;
318
+ return stripped.split(/\s+/).filter(Boolean).length;
319
+ }
320
+ function extractTextFromBlockValues(innerValues) {
321
+ const parts = [];
322
+ for (const v of innerValues || []) {
323
+ const text = extractTextFromValue(v.value, v.editorAlias);
324
+ if (text) parts.push(text);
325
+ }
326
+ return parts.join(" ");
327
+ }
328
+ function extractTextFromValue(value, editorAlias) {
329
+ if (typeof value === "string") {
330
+ return stripHtml(value);
331
+ }
332
+ if (value && typeof value === "object" && typeof value.markup === "string") {
333
+ const markupText = stripHtml(value.markup);
334
+ const blockText = extractTextFromContentData(value.blocks?.contentData);
335
+ return [markupText, blockText].filter(Boolean).join(" ");
336
+ }
337
+ if (value && typeof value === "object" && Array.isArray(value.contentData)) {
338
+ return extractTextFromContentData(value.contentData);
339
+ }
340
+ return "";
341
+ }
342
+ function extractTextFromContentData(contentData) {
343
+ const parts = [];
344
+ for (const block of contentData || []) {
345
+ const blockText = extractTextFromBlockValues(block.values || []);
346
+ if (blockText) parts.push(blockText);
347
+ }
348
+ return parts.join(" ");
349
+ }
350
+ function extractTextContent(values) {
351
+ const parts = [];
352
+ for (const v of values || []) {
353
+ const text = extractTextFromValue(v.value, v.editorAlias);
354
+ if (text) parts.push(text);
355
+ }
356
+ return parts.filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
357
+ }
358
+ function extractHeadings(html) {
359
+ const headings = [];
360
+ const regex = /<h([1-6])[^>]*>(.*?)<\/h[1-6]>/gi;
361
+ let match;
362
+ while ((match = regex.exec(html)) !== null) {
363
+ headings.push({ level: parseInt(match[1]), text: stripHtml(match[2]) });
364
+ }
365
+ return headings;
366
+ }
367
+ function extractImages(html) {
368
+ const images = [];
369
+ const regex = /<img[^>]*>/gi;
370
+ let match;
371
+ while ((match = regex.exec(html)) !== null) {
372
+ const srcMatch = match[0].match(/src="([^"]*)"/i);
373
+ const altMatch = match[0].match(/alt="([^"]*)"/i);
374
+ const src = srcMatch?.[1] ?? "";
375
+ const alt = altMatch?.[1] ?? "";
376
+ images.push({ src, alt, hasAlt: !!altMatch && alt.length > 0 });
377
+ }
378
+ return images;
379
+ }
341
380
 
342
381
  // src/umbraco-api/tools/content/get/search-content.ts
343
382
  var inputSchema = {
@@ -356,7 +395,7 @@ var outputSchema = z.object({
356
395
  });
357
396
  var tool = {
358
397
  name: "search-content",
359
- description: "Search for content pages by name or text. Returns a list of matching pages with their names and IDs. Use get-page with an ID from the results to retrieve full page content.",
398
+ description: "Search for content pages by name only \u2014 it does not match body text or other field values (tracked in #234). Returns a list of matching pages with their names and IDs. For body text, use list-children + get-page instead. Use get-page with an ID from the results to retrieve full page content.",
360
399
  inputSchema,
361
400
  outputSchema,
362
401
  slices: ["search"],
@@ -432,8 +471,10 @@ var tool2 = {
432
471
  })),
433
472
  variants: doc.variants ?? [],
434
473
  previewUrl: buildPreviewUrl(doc.id),
435
- // GetDocumentByIdOutput doesn't include `urls` — runtime field, not in the upstream Zod schema.
436
- publishedUrls: flattenPublishedUrls(doc.urls)
474
+ // Umbraco 18's get-document-by-id response no longer carries `urls` —
475
+ // published URLs now come only from the separate get-document-urls
476
+ // endpoint via fetchPublishedUrls.
477
+ publishedUrls: await fetchPublishedUrls(id)
437
478
  });
438
479
  }
439
480
  };
@@ -757,13 +798,13 @@ async function validateDocumentState(id, doc) {
757
798
  culture: v.culture ?? null,
758
799
  segment: v.segment ?? null
759
800
  }));
760
- const ancestorsResult = await chainCms("get-document-ancestors", { descendantId: id });
761
- const parent = ancestorsResult.ok ? (ancestorsResult.data.items ?? []).find((item) => item.id === id)?.parent ?? null : null;
801
+ const itemResult = await chainCms("get-item-document", { id: [id] });
802
+ const parent = itemResult.ok ? itemResult.data.items[0]?.parent ?? null : null;
762
803
  const result = await chainCms("validate-document", {
763
804
  id,
764
805
  documentType: { id: target.documentType.id },
765
806
  template: target.template ? { id: target.template.id } : null,
766
- parent,
807
+ parent: parent ? { id: parent.id } : null,
767
808
  values,
768
809
  variants
769
810
  });
@@ -907,6 +948,30 @@ function isBlockListOrGridValue(value) {
907
948
  function isRteWithBlocks(value) {
908
949
  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);
909
950
  }
951
+
952
+ // src/umbraco-api/tools/helpers/block-inspector.ts
953
+ function blockPropertiesSchema(editTool) {
954
+ return z.array(z.object({
955
+ propertyAlias: z.string().describe("The property containing these blocks"),
956
+ editorAlias: z.string().optional(),
957
+ blocks: z.array(z.object({
958
+ contentKey: z.string().describe(`The block's unique key \u2014 use this with ${editTool}`),
959
+ contentTypeKey: z.string().describe("The block's element type ID"),
960
+ settingsKey: z.string().optional().describe("The key of the block's settings entry. Absent when the block has no settings."),
961
+ properties: z.array(z.object({
962
+ alias: z.string(),
963
+ value: z.any()
964
+ }))
965
+ }))
966
+ }));
967
+ }
968
+ function extractBlocks(contentData) {
969
+ return contentData.map((block) => ({
970
+ contentKey: block?.key ?? "",
971
+ contentTypeKey: block?.contentTypeKey ?? "",
972
+ properties: Array.isArray(block?.values) ? block.values.map((v) => ({ alias: v?.alias ?? "", value: v?.value })) : []
973
+ }));
974
+ }
910
975
  function findSettingsKey(container, contentKey) {
911
976
  const layout = container?.layout;
912
977
  if (!layout || typeof layout !== "object") return void 0;
@@ -933,92 +998,133 @@ function searchLayout(entries, contentKey) {
933
998
  }
934
999
  return void 0;
935
1000
  }
936
-
937
- // src/umbraco-api/tools/content/get/inspect-blocks.ts
938
- var inputSchema6 = {
939
- id: z.string().uuid().describe("The ID of the page to inspect"),
940
- propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
941
- };
942
- var outputSchema6 = z.object({
943
- id: z.string(),
944
- name: z.string(),
945
- previewUrl: previewUrlSchema,
946
- blockProperties: z.array(z.object({
947
- propertyAlias: z.string().describe("The document property containing these blocks"),
948
- editorAlias: z.string().optional(),
949
- blocks: z.array(z.object({
950
- contentKey: z.string().describe("The block's unique key \u2014 use this with edit-block"),
951
- contentTypeKey: z.string().describe("The block's element type ID"),
952
- settingsKey: z.string().optional().describe("The key of the block's settings entry. Absent when the block has no settings."),
953
- properties: z.array(z.object({
954
- alias: z.string(),
955
- value: z.any()
956
- }))
957
- }))
958
- }))
959
- });
960
- function isBlockListOrGridValue2(value) {
961
- return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
962
- }
963
- function isRteWithBlocks2(value) {
964
- 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);
965
- }
966
- function extractBlocks(contentData, container) {
967
- return contentData.map((block) => {
968
- const contentKey = block.key ?? "";
969
- const settingsKey = findSettingsKey(container, contentKey);
1001
+ function collectBlockProperties(values, propertyAlias) {
1002
+ const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
1003
+ return filtered.filter((v) => isBlockListOrGridValue(v.value) || isRteWithBlocks(v.value)).map((v) => {
1004
+ const value = v.value;
1005
+ const container = isRteWithBlocks(value) ? value.blocks : value;
970
1006
  return {
971
- contentKey,
972
- contentTypeKey: block.contentTypeKey ?? "",
973
- ...settingsKey ? { settingsKey } : {},
974
- properties: Array.isArray(block.values) ? block.values.map((v) => ({ alias: v.alias ?? "", value: v.value })) : []
1007
+ propertyAlias: v.alias,
1008
+ editorAlias: isRteWithBlocks(value) ? "Umbraco.RichText" : v.editorAlias ?? void 0,
1009
+ blocks: withSettingsKeys(extractBlocks(container.contentData), container)
975
1010
  };
976
1011
  });
977
1012
  }
978
- var tool6 = {
979
- name: "inspect-blocks",
980
- 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.",
981
- inputSchema: inputSchema6,
982
- outputSchema: outputSchema6,
983
- slices: ["read"],
984
- annotations: { readOnlyHint: true },
985
- handler: async ({ id, propertyAlias }) => {
986
- const result = await chainCms("get-document-by-id", { id });
987
- if (!result.ok) return result.errorResult;
988
- const doc = result.data;
989
- const allValues = doc.values ?? [];
990
- const filtered = propertyAlias ? allValues.filter((v) => v.alias === propertyAlias) : allValues;
991
- const blockProperties = filtered.filter((v) => isBlockListOrGridValue2(v.value) || isRteWithBlocks2(v.value)).map((v) => {
992
- const value = v.value;
993
- if (isRteWithBlocks2(value)) {
994
- return {
995
- propertyAlias: v.alias,
996
- editorAlias: "Umbraco.RichText",
997
- blocks: extractBlocks(value.blocks.contentData, value.blocks)
998
- };
999
- }
1000
- return {
1001
- propertyAlias: v.alias,
1002
- editorAlias: v.editorAlias ?? void 0,
1003
- blocks: extractBlocks(value.contentData, value)
1004
- };
1005
- });
1006
- return createToolResult({
1007
- id: doc.id,
1008
- name: doc.variants?.[0]?.name ?? "Unknown",
1009
- previewUrl: buildPreviewUrl(doc.id),
1010
- blockProperties
1011
- });
1013
+ var MAX_ENRICHED_BLOCKS = 50;
1014
+ var MAX_BLOCK_WALK_DEPTH = 20;
1015
+ function enrichBlockNotFoundError(errorResult, values, options = {}) {
1016
+ const problem = extractInnerProblemDetails(errorResult);
1017
+ const availableBlocks = problem.availableBlocks;
1018
+ if (!Array.isArray(availableBlocks)) return errorResult;
1019
+ const { propertyAlias, note } = options;
1020
+ const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
1021
+ const typeByKey = /* @__PURE__ */ new Map();
1022
+ for (const v of filtered) {
1023
+ const container = isRteWithBlocks(v.value) ? v.value.blocks : v.value;
1024
+ if (isBlockListOrGridValue(container)) {
1025
+ collectBlockEntryTypes(container, typeByKey, 0);
1026
+ }
1012
1027
  }
1013
- };
1014
- var inspect_blocks_default = withStandardDecorators(tool6);
1015
- var inputSchema7 = {
1016
- id: z.string().uuid().describe("The ID of the page to find references for"),
1017
- take: z.number().optional().default(50).describe("Number of references to return (default 50)"),
1018
- skip: z.number().optional().default(0).describe("Number of references to skip for pagination")
1019
- };
1020
- var outputSchema7 = z.object({
1021
- total: z.number(),
1028
+ const truncated = availableBlocks.length > MAX_ENRICHED_BLOCKS;
1029
+ const limitedBlocks = truncated ? availableBlocks.slice(0, MAX_ENRICHED_BLOCKS) : availableBlocks;
1030
+ const enrichedBlocks = limitedBlocks.map(
1031
+ (b) => b && typeof b === "object" && typeof b.key === "string" ? { ...b, contentTypeKey: typeByKey.get(b.key) ?? null } : b
1032
+ );
1033
+ return createToolResultError({
1034
+ ...problem,
1035
+ availableBlocks: enrichedBlocks,
1036
+ ...truncated ? { availableBlocksNote: `Showing ${MAX_ENRICHED_BLOCKS} of ${availableBlocks.length} available blocks \u2014 use inspect-blocks for the full list.` } : {},
1037
+ ...note ? { note } : {}
1038
+ });
1039
+ }
1040
+ function collectBlockEntryTypes(container, into, depth) {
1041
+ if (depth > MAX_BLOCK_WALK_DEPTH) return;
1042
+ for (const list of [container.contentData, container.settingsData]) {
1043
+ if (!Array.isArray(list)) continue;
1044
+ for (const block of list) {
1045
+ if (!block || typeof block !== "object") continue;
1046
+ const key = block.key;
1047
+ const contentTypeKey = block.contentTypeKey;
1048
+ if (typeof key === "string" && typeof contentTypeKey === "string") into.set(key, contentTypeKey);
1049
+ const nestedValues = block.values;
1050
+ if (!Array.isArray(nestedValues)) continue;
1051
+ for (const nested of nestedValues) {
1052
+ const nestedRaw = nested?.value;
1053
+ const nestedContainer = isRteWithBlocks(nestedRaw) ? nestedRaw.blocks : nestedRaw;
1054
+ if (isBlockListOrGridValue(nestedContainer)) {
1055
+ collectBlockEntryTypes(nestedContainer, into, depth + 1);
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ function withSettingsKeys(blocks, container) {
1062
+ return blocks.map((block) => {
1063
+ const settingsKey = findSettingsKey(container, block.contentKey);
1064
+ return settingsKey ? { ...block, settingsKey } : block;
1065
+ });
1066
+ }
1067
+ var blockPropertyAliasSchema = z.string().regex(
1068
+ /^[A-Za-z_][A-Za-z0-9_]*$/,
1069
+ "Property alias must be a valid identifier (letters, digits, underscore; not starting with a digit)"
1070
+ );
1071
+ function classifyBlockUpdateResults(results, requestedCount, requestedAliases = [], expectedEntryCount = 1) {
1072
+ const list = results ?? [];
1073
+ const processedCount = list.reduce((sum, r) => sum + (r.updatedCount ?? 0) + (r.addedCount ?? 0), 0);
1074
+ const updatedEntryCount = list.filter((r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) > 0).length;
1075
+ const errors = list.flatMap((r) => r.errors ?? []);
1076
+ const warnings = list.flatMap((r) => r.warnings ?? []);
1077
+ const failureText = [...errors, ...warnings].join("; ");
1078
+ const unresolvedEntries = list.filter(
1079
+ (r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) === 0 && !r.errors?.length && !r.warnings?.length
1080
+ );
1081
+ const missingEntryCount = Math.max(0, expectedEntryCount - list.length);
1082
+ const unresolvedBlockCount = unresolvedEntries.length + missingEntryCount;
1083
+ const detail = [...errors, ...warnings, ...unresolvedEntries.map((r) => r.message).filter(Boolean)].join("; ") || list.map((r) => r.message).filter(Boolean).join("; ") || "no detail returned";
1084
+ const outcome = processedCount === 0 ? "failed" : processedCount < requestedCount ? "partial" : "clean";
1085
+ const failedFields = requestedAliases.filter((alias) => failureText.includes(`'${alias}'`));
1086
+ const savedFields = unresolvedBlockCount > 0 ? [] : requestedAliases.filter((alias) => !failedFields.includes(alias));
1087
+ return { outcome, processedCount, updatedEntryCount, detail, warnings, savedFields, failedFields, unresolvedBlockCount };
1088
+ }
1089
+
1090
+ // src/umbraco-api/tools/content/get/inspect-blocks.ts
1091
+ var inputSchema6 = {
1092
+ id: z.string().uuid().describe("The ID of the page to inspect"),
1093
+ propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
1094
+ };
1095
+ var outputSchema6 = z.object({
1096
+ id: z.string(),
1097
+ name: z.string(),
1098
+ previewUrl: previewUrlSchema,
1099
+ blockProperties: blockPropertiesSchema("edit-block")
1100
+ });
1101
+ var tool6 = {
1102
+ name: "inspect-blocks",
1103
+ 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.",
1104
+ inputSchema: inputSchema6,
1105
+ outputSchema: outputSchema6,
1106
+ slices: ["read"],
1107
+ annotations: { readOnlyHint: true },
1108
+ handler: async ({ id, propertyAlias }) => {
1109
+ const result = await chainCms("get-document-by-id", { id });
1110
+ if (!result.ok) return result.errorResult;
1111
+ const doc = result.data;
1112
+ return createToolResult({
1113
+ id: doc.id,
1114
+ name: doc.variants?.[0]?.name ?? "Unknown",
1115
+ previewUrl: buildPreviewUrl(doc.id),
1116
+ blockProperties: collectBlockProperties(doc.values ?? [], propertyAlias)
1117
+ });
1118
+ }
1119
+ };
1120
+ var inspect_blocks_default = withStandardDecorators(tool6);
1121
+ var inputSchema7 = {
1122
+ id: z.string().uuid().describe("The ID of the page to find references for"),
1123
+ take: z.number().optional().default(50).describe("Number of references to return (default 50)"),
1124
+ skip: z.number().optional().default(0).describe("Number of references to skip for pagination")
1125
+ };
1126
+ var outputSchema7 = z.object({
1127
+ total: z.number(),
1022
1128
  items: z.array(z.object({
1023
1129
  id: z.string(),
1024
1130
  name: z.string(),
@@ -1335,7 +1441,8 @@ ${aliases.join("\n")}`
1335
1441
  const schemaResult = await chainCms("get-data-type-schema", { id: match.id });
1336
1442
  if (!schemaResult.ok) return schemaResult.errorResult;
1337
1443
  return createToolResult({
1338
- message: JSON.stringify(schemaResult.data, null, 2),
1444
+ message: `Value-shape template for ${editorAlias}:
1445
+ ${JSON.stringify(schemaResult.data, null, 2)}`,
1339
1446
  editorAlias
1340
1447
  });
1341
1448
  }
@@ -1482,7 +1589,7 @@ var outputSchema12 = z.object({
1482
1589
  });
1483
1590
  var tool12 = {
1484
1591
  name: "create-and-publish-page",
1485
- 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.",
1592
+ 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.",
1486
1593
  inputSchema: inputSchema12,
1487
1594
  outputSchema: outputSchema12,
1488
1595
  slices: ["create", "publish"],
@@ -1490,42 +1597,14 @@ var tool12 = {
1490
1597
  handler: async ({ name, documentTypeId, parentId, values }) => {
1491
1598
  const resolved = await resolveEditorAliases(documentTypeId, values);
1492
1599
  if (!resolved.ok) return resolved.errorResult;
1493
- if (await isCmsToolAvailable("create-and-publish-document")) {
1494
- const createResult = await chainCms("create-and-publish-document", {
1495
- documentTypeId,
1496
- name,
1497
- values: resolved.values,
1498
- ...parentId ? { parentId } : {}
1499
- });
1500
- if (!createResult.ok) return createResult.errorResult;
1501
- const createdId2 = createResult.data.id;
1502
- return createToolResult({
1503
- message: `Created and published "${name}"`,
1504
- id: createdId2,
1505
- name,
1506
- publishedUrls: createdId2 ? await fetchPublishedUrls(createdId2) : []
1507
- });
1508
- }
1509
- const createDocumentResult = await chainCms("create-document", {
1600
+ const createResult = await chainCms("create-and-publish-document", {
1510
1601
  documentTypeId,
1511
1602
  name,
1512
1603
  values: resolved.values,
1513
1604
  ...parentId ? { parentId } : {}
1514
1605
  });
1515
- if (!createDocumentResult.ok) return createDocumentResult.errorResult;
1516
- const createdId = createDocumentResult.data.id;
1517
- const publishResult = await chainCms("publish-document", {
1518
- id: createdId,
1519
- data: { publishSchedules: [{ culture: null }] }
1520
- });
1521
- if (!publishResult.ok) {
1522
- return createToolResult({
1523
- message: `Created "${name}" as a draft but publish failed: ${publishResult.errorResult.content?.[0]?.text ?? "unknown error"}`,
1524
- id: createdId,
1525
- name,
1526
- publishedUrls: []
1527
- });
1528
- }
1606
+ if (!createResult.ok) return createResult.errorResult;
1607
+ const createdId = createResult.data.id;
1529
1608
  return createToolResult({
1530
1609
  message: `Created and published "${name}"`,
1531
1610
  id: createdId,
@@ -1863,78 +1942,6 @@ var tool17 = {
1863
1942
  }
1864
1943
  };
1865
1944
  var edit_page_default = withStandardDecorators(tool17);
1866
- var MAX_ENRICHED_BLOCKS = 50;
1867
- var MAX_BLOCK_WALK_DEPTH = 20;
1868
- function enrichBlockNotFoundError(errorResult, values, options = {}) {
1869
- const problem = extractInnerProblemDetails(errorResult);
1870
- const availableBlocks = problem.availableBlocks;
1871
- if (!Array.isArray(availableBlocks)) return errorResult;
1872
- const { propertyAlias, note } = options;
1873
- const filtered = propertyAlias ? values.filter((v) => v.alias === propertyAlias) : values;
1874
- const typeByKey = /* @__PURE__ */ new Map();
1875
- for (const v of filtered) {
1876
- const container = isRteWithBlocks(v.value) ? v.value.blocks : v.value;
1877
- if (isBlockListOrGridValue(container)) {
1878
- collectBlockEntryTypes(container, typeByKey, 0);
1879
- }
1880
- }
1881
- const truncated = availableBlocks.length > MAX_ENRICHED_BLOCKS;
1882
- const limitedBlocks = truncated ? availableBlocks.slice(0, MAX_ENRICHED_BLOCKS) : availableBlocks;
1883
- const enrichedBlocks = limitedBlocks.map(
1884
- (b) => b && typeof b === "object" && typeof b.key === "string" ? { ...b, contentTypeKey: typeByKey.get(b.key) ?? null } : b
1885
- );
1886
- return createToolResultError({
1887
- ...problem,
1888
- availableBlocks: enrichedBlocks,
1889
- ...truncated ? { availableBlocksNote: `Showing ${MAX_ENRICHED_BLOCKS} of ${availableBlocks.length} available blocks \u2014 use inspect-blocks for the full list.` } : {},
1890
- ...note ? { note } : {}
1891
- });
1892
- }
1893
- function collectBlockEntryTypes(container, into, depth) {
1894
- if (depth > MAX_BLOCK_WALK_DEPTH) return;
1895
- for (const list of [container.contentData, container.settingsData]) {
1896
- if (!Array.isArray(list)) continue;
1897
- for (const block of list) {
1898
- if (!block || typeof block !== "object") continue;
1899
- const key = block.key;
1900
- const contentTypeKey = block.contentTypeKey;
1901
- if (typeof key === "string" && typeof contentTypeKey === "string") into.set(key, contentTypeKey);
1902
- const nestedValues = block.values;
1903
- if (!Array.isArray(nestedValues)) continue;
1904
- for (const nested of nestedValues) {
1905
- const nestedRaw = nested?.value;
1906
- const nestedContainer = isRteWithBlocks(nestedRaw) ? nestedRaw.blocks : nestedRaw;
1907
- if (isBlockListOrGridValue(nestedContainer)) {
1908
- collectBlockEntryTypes(nestedContainer, into, depth + 1);
1909
- }
1910
- }
1911
- }
1912
- }
1913
- }
1914
- var blockPropertyAliasSchema = z.string().regex(
1915
- /^[A-Za-z_][A-Za-z0-9_]*$/,
1916
- "Property alias must be a valid identifier (letters, digits, underscore; not starting with a digit)"
1917
- );
1918
- function classifyBlockUpdateResults(results, requestedCount, requestedAliases = [], expectedEntryCount = 1) {
1919
- const list = results ?? [];
1920
- const processedCount = list.reduce((sum, r) => sum + (r.updatedCount ?? 0) + (r.addedCount ?? 0), 0);
1921
- const updatedEntryCount = list.filter((r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) > 0).length;
1922
- const errors = list.flatMap((r) => r.errors ?? []);
1923
- const warnings = list.flatMap((r) => r.warnings ?? []);
1924
- const failureText = [...errors, ...warnings].join("; ");
1925
- const unresolvedEntries = list.filter(
1926
- (r) => (r.updatedCount ?? 0) + (r.addedCount ?? 0) === 0 && !r.errors?.length && !r.warnings?.length
1927
- );
1928
- const missingEntryCount = Math.max(0, expectedEntryCount - list.length);
1929
- const unresolvedBlockCount = unresolvedEntries.length + missingEntryCount;
1930
- const detail = [...errors, ...warnings, ...unresolvedEntries.map((r) => r.message).filter(Boolean)].join("; ") || list.map((r) => r.message).filter(Boolean).join("; ") || "no detail returned";
1931
- const outcome = processedCount === 0 ? "failed" : processedCount < requestedCount ? "partial" : "clean";
1932
- const failedFields = requestedAliases.filter((alias) => failureText.includes(`'${alias}'`));
1933
- const savedFields = unresolvedBlockCount > 0 ? [] : requestedAliases.filter((alias) => !failedFields.includes(alias));
1934
- return { outcome, processedCount, updatedEntryCount, detail, warnings, savedFields, failedFields, unresolvedBlockCount };
1935
- }
1936
-
1937
- // src/umbraco-api/tools/content/put/edit-block.ts
1938
1945
  var inputSchema18 = {
1939
1946
  id: z.string().uuid().describe("The ID of the page containing the block"),
1940
1947
  propertyAlias: z.string().describe("The document property alias containing the blocks (e.g. 'mainContent'). Use inspect-blocks to find this."),
@@ -1959,7 +1966,7 @@ var outputSchema18 = z.object({
1959
1966
  });
1960
1967
  var tool18 = {
1961
1968
  name: "edit-block",
1962
- 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.",
1969
+ 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.",
1963
1970
  inputSchema: inputSchema18,
1964
1971
  outputSchema: outputSchema18,
1965
1972
  slices: ["update"],
@@ -2071,7 +2078,8 @@ var tool19 = {
2071
2078
  const targetCulture = culture ?? null;
2072
2079
  const docResult = await chainCms("get-document-by-id", { id });
2073
2080
  if (!docResult.ok) return docResult.errorResult;
2074
- const variants = docResult.data.variants ?? [];
2081
+ const doc = docResult.data;
2082
+ const variants = doc.variants ?? [];
2075
2083
  const targetVariant = variants.find((v) => matchesCulture(v, targetCulture));
2076
2084
  if (!targetVariant) {
2077
2085
  if (targetCulture) {
@@ -2105,8 +2113,8 @@ var tool19 = {
2105
2113
  previewUrl: buildPreviewUrl(id)
2106
2114
  });
2107
2115
  }
2108
- const renameResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2109
- if (!renameResult.ok) return renameResult.errorResult;
2116
+ const updateResult = await chainCms("update-document-name", { id, name, culture: targetCulture });
2117
+ if (!updateResult.ok) return updateResult.errorResult;
2110
2118
  return createToolResult({
2111
2119
  message: `Renamed page${cultureLabel} from "${previousName}" to "${name}" (saved, not published)`,
2112
2120
  id,
@@ -2586,17 +2594,36 @@ var outputSchema27 = z.object({
2586
2594
  updatedFields: z.array(z.string()),
2587
2595
  publishedUrls: publishedUrlsSchema
2588
2596
  });
2589
- function mergeValues(existing, updates) {
2590
- const key = (v) => `${v.alias}::${v.culture ?? ""}::${v.segment ?? ""}`;
2591
- const merged = new Map(existing.map((v) => [key(v), { alias: v.alias, value: v.value, culture: v.culture ?? null, segment: v.segment ?? null }]));
2592
- for (const u of updates) {
2593
- merged.set(key(u), { alias: u.alias, value: u.value, culture: u.culture ?? null, segment: u.segment ?? null });
2597
+ function valueKey2(value) {
2598
+ return `${value.alias}|${value.culture ?? ""}|${value.segment ?? ""}`;
2599
+ }
2600
+ function normaliseValue(value) {
2601
+ return {
2602
+ alias: value.alias,
2603
+ value: value.value,
2604
+ culture: value.culture ?? null,
2605
+ segment: value.segment ?? null
2606
+ };
2607
+ }
2608
+ function mergeValues(current, incoming) {
2609
+ const merged = current.map(normaliseValue);
2610
+ const indexByKey = new Map(merged.map((value, index) => [valueKey2(value), index]));
2611
+ for (const value of incoming) {
2612
+ const next = normaliseValue(value);
2613
+ const key = valueKey2(next);
2614
+ const existingIndex = indexByKey.get(key);
2615
+ if (existingIndex !== void 0) {
2616
+ merged[existingIndex] = next;
2617
+ } else {
2618
+ indexByKey.set(key, merged.length);
2619
+ merged.push(next);
2620
+ }
2594
2621
  }
2595
- return [...merged.values()];
2622
+ return merged;
2596
2623
  }
2597
2624
  var tool27 = {
2598
2625
  name: "save-and-publish",
2599
- 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.",
2626
+ 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.",
2600
2627
  inputSchema: inputSchema27,
2601
2628
  outputSchema: outputSchema27,
2602
2629
  slices: ["publish", "update"],
@@ -2607,6 +2634,7 @@ var tool27 = {
2607
2634
  const doc = docResult.data;
2608
2635
  const pageName = doc.variants?.[0]?.name ?? "Unknown";
2609
2636
  const fieldNames = (values ?? []).map((v) => v.alias);
2637
+ const hasValues = (values?.length ?? 0) > 0;
2610
2638
  if (includeDescendants) {
2611
2639
  if (!await requestApproval(extra, `Publish "${pageName}" and all its descendants?`)) {
2612
2640
  return createToolResult({
@@ -2621,9 +2649,9 @@ var tool27 = {
2621
2649
  }
2622
2650
  }
2623
2651
  const variantCultures = (doc.variants ?? []).length ? doc.variants.map((v) => v.culture ?? null) : [null];
2624
- const saved = !!(values && values.length > 0);
2625
2652
  if (includeDescendants) {
2626
- if (saved) {
2653
+ let saved = false;
2654
+ if (hasValues) {
2627
2655
  const properties = values.map((v) => ({
2628
2656
  alias: v.alias,
2629
2657
  value: v.value,
@@ -2632,6 +2660,7 @@ var tool27 = {
2632
2660
  }));
2633
2661
  const updateResult = await chainCms("update-document-properties", { id, properties });
2634
2662
  if (!updateResult.ok) return updateResult.errorResult;
2663
+ saved = true;
2635
2664
  }
2636
2665
  const publishResult = await chainCms("publish-document-with-descendants", {
2637
2666
  id,
@@ -2654,85 +2683,74 @@ var tool27 = {
2654
2683
  }
2655
2684
  return publishResult.errorResult;
2656
2685
  }
2657
- } else {
2658
- const mergedValues = mergeValues(doc.values ?? [], values ?? []);
2659
- const variants = (doc.variants ?? []).map((v) => ({
2660
- culture: v.culture ?? null,
2661
- segment: v.segment ?? null,
2662
- name: v.name
2663
- }));
2664
- if (await isCmsToolAvailable("update-and-publish-document")) {
2665
- const updateAndPublishResult = await chainCms("update-and-publish-document", {
2666
- id,
2667
- data: {
2668
- values: mergedValues,
2669
- variants,
2670
- template: doc.template ?? null,
2671
- culturesToPublish: variantCultures.filter((c) => c !== null)
2672
- }
2673
- });
2674
- if (!updateAndPublishResult.ok) return updateAndPublishResult.errorResult;
2675
- } else {
2676
- const updateResult = await chainCms("update-document", {
2677
- id,
2678
- data: {
2679
- values: mergedValues,
2680
- variants,
2681
- template: doc.template ?? null
2682
- }
2683
- });
2684
- if (!updateResult.ok) return updateResult.errorResult;
2685
- const publishResult = await chainCms("publish-document", {
2686
- id,
2687
- data: {
2688
- publishSchedules: variantCultures.map((c) => ({ culture: c }))
2689
- }
2690
- });
2691
- if (!publishResult.ok) {
2692
- if (saved) {
2693
- return createToolResult({
2694
- message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish failed: ${publishResult.errorResult.content?.[0]?.text ?? "unknown error"}`,
2695
- id,
2696
- name: pageName,
2697
- saved: true,
2698
- published: false,
2699
- updatedFields: fieldNames,
2700
- publishedUrls: []
2701
- });
2702
- }
2703
- return publishResult.errorResult;
2704
- }
2705
- }
2686
+ const savedPart2 = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2687
+ return createToolResult({
2688
+ message: `${savedPart2}published "${pageName}" and all descendants`,
2689
+ id,
2690
+ name: pageName,
2691
+ saved,
2692
+ published: true,
2693
+ updatedFields: fieldNames,
2694
+ publishedUrls: await fetchPublishedUrls(id)
2695
+ });
2706
2696
  }
2707
- if (!includeDescendants) {
2708
- const verifyError = await verifyDocumentPublished(id, variantCultures);
2709
- if (verifyError) {
2710
- if (saved) {
2711
- return createToolResult({
2712
- message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2713
- id,
2714
- name: pageName,
2715
- saved: true,
2716
- published: false,
2717
- updatedFields: fieldNames,
2718
- publishedUrls: []
2719
- });
2697
+ if (hasValues) {
2698
+ const updateAndPublishResult = await chainCms("update-and-publish-document", {
2699
+ id,
2700
+ data: {
2701
+ culturesToPublish: [...new Set(variantCultures.filter((c) => c !== null))],
2702
+ template: doc.template ?? null,
2703
+ values: mergeValues(doc.values ?? [], values),
2704
+ variants: (doc.variants ?? []).map((v) => ({
2705
+ culture: v.culture ?? null,
2706
+ segment: v.segment ?? null,
2707
+ name: v.name
2708
+ }))
2720
2709
  }
2710
+ });
2711
+ if (!updateAndPublishResult.ok) {
2712
+ 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.`;
2713
+ const problem = extractInnerProblemDetails(updateAndPublishResult.errorResult);
2721
2714
  return createToolResultError({
2722
- status: 500,
2723
- title: "Publish did not take effect",
2724
- detail: `"${pageName}": ${verifyError}`
2715
+ ...problem,
2716
+ status: typeof problem?.status === "number" ? problem.status : 500,
2717
+ title: "Save and publish failed",
2718
+ detail: problem?.detail ? `${String(problem.detail)} ${rolledBack}` : rolledBack
2719
+ });
2720
+ }
2721
+ } else {
2722
+ const publishResult = await chainCms("publish-document", {
2723
+ id,
2724
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
2725
+ });
2726
+ if (!publishResult.ok) return publishResult.errorResult;
2727
+ }
2728
+ const verifyError = await verifyDocumentPublished(id, variantCultures);
2729
+ if (verifyError) {
2730
+ if (hasValues) {
2731
+ return createToolResult({
2732
+ message: `Saved ${fieldNames.length} field(s) on "${pageName}" but publish did not take effect: ${verifyError}`,
2733
+ id,
2734
+ name: pageName,
2735
+ saved: true,
2736
+ published: false,
2737
+ updatedFields: fieldNames,
2738
+ publishedUrls: []
2725
2739
  });
2726
2740
  }
2741
+ return createToolResultError({
2742
+ status: 500,
2743
+ title: "Publish did not take effect",
2744
+ detail: `"${pageName}": ${verifyError}`
2745
+ });
2727
2746
  }
2728
2747
  const publishedUrls = await fetchPublishedUrls(id);
2729
- const savedPart = saved ? `Saved ${fieldNames.length} field(s) and ` : "";
2730
- const descPart = includeDescendants ? " and all descendants" : "";
2748
+ const savedPart = hasValues ? `Saved ${fieldNames.length} field(s) and ` : "";
2731
2749
  return createToolResult({
2732
- message: `${savedPart}published "${pageName}"${descPart}`,
2750
+ message: `${savedPart}published "${pageName}"`,
2733
2751
  id,
2734
2752
  name: pageName,
2735
- saved,
2753
+ saved: hasValues,
2736
2754
  published: true,
2737
2755
  updatedFields: fieldNames,
2738
2756
  publishedUrls
@@ -3803,23 +3821,537 @@ var collection5 = {
3803
3821
  };
3804
3822
  var media_management_default = collection5;
3805
3823
  var inputSchema46 = {
3806
- parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
3807
- take: z.number().optional().default(50).describe("Number of results to return"),
3808
- skip: z.number().optional().default(0).describe("Number of results to skip")
3824
+ id: z.string().uuid().describe("The unique ID of the element to retrieve")
3809
3825
  };
3810
3826
  var outputSchema46 = z.object({
3811
- items: z.array(z.object({
3812
- id: z.string(),
3813
- name: z.string(),
3814
- documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
3815
- })).describe("Available page blueprints"),
3816
- total: z.number()
3817
- });
3827
+ id: z.string(),
3828
+ name: z.string(),
3829
+ elementType: z.object({ id: z.string() }).describe("The element type (document type) this element is based on"),
3830
+ values: z.array(z.object({ alias: z.string(), value: z.any() }).passthrough()).describe("Property field values"),
3831
+ variants: z.array(z.object({ name: z.string() }).passthrough()).describe("Language/culture variants")
3832
+ });
3818
3833
  var tool46 = {
3819
- name: "list-blueprints",
3820
- description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
3834
+ name: "get-element",
3835
+ 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.",
3821
3836
  inputSchema: inputSchema46,
3822
3837
  outputSchema: outputSchema46,
3838
+ slices: ["read"],
3839
+ annotations: { readOnlyHint: true },
3840
+ handler: async ({ id }) => {
3841
+ const result = await chainCms("get-element-by-id", { id });
3842
+ if (!result.ok) return result.errorResult;
3843
+ const el = result.data;
3844
+ return createToolResult({
3845
+ id: el.id,
3846
+ name: el.variants?.[0]?.name ?? "Unknown",
3847
+ elementType: { id: el.documentType?.id ?? el.elementType?.id ?? "" },
3848
+ values: el.values ?? [],
3849
+ variants: el.variants ?? []
3850
+ });
3851
+ }
3852
+ };
3853
+ var get_element_default = withStandardDecorators(tool46);
3854
+ var inputSchema47 = {
3855
+ 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)."),
3856
+ take: z.number().optional().default(20).describe("Number of results to return"),
3857
+ skip: z.number().optional().default(0).describe("Number of results to skip")
3858
+ };
3859
+ var outputSchema47 = z.object({
3860
+ items: z.array(z.object({
3861
+ id: z.string(),
3862
+ name: z.string(),
3863
+ isFolder: z.boolean().describe("True if this node is a folder that organises elements, false if it is an element item"),
3864
+ hasChildren: z.boolean()
3865
+ })).describe("Child folders and elements"),
3866
+ total: z.number().describe("Total number of children")
3867
+ });
3868
+ var tool47 = {
3869
+ name: "list-element-children",
3870
+ 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.",
3871
+ inputSchema: inputSchema47,
3872
+ outputSchema: outputSchema47,
3873
+ slices: ["tree"],
3874
+ annotations: { readOnlyHint: true },
3875
+ handler: async ({ parentId, take, skip }) => {
3876
+ const cursor = buildChainedCursor(skip, take);
3877
+ const result = parentId ? await chainCms("get-element-children", { parentId, cursor }) : await chainCms("get-element-root", { cursor });
3878
+ if (!result.ok) return result.errorResult;
3879
+ const data = result.data;
3880
+ const items = data.items ?? [];
3881
+ return createToolResult({
3882
+ items: items.map((item) => ({
3883
+ id: item.id,
3884
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown",
3885
+ isFolder: item.isFolder ?? false,
3886
+ hasChildren: item.hasChildren ?? false
3887
+ })),
3888
+ total: data.total ?? items.length
3889
+ });
3890
+ }
3891
+ };
3892
+ var list_element_children_default = withStandardDecorators(tool47);
3893
+ var inputSchema48 = {
3894
+ query: z.string().describe("Search term to find Library elements by name"),
3895
+ take: z.number().optional().default(10).describe("Number of results to return (default 10)"),
3896
+ skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
3897
+ };
3898
+ var outputSchema48 = z.object({
3899
+ items: z.array(z.object({
3900
+ id: z.string(),
3901
+ name: z.string()
3902
+ })).describe("Matching Library elements"),
3903
+ total: z.number().describe("Total number of matches")
3904
+ });
3905
+ var tool48 = {
3906
+ name: "search-elements",
3907
+ 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).",
3908
+ inputSchema: inputSchema48,
3909
+ outputSchema: outputSchema48,
3910
+ slices: ["search"],
3911
+ annotations: { readOnlyHint: true },
3912
+ handler: async ({ query, take, skip }) => {
3913
+ const result = await chainCms("search-element", { query, cursor: buildChainedCursor(skip, take) });
3914
+ if (!result.ok) return result.errorResult;
3915
+ const data = result.data;
3916
+ const items = data.items ?? [];
3917
+ return createToolResult({
3918
+ items: items.map((item) => ({
3919
+ id: item.id,
3920
+ name: item.variants?.[0]?.name ?? item.name ?? "Unknown"
3921
+ })),
3922
+ total: data.total ?? items.length
3923
+ });
3924
+ }
3925
+ };
3926
+ var search_elements_default = withStandardDecorators(tool48);
3927
+ var inputSchema49 = {
3928
+ id: z.string().uuid().describe("The ID of the Library element to inspect"),
3929
+ propertyAlias: z.string().optional().describe("Specific property alias to inspect. If omitted, all block-based properties are shown.")
3930
+ };
3931
+ var outputSchema49 = z.object({
3932
+ id: z.string(),
3933
+ name: z.string(),
3934
+ blockProperties: blockPropertiesSchema("edit-element-block")
3935
+ });
3936
+ var tool49 = {
3937
+ name: "inspect-element-blocks",
3938
+ 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).",
3939
+ inputSchema: inputSchema49,
3940
+ outputSchema: outputSchema49,
3941
+ slices: ["read"],
3942
+ annotations: { readOnlyHint: true },
3943
+ handler: async ({ id, propertyAlias }) => {
3944
+ const result = await chainCms("get-element-by-id", { id });
3945
+ if (!result.ok) return result.errorResult;
3946
+ const element = result.data;
3947
+ return createToolResult({
3948
+ id: element.id,
3949
+ name: element.variants?.[0]?.name ?? "Unknown",
3950
+ blockProperties: collectBlockProperties(element.values ?? [], propertyAlias)
3951
+ });
3952
+ }
3953
+ };
3954
+ var inspect_element_blocks_default = withStandardDecorators(tool49);
3955
+ var inputSchema50 = {
3956
+ name: z.string().describe("The name of the element to create"),
3957
+ 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."),
3958
+ 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."),
3959
+ values: z.array(z.object({
3960
+ alias: z.string().describe("The property alias"),
3961
+ value: z.any().describe("The property value"),
3962
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
3963
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
3964
+ })).optional().describe("Initial property values to set on the new element")
3965
+ };
3966
+ var outputSchema50 = z.object({
3967
+ message: z.string(),
3968
+ id: z.string(),
3969
+ name: z.string()
3970
+ });
3971
+ var tool50 = {
3972
+ name: "create-element",
3973
+ 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.",
3974
+ inputSchema: inputSchema50,
3975
+ outputSchema: outputSchema50,
3976
+ slices: ["create"],
3977
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
3978
+ handler: async ({ name, elementTypeId, parentId, values }) => {
3979
+ const resolved = await resolveEditorAliases(elementTypeId, values);
3980
+ if (!resolved.ok) return resolved.errorResult;
3981
+ const createResult = await chainCms("create-element", {
3982
+ documentTypeId: elementTypeId,
3983
+ name,
3984
+ values: resolved.values,
3985
+ ...parentId ? { parentId } : {}
3986
+ });
3987
+ if (!createResult.ok) return createResult.errorResult;
3988
+ return createToolResult({
3989
+ message: `Created draft element "${name}"`,
3990
+ id: createResult.data.id ?? "",
3991
+ name
3992
+ });
3993
+ }
3994
+ };
3995
+ var create_element_default = withStandardDecorators(tool50);
3996
+ var inputSchema51 = {
3997
+ name: z.string().describe("The name of the element to create"),
3998
+ 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."),
3999
+ 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."),
4000
+ values: z.array(z.object({
4001
+ alias: z.string().describe("The property alias"),
4002
+ value: z.any().describe("The property value"),
4003
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4004
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4005
+ })).optional().describe("Initial property values to set on the new element")
4006
+ };
4007
+ var outputSchema51 = z.object({
4008
+ message: z.string(),
4009
+ id: z.string(),
4010
+ name: z.string()
4011
+ });
4012
+ var tool51 = {
4013
+ name: "create-and-publish-element",
4014
+ 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.",
4015
+ inputSchema: inputSchema51,
4016
+ outputSchema: outputSchema51,
4017
+ slices: ["create", "publish"],
4018
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4019
+ handler: async ({ name, elementTypeId, parentId, values }) => {
4020
+ const createResult = await chainCms("create-and-publish-element", {
4021
+ documentTypeId: elementTypeId,
4022
+ name,
4023
+ values: (values ?? []).map((v) => ({
4024
+ alias: v.alias,
4025
+ value: v.value,
4026
+ culture: v.culture ?? null,
4027
+ segment: v.segment ?? null
4028
+ })),
4029
+ ...parentId ? { parentId } : {}
4030
+ });
4031
+ if (!createResult.ok) return createResult.errorResult;
4032
+ return createToolResult({
4033
+ message: `Created and published element "${name}"`,
4034
+ id: createResult.data.id ?? "",
4035
+ name
4036
+ });
4037
+ }
4038
+ };
4039
+ var create_and_publish_element_default = withStandardDecorators(tool51);
4040
+ var inputSchema52 = {
4041
+ name: z.string().describe("Name of the new folder"),
4042
+ parentId: z.string().uuid().optional().describe("ID of the parent folder in the Library (omit to create at the root)")
4043
+ };
4044
+ var outputSchema52 = z.object({
4045
+ message: z.string(),
4046
+ id: z.string(),
4047
+ name: z.string()
4048
+ });
4049
+ var tool52 = {
4050
+ name: "create-element-folder",
4051
+ 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.",
4052
+ inputSchema: inputSchema52,
4053
+ outputSchema: outputSchema52,
4054
+ slices: ["create"],
4055
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4056
+ handler: async ({ name, parentId }) => {
4057
+ const createResult = await chainCms("create-element-folder", { name, parent: parentId ? { id: parentId } : null });
4058
+ if (!createResult.ok) return createResult.errorResult;
4059
+ let createdId = createResult.data?.id ?? "";
4060
+ let location = "at the root";
4061
+ if (!createdId) {
4062
+ const listResult = parentId ? await chainCms("get-element-children", { parentId }) : await chainCms("get-element-root", {});
4063
+ if (listResult.ok) {
4064
+ const match = (listResult.data.items ?? []).filter((i) => i.isFolder).find((i) => (i.variants?.[0]?.name ?? i.name) === name);
4065
+ if (match) createdId = match.id;
4066
+ }
4067
+ }
4068
+ if (parentId) {
4069
+ const folderResult = await chainCms("get-element-folder", { id: parentId });
4070
+ if (folderResult.ok) location = `under "${folderResult.data.name ?? "Unknown"}"`;
4071
+ }
4072
+ return createToolResult({
4073
+ message: `Created Library folder "${name}" ${location}`,
4074
+ id: createdId,
4075
+ name
4076
+ });
4077
+ }
4078
+ };
4079
+ var create_element_folder_default = withStandardDecorators(tool52);
4080
+ var inputSchema53 = {
4081
+ id: z.string().uuid().describe("The ID of the element to publish")
4082
+ };
4083
+ var outputSchema53 = z.object({
4084
+ message: z.string(),
4085
+ id: z.string(),
4086
+ name: z.string()
4087
+ });
4088
+ var tool53 = {
4089
+ name: "publish-element",
4090
+ 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.",
4091
+ inputSchema: inputSchema53,
4092
+ outputSchema: outputSchema53,
4093
+ slices: ["publish"],
4094
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4095
+ handler: async ({ id }) => {
4096
+ const elResult = await chainCms("get-element-by-id", { id });
4097
+ if (!elResult.ok) return elResult.errorResult;
4098
+ const el = elResult.data;
4099
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4100
+ const variantCultures = (el.variants ?? []).length ? el.variants.map((v) => v.culture ?? null) : [null];
4101
+ const publishResult = await chainCms("publish-element", {
4102
+ id,
4103
+ data: { publishSchedules: variantCultures.map((c) => ({ culture: c })) }
4104
+ });
4105
+ if (!publishResult.ok) return publishResult.errorResult;
4106
+ return createToolResult({
4107
+ message: `Published element "${elementName}"`,
4108
+ id,
4109
+ name: elementName
4110
+ });
4111
+ }
4112
+ };
4113
+ var publish_element_default = withStandardDecorators(tool53);
4114
+ var inputSchema54 = {
4115
+ id: z.string().uuid().describe("The ID of the element to unpublish")
4116
+ };
4117
+ var outputSchema54 = z.object({
4118
+ message: z.string(),
4119
+ id: z.string(),
4120
+ name: z.string()
4121
+ });
4122
+ var tool54 = {
4123
+ name: "unpublish-element",
4124
+ description: "Unpublish a Library element, taking it offline. The element still exists as a draft. You will be asked to confirm before unpublishing.",
4125
+ inputSchema: inputSchema54,
4126
+ outputSchema: outputSchema54,
4127
+ slices: ["publish"],
4128
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4129
+ handler: async ({ id }, extra) => {
4130
+ const elResult = await chainCms("get-element-by-id", { id });
4131
+ if (!elResult.ok) return elResult.errorResult;
4132
+ const el = elResult.data;
4133
+ const elementName = el.variants?.[0]?.name ?? "Unknown";
4134
+ if (!await requestApproval(extra, `Unpublish element "${elementName}"? This will take it offline.`)) {
4135
+ return createToolResult({ message: "Unpublish cancelled", id, name: elementName });
4136
+ }
4137
+ const cultures = (el.variants ?? []).filter((v) => v.culture).map((v) => v.culture);
4138
+ const result = await chainCms("unpublish-element", {
4139
+ id,
4140
+ data: { cultures: cultures.length > 0 ? cultures : null }
4141
+ });
4142
+ if (!result.ok) return result.errorResult;
4143
+ return createToolResult({ message: `Unpublished element "${elementName}" \u2014 it is now a draft only`, id, name: elementName });
4144
+ }
4145
+ };
4146
+ var unpublish_element_default = withStandardDecorators(tool54);
4147
+ var inputSchema55 = {
4148
+ id: z.string().uuid().describe("The ID of the element to edit"),
4149
+ values: z.array(z.object({
4150
+ alias: z.string().describe("The property alias"),
4151
+ value: z.any().describe("The new property value"),
4152
+ culture: z.string().nullable().optional().describe("The culture code for variant content"),
4153
+ segment: z.string().nullable().optional().describe("The segment for segmented content")
4154
+ })).describe("Property values to update on the element")
4155
+ };
4156
+ var outputSchema55 = z.object({
4157
+ message: z.string(),
4158
+ id: z.string(),
4159
+ name: z.string(),
4160
+ updatedFields: z.array(z.string())
4161
+ });
4162
+ var tool55 = {
4163
+ name: "edit-element",
4164
+ 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).",
4165
+ inputSchema: inputSchema55,
4166
+ outputSchema: outputSchema55,
4167
+ slices: ["update"],
4168
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4169
+ handler: async ({ id, values }) => {
4170
+ const elResult = await chainCms("get-element-by-id", { id });
4171
+ if (!elResult.ok) return elResult.errorResult;
4172
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4173
+ const fieldNames = values.map((v) => v.alias);
4174
+ const properties = values.map((v) => ({
4175
+ alias: v.alias,
4176
+ value: v.value,
4177
+ culture: v.culture ?? null,
4178
+ segment: v.segment ?? null
4179
+ }));
4180
+ const updateResult = await chainCms("update-element-properties", { id, properties });
4181
+ if (!updateResult.ok) return updateResult.errorResult;
4182
+ return createToolResult({
4183
+ message: `Updated ${fieldNames.length} field(s) on element "${elementName}" (saved, not published)`,
4184
+ id,
4185
+ name: elementName,
4186
+ updatedFields: fieldNames
4187
+ });
4188
+ }
4189
+ };
4190
+ var edit_element_default = withStandardDecorators(tool55);
4191
+ var inputSchema56 = {
4192
+ id: z.string().uuid().describe("The ID of the Library element containing the block"),
4193
+ propertyAlias: z.string().describe("The element property alias containing the blocks (e.g. 'mainContent'). Use inspect-element-blocks to find this."),
4194
+ 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'."),
4195
+ values: z.array(z.object({
4196
+ alias: blockPropertyAliasSchema.describe("The property alias within the block"),
4197
+ value: z.any().describe("The new value for the property")
4198
+ })).min(1).describe("Properties to update within the block"),
4199
+ blockType: z.enum(["content", "settings"]).optional().describe("Whether to update the block's content or its settings. Defaults to 'content'."),
4200
+ culture: z.string().nullable().optional().describe("Culture code if the element property is variant"),
4201
+ segment: z.string().nullable().optional().describe("Segment if the element property is variant")
4202
+ };
4203
+ var outputSchema56 = z.object({
4204
+ message: z.string(),
4205
+ id: z.string(),
4206
+ name: z.string(),
4207
+ contentKey: z.string(),
4208
+ updatedFields: z.array(z.string()),
4209
+ warnings: z.array(z.string()).optional()
4210
+ });
4211
+ var tool56 = {
4212
+ name: "edit-element-block",
4213
+ 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).",
4214
+ inputSchema: inputSchema56,
4215
+ outputSchema: outputSchema56,
4216
+ slices: ["update"],
4217
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4218
+ handler: async ({ id, propertyAlias, contentKey, values, blockType, culture, segment }) => {
4219
+ const elResult = await chainCms("get-element-by-id", { id });
4220
+ if (!elResult.ok) return elResult.errorResult;
4221
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4222
+ const fieldNames = values.map((v) => v.alias);
4223
+ const resolvedBlockType = blockType ?? "content";
4224
+ let targetKey = contentKey;
4225
+ if (resolvedBlockType === "settings") {
4226
+ const rawValue = (elResult.data.values ?? []).find(
4227
+ (v) => v.alias === propertyAlias && (v.culture ?? null) === (culture ?? null) && (v.segment ?? null) === (segment ?? null)
4228
+ )?.value;
4229
+ const container = isRteWithBlocks(rawValue) ? rawValue.blocks : rawValue;
4230
+ const settingsKey = findSettingsKey(container, contentKey);
4231
+ if (!settingsKey) {
4232
+ return createToolResultError(
4233
+ `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.`
4234
+ );
4235
+ }
4236
+ targetKey = settingsKey;
4237
+ }
4238
+ const propsTuple = values.map((v) => ({ alias: v.alias, value: v.value }));
4239
+ const updateResult = await chainCms("update-element-block-property", {
4240
+ elementId: id,
4241
+ propertyAlias,
4242
+ culture: culture ?? null,
4243
+ segment: segment ?? null,
4244
+ updates: [{
4245
+ contentKey: targetKey,
4246
+ blockType: resolvedBlockType,
4247
+ properties: propsTuple
4248
+ }]
4249
+ });
4250
+ if (!updateResult.ok) return updateResult.errorResult;
4251
+ const results = updateResult.data.results;
4252
+ if (!results || results.length === 0) {
4253
+ return createToolResultError(
4254
+ "update-element-block-property returned no per-block result \u2014 cannot confirm the write succeeded."
4255
+ );
4256
+ }
4257
+ const classification = classifyBlockUpdateResults(results, fieldNames.length, fieldNames, 1);
4258
+ if (classification.outcome === "failed") {
4259
+ return createToolResultError(
4260
+ `Block update failed: ${classification.detail || updateResult.data.message || "no detail returned"}`
4261
+ );
4262
+ }
4263
+ if (classification.outcome === "partial") {
4264
+ return createToolResultError({
4265
+ message: `Block update partially failed: ${classification.processedCount} of ${fieldNames.length} field(s) saved \u2014 ${classification.detail}`,
4266
+ savedFields: classification.savedFields,
4267
+ failedFields: classification.failedFields,
4268
+ ...classification.savedFields.length > 0 ? { note: "savedFields were written to the element and must not be retried." } : {},
4269
+ ...classification.warnings.length ? { warnings: classification.warnings } : {}
4270
+ });
4271
+ }
4272
+ const target = resolvedBlockType === "settings" ? "settings" : "content";
4273
+ const warnings = classification.warnings;
4274
+ return createToolResult({
4275
+ message: `Updated ${fieldNames.length} field(s) in block ${target} on element "${elementName}" (saved, not published)`,
4276
+ id,
4277
+ name: elementName,
4278
+ contentKey,
4279
+ updatedFields: fieldNames,
4280
+ ...warnings.length ? { warnings } : {}
4281
+ });
4282
+ }
4283
+ };
4284
+ var edit_element_block_default = withStandardDecorators(tool56);
4285
+ var inputSchema57 = {
4286
+ id: z.string().uuid().describe("The ID of the element to delete")
4287
+ };
4288
+ var outputSchema57 = z.object({
4289
+ message: z.string(),
4290
+ id: z.string(),
4291
+ name: z.string()
4292
+ });
4293
+ var tool57 = {
4294
+ name: "delete-element",
4295
+ description: "Move a Library element to the recycle bin. It can be restored later. You will be asked to confirm before deleting.",
4296
+ inputSchema: inputSchema57,
4297
+ outputSchema: outputSchema57,
4298
+ slices: ["delete"],
4299
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4300
+ handler: async ({ id }, extra) => {
4301
+ const elResult = await chainCms("get-element-by-id", { id });
4302
+ if (!elResult.ok) return elResult.errorResult;
4303
+ const elementName = elResult.data.variants?.[0]?.name ?? "Unknown";
4304
+ if (!await requestApproval(extra, `WARNING: Move element "${elementName}" to the recycle bin? This will remove it from the Library.`)) {
4305
+ return createToolResult({ message: "Delete cancelled", id, name: elementName });
4306
+ }
4307
+ const deleteResult = await chainCms("move-element-to-recycle-bin", { id });
4308
+ if (!deleteResult.ok) return deleteResult.errorResult;
4309
+ return createToolResult({ message: `Moved element "${elementName}" to the recycle bin`, id, name: elementName });
4310
+ }
4311
+ };
4312
+ var delete_element_default = withStandardDecorators(tool57);
4313
+
4314
+ // src/umbraco-api/tools/element/index.ts
4315
+ var collection6 = {
4316
+ metadata: {
4317
+ name: "element",
4318
+ displayName: "Library Elements",
4319
+ description: "Browse, view, edit (including blocks), publish, and organise reusable Library elements (Umbraco 18 Library section)"
4320
+ },
4321
+ tools: () => [
4322
+ get_element_default,
4323
+ list_element_children_default,
4324
+ search_elements_default,
4325
+ inspect_element_blocks_default,
4326
+ create_element_default,
4327
+ create_and_publish_element_default,
4328
+ create_element_folder_default,
4329
+ edit_element_default,
4330
+ edit_element_block_default,
4331
+ publish_element_default,
4332
+ unpublish_element_default,
4333
+ delete_element_default
4334
+ ]
4335
+ };
4336
+ var element_default = collection6;
4337
+ var inputSchema58 = {
4338
+ parentId: z.string().uuid().optional().describe("The ID of a blueprint folder to list children of. If omitted, lists root-level blueprints."),
4339
+ take: z.number().optional().default(50).describe("Number of results to return"),
4340
+ skip: z.number().optional().default(0).describe("Number of results to skip")
4341
+ };
4342
+ var outputSchema58 = z.object({
4343
+ items: z.array(z.object({
4344
+ id: z.string(),
4345
+ name: z.string(),
4346
+ documentType: z.string().optional().describe("The document type alias or name this blueprint is based on")
4347
+ })).describe("Available page blueprints"),
4348
+ total: z.number()
4349
+ });
4350
+ var tool58 = {
4351
+ name: "list-blueprints",
4352
+ description: "List available page blueprints (templates with pre-filled content). Use get-blueprint to view a blueprint's details and property values.",
4353
+ inputSchema: inputSchema58,
4354
+ outputSchema: outputSchema58,
3823
4355
  slices: ["list"],
3824
4356
  annotations: { readOnlyHint: true },
3825
4357
  handler: async ({ parentId, take, skip }) => {
@@ -3845,11 +4377,11 @@ var tool46 = {
3845
4377
  });
3846
4378
  }
3847
4379
  };
3848
- var list_blueprints_default = withStandardDecorators(tool46);
3849
- var inputSchema47 = {
4380
+ var list_blueprints_default = withStandardDecorators(tool58);
4381
+ var inputSchema59 = {
3850
4382
  id: z.string().uuid().describe("The ID of the blueprint to retrieve")
3851
4383
  };
3852
- var outputSchema47 = z.object({
4384
+ var outputSchema59 = z.object({
3853
4385
  id: z.string(),
3854
4386
  name: z.string(),
3855
4387
  documentType: z.object({
@@ -3869,11 +4401,11 @@ var outputSchema47 = z.object({
3869
4401
  segment: z.string().nullable().optional()
3870
4402
  })).optional().describe("Variant information")
3871
4403
  });
3872
- var tool47 = {
4404
+ var tool59 = {
3873
4405
  name: "get-blueprint",
3874
4406
  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.",
3875
- inputSchema: inputSchema47,
3876
- outputSchema: outputSchema47,
4407
+ inputSchema: inputSchema59,
4408
+ outputSchema: outputSchema59,
3877
4409
  slices: ["read"],
3878
4410
  annotations: { readOnlyHint: true },
3879
4411
  handler: async ({ id }) => {
@@ -3896,21 +4428,21 @@ var tool47 = {
3896
4428
  });
3897
4429
  }
3898
4430
  };
3899
- var get_blueprint_default = withStandardDecorators(tool47);
3900
- var inputSchema48 = {
4431
+ var get_blueprint_default = withStandardDecorators(tool59);
4432
+ var inputSchema60 = {
3901
4433
  pageId: z.string().uuid().describe("The ID of the source page to save as a blueprint"),
3902
4434
  name: z.string().describe("The name for the new blueprint")
3903
4435
  };
3904
- var outputSchema48 = z.object({
4436
+ var outputSchema60 = z.object({
3905
4437
  message: z.string(),
3906
4438
  id: z.string(),
3907
4439
  name: z.string()
3908
4440
  });
3909
- var tool48 = {
4441
+ var tool60 = {
3910
4442
  name: "create-blueprint",
3911
4443
  description: "Save an existing page as a reusable blueprint (template). The blueprint preserves the page's document type and property values.",
3912
- inputSchema: inputSchema48,
3913
- outputSchema: outputSchema48,
4444
+ inputSchema: inputSchema60,
4445
+ outputSchema: outputSchema60,
3914
4446
  slices: ["create"],
3915
4447
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
3916
4448
  handler: async ({ pageId, name }) => {
@@ -3942,10 +4474,10 @@ var tool48 = {
3942
4474
  });
3943
4475
  }
3944
4476
  };
3945
- var create_blueprint_default = withStandardDecorators(tool48);
4477
+ var create_blueprint_default = withStandardDecorators(tool60);
3946
4478
 
3947
4479
  // src/umbraco-api/tools/blueprint/index.ts
3948
- var collection6 = {
4480
+ var collection7 = {
3949
4481
  metadata: {
3950
4482
  name: "blueprint",
3951
4483
  displayName: "Blueprints",
@@ -3953,12 +4485,12 @@ var collection6 = {
3953
4485
  },
3954
4486
  tools: () => [list_blueprints_default, get_blueprint_default, create_blueprint_default]
3955
4487
  };
3956
- var blueprint_default = collection6;
3957
- var inputSchema49 = {
4488
+ var blueprint_default = collection7;
4489
+ var inputSchema61 = {
3958
4490
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
3959
4491
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
3960
4492
  };
3961
- var outputSchema49 = z.object({
4493
+ var outputSchema61 = z.object({
3962
4494
  items: z.array(z.object({
3963
4495
  isoCode: z.string().describe("ISO language code (e.g. en-US)"),
3964
4496
  name: z.string().describe("Display name of the language"),
@@ -3967,11 +4499,11 @@ var outputSchema49 = z.object({
3967
4499
  })).describe("List of configured languages"),
3968
4500
  total: z.number().describe("Total number of languages")
3969
4501
  });
3970
- var tool49 = {
4502
+ var tool61 = {
3971
4503
  name: "list-languages",
3972
4504
  description: "List all languages configured on the Umbraco site. Shows the ISO code, name, and whether each language is the default or mandatory.",
3973
- inputSchema: inputSchema49,
3974
- outputSchema: outputSchema49,
4505
+ inputSchema: inputSchema61,
4506
+ outputSchema: outputSchema61,
3975
4507
  slices: ["list"],
3976
4508
  annotations: { readOnlyHint: true },
3977
4509
  handler: async ({ take, skip }) => {
@@ -3989,22 +4521,22 @@ var tool49 = {
3989
4521
  });
3990
4522
  }
3991
4523
  };
3992
- var list_languages_default = withStandardDecorators(tool49);
3993
- var inputSchema50 = {
4524
+ var list_languages_default = withStandardDecorators(tool61);
4525
+ var inputSchema62 = {
3994
4526
  isoCode: z.string().describe("ISO language code (e.g. en-US)")
3995
4527
  };
3996
- var outputSchema50 = z.object({
4528
+ var outputSchema62 = z.object({
3997
4529
  isoCode: z.string().describe("ISO language code"),
3998
4530
  name: z.string().describe("Display name of the language"),
3999
4531
  isDefault: z.boolean().describe("Whether this is the default language"),
4000
4532
  isMandatory: z.boolean().describe("Whether this language is mandatory"),
4001
4533
  fallbackIsoCode: z.string().nullable().describe("ISO code of the fallback language, if set")
4002
4534
  });
4003
- var tool50 = {
4535
+ var tool62 = {
4004
4536
  name: "get-language",
4005
4537
  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.",
4006
- inputSchema: inputSchema50,
4007
- outputSchema: outputSchema50,
4538
+ inputSchema: inputSchema62,
4539
+ outputSchema: outputSchema62,
4008
4540
  slices: ["read"],
4009
4541
  annotations: { readOnlyHint: true },
4010
4542
  handler: async ({ isoCode }) => {
@@ -4020,24 +4552,24 @@ var tool50 = {
4020
4552
  });
4021
4553
  }
4022
4554
  };
4023
- var get_language_default = withStandardDecorators(tool50);
4024
- var inputSchema51 = {
4555
+ var get_language_default = withStandardDecorators(tool62);
4556
+ var inputSchema63 = {
4025
4557
  isoCode: z.string().describe("ISO language code to add (e.g. fr-FR)"),
4026
4558
  name: z.string().optional().describe("Display name for the language (e.g. 'French'). Defaults to the ISO code if not provided."),
4027
4559
  isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4028
4560
  isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4029
4561
  fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4030
4562
  };
4031
- var outputSchema51 = z.object({
4563
+ var outputSchema63 = z.object({
4032
4564
  message: z.string(),
4033
4565
  isoCode: z.string(),
4034
4566
  name: z.string()
4035
4567
  });
4036
- var tool51 = {
4568
+ var tool63 = {
4037
4569
  name: "create-language",
4038
4570
  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.",
4039
- inputSchema: inputSchema51,
4040
- outputSchema: outputSchema51,
4571
+ inputSchema: inputSchema63,
4572
+ outputSchema: outputSchema63,
4041
4573
  slices: ["create"],
4042
4574
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4043
4575
  handler: async ({ isoCode, name: displayName, isDefault, isMandatory, fallbackIsoCode }) => {
@@ -4057,23 +4589,23 @@ var tool51 = {
4057
4589
  });
4058
4590
  }
4059
4591
  };
4060
- var create_language_default = withStandardDecorators(tool51);
4061
- var inputSchema52 = {
4592
+ var create_language_default = withStandardDecorators(tool63);
4593
+ var inputSchema64 = {
4062
4594
  isoCode: z.string().describe("ISO language code of the language to update (e.g. en-US)"),
4063
4595
  isDefault: z.boolean().optional().describe("Whether this language should be the default"),
4064
4596
  isMandatory: z.boolean().optional().describe("Whether this language should be mandatory"),
4065
4597
  fallbackIsoCode: z.string().optional().describe("ISO code of the fallback language")
4066
4598
  };
4067
- var outputSchema52 = z.object({
4599
+ var outputSchema64 = z.object({
4068
4600
  message: z.string(),
4069
4601
  isoCode: z.string(),
4070
4602
  name: z.string()
4071
4603
  });
4072
- var tool52 = {
4604
+ var tool64 = {
4073
4605
  name: "update-language",
4074
4606
  description: "Update a language's settings (default, mandatory, fallback).",
4075
- inputSchema: inputSchema52,
4076
- outputSchema: outputSchema52,
4607
+ inputSchema: inputSchema64,
4608
+ outputSchema: outputSchema64,
4077
4609
  slices: ["update"],
4078
4610
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4079
4611
  handler: async ({ isoCode, isDefault, isMandatory, fallbackIsoCode }) => {
@@ -4098,20 +4630,20 @@ var tool52 = {
4098
4630
  });
4099
4631
  }
4100
4632
  };
4101
- var update_language_default = withStandardDecorators(tool52);
4102
- var inputSchema53 = {
4633
+ var update_language_default = withStandardDecorators(tool64);
4634
+ var inputSchema65 = {
4103
4635
  isoCode: z.string().describe("ISO language code of the language to delete (e.g. fr-FR)")
4104
4636
  };
4105
- var outputSchema53 = z.object({
4637
+ var outputSchema65 = z.object({
4106
4638
  message: z.string(),
4107
4639
  isoCode: z.string(),
4108
4640
  name: z.string()
4109
4641
  });
4110
- var tool53 = {
4642
+ var tool65 = {
4111
4643
  name: "delete-language",
4112
4644
  description: "Remove a language from the site. Content variants in this language will become inaccessible. You will be asked to confirm before deleting.",
4113
- inputSchema: inputSchema53,
4114
- outputSchema: outputSchema53,
4645
+ inputSchema: inputSchema65,
4646
+ outputSchema: outputSchema65,
4115
4647
  slices: ["delete"],
4116
4648
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4117
4649
  handler: async ({ isoCode }, extra) => {
@@ -4132,10 +4664,10 @@ var tool53 = {
4132
4664
  });
4133
4665
  }
4134
4666
  };
4135
- var delete_language_default = withStandardDecorators(tool53);
4667
+ var delete_language_default = withStandardDecorators(tool65);
4136
4668
 
4137
4669
  // src/umbraco-api/tools/language/index.ts
4138
- var collection7 = {
4670
+ var collection8 = {
4139
4671
  metadata: {
4140
4672
  name: "language",
4141
4673
  displayName: "Languages",
@@ -4143,7 +4675,7 @@ var collection7 = {
4143
4675
  },
4144
4676
  tools: () => [list_languages_default, get_language_default, create_language_default, update_language_default, delete_language_default]
4145
4677
  };
4146
- var language_default = collection7;
4678
+ var language_default = collection8;
4147
4679
  async function checkVariesByCulture(documentId) {
4148
4680
  const docResult = await chainCms("get-document-by-id", { id: documentId });
4149
4681
  if (!docResult.ok) return docResult.errorResult;
@@ -4163,7 +4695,7 @@ async function checkVariesByCulture(documentId) {
4163
4695
  }
4164
4696
 
4165
4697
  // src/umbraco-api/tools/translation/post/create-variant.ts
4166
- var inputSchema54 = {
4698
+ var inputSchema66 = {
4167
4699
  id: z.string().uuid().describe("The ID of the page to add a language variant to"),
4168
4700
  culture: z.string().describe("The target language ISO code (e.g. 'da-DK', 'fr-FR'). Call list-languages to find available cultures."),
4169
4701
  values: z.array(z.object({
@@ -4173,7 +4705,7 @@ var inputSchema54 = {
4173
4705
  segment: z.string().nullable().optional().describe("The segment for segmented content")
4174
4706
  })).optional().describe("Optional property values to set on the new variant")
4175
4707
  };
4176
- var outputSchema54 = z.object({
4708
+ var outputSchema66 = z.object({
4177
4709
  message: z.string(),
4178
4710
  id: z.string(),
4179
4711
  name: z.string(),
@@ -4181,11 +4713,11 @@ var outputSchema54 = z.object({
4181
4713
  previewUrl: previewUrlSchema,
4182
4714
  validation: validationResultSchema
4183
4715
  });
4184
- var tool54 = {
4716
+ var tool66 = {
4185
4717
  name: "create-variant",
4186
4718
  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.",
4187
- inputSchema: inputSchema54,
4188
- outputSchema: outputSchema54,
4719
+ inputSchema: inputSchema66,
4720
+ outputSchema: outputSchema66,
4189
4721
  slices: ["create"],
4190
4722
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4191
4723
  handler: async ({ id, culture, values }) => {
@@ -4229,13 +4761,13 @@ var tool54 = {
4229
4761
  });
4230
4762
  }
4231
4763
  };
4232
- var create_variant_default = withStandardDecorators(tool54);
4233
- var inputSchema55 = {
4764
+ var create_variant_default = withStandardDecorators(tool66);
4765
+ var inputSchema67 = {
4234
4766
  id: z.string().uuid().describe("The ID of the page to copy a variant on"),
4235
4767
  sourceCulture: z.string().describe("The source language ISO code to copy content from (e.g. 'en-US')"),
4236
4768
  targetCulture: z.string().describe("The target language ISO code to copy content to (e.g. 'da-DK')")
4237
4769
  };
4238
- var outputSchema55 = z.object({
4770
+ var outputSchema67 = z.object({
4239
4771
  message: z.string(),
4240
4772
  id: z.string(),
4241
4773
  name: z.string(),
@@ -4245,11 +4777,11 @@ var outputSchema55 = z.object({
4245
4777
  previewUrl: previewUrlSchema,
4246
4778
  validation: validationResultSchema
4247
4779
  });
4248
- var tool55 = {
4780
+ var tool67 = {
4249
4781
  name: "copy-variant",
4250
4782
  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.",
4251
- inputSchema: inputSchema55,
4252
- outputSchema: outputSchema55,
4783
+ inputSchema: inputSchema67,
4784
+ outputSchema: outputSchema67,
4253
4785
  slices: ["create"],
4254
4786
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
4255
4787
  handler: async ({ id, sourceCulture, targetCulture }, extra) => {
@@ -4303,14 +4835,14 @@ var tool55 = {
4303
4835
  });
4304
4836
  }
4305
4837
  };
4306
- var copy_variant_default = withStandardDecorators(tool55);
4307
- var inputSchema56 = {
4838
+ var copy_variant_default = withStandardDecorators(tool67);
4839
+ var inputSchema68 = {
4308
4840
  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."),
4309
4841
  parentId: z.string().uuid().optional().describe("Parent page ID to search under. Omit to search root-level pages."),
4310
4842
  take: z.number().optional().default(20).describe("Number of results to return"),
4311
4843
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4312
4844
  };
4313
- var outputSchema56 = z.object({
4845
+ var outputSchema68 = z.object({
4314
4846
  items: z.array(z.object({
4315
4847
  id: z.string(),
4316
4848
  name: z.string(),
@@ -4318,11 +4850,11 @@ var outputSchema56 = z.object({
4318
4850
  })).describe("Pages that are missing the specified language variant"),
4319
4851
  total: z.number().describe("Total number of pages missing the variant (before pagination)")
4320
4852
  });
4321
- var tool56 = {
4853
+ var tool68 = {
4322
4854
  name: "list-untranslated",
4323
4855
  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.",
4324
- inputSchema: inputSchema56,
4325
- outputSchema: outputSchema56,
4856
+ inputSchema: inputSchema68,
4857
+ outputSchema: outputSchema68,
4326
4858
  slices: ["search"],
4327
4859
  annotations: { readOnlyHint: true },
4328
4860
  handler: async ({ culture, parentId, take, skip }) => {
@@ -4355,10 +4887,10 @@ var tool56 = {
4355
4887
  return createToolResult({ items: paged, total });
4356
4888
  }
4357
4889
  };
4358
- var list_untranslated_default = withStandardDecorators(tool56);
4890
+ var list_untranslated_default = withStandardDecorators(tool68);
4359
4891
 
4360
4892
  // src/umbraco-api/tools/translation/index.ts
4361
- var collection8 = {
4893
+ var collection9 = {
4362
4894
  metadata: {
4363
4895
  name: "translation",
4364
4896
  displayName: "Translation",
@@ -4366,13 +4898,13 @@ var collection8 = {
4366
4898
  },
4367
4899
  tools: () => [create_variant_default, copy_variant_default, list_untranslated_default]
4368
4900
  };
4369
- var translation_default = collection8;
4370
- var inputSchema57 = {
4901
+ var translation_default = collection9;
4902
+ var inputSchema69 = {
4371
4903
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to list root-level entries"),
4372
4904
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
4373
4905
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
4374
4906
  };
4375
- var outputSchema57 = z.object({
4907
+ var outputSchema69 = z.object({
4376
4908
  items: z.array(
4377
4909
  z.object({
4378
4910
  id: z.string(),
@@ -4382,11 +4914,11 @@ var outputSchema57 = z.object({
4382
4914
  ).describe("Dictionary items"),
4383
4915
  total: z.number().describe("Total number of items")
4384
4916
  });
4385
- var tool57 = {
4917
+ var tool69 = {
4386
4918
  name: "list-dictionary",
4387
4919
  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.",
4388
- inputSchema: inputSchema57,
4389
- outputSchema: outputSchema57,
4920
+ inputSchema: inputSchema69,
4921
+ outputSchema: outputSchema69,
4390
4922
  slices: ["list", "tree"],
4391
4923
  annotations: { readOnlyHint: true },
4392
4924
  handler: async ({ parentId, take, skip }) => {
@@ -4412,11 +4944,11 @@ var tool57 = {
4412
4944
  });
4413
4945
  }
4414
4946
  };
4415
- var list_dictionary_default = withStandardDecorators(tool57);
4416
- var inputSchema58 = {
4947
+ var list_dictionary_default = withStandardDecorators(tool69);
4948
+ var inputSchema70 = {
4417
4949
  query: z.string().describe("Search term to match against dictionary item key names")
4418
4950
  };
4419
- var outputSchema58 = z.object({
4951
+ var outputSchema70 = z.object({
4420
4952
  items: z.array(
4421
4953
  z.object({
4422
4954
  id: z.string(),
@@ -4425,11 +4957,11 @@ var outputSchema58 = z.object({
4425
4957
  ).describe("Matching dictionary items"),
4426
4958
  total: z.number().describe("Total number of matching items")
4427
4959
  });
4428
- var tool58 = {
4960
+ var tool70 = {
4429
4961
  name: "search-dictionary",
4430
4962
  description: "Search for dictionary items by key name. Use get-dictionary to see all translations for a specific item.",
4431
- inputSchema: inputSchema58,
4432
- outputSchema: outputSchema58,
4963
+ inputSchema: inputSchema70,
4964
+ outputSchema: outputSchema70,
4433
4965
  slices: ["search"],
4434
4966
  annotations: { readOnlyHint: true },
4435
4967
  handler: async ({ query }) => {
@@ -4444,11 +4976,11 @@ var tool58 = {
4444
4976
  });
4445
4977
  }
4446
4978
  };
4447
- var search_dictionary_default = withStandardDecorators(tool58);
4448
- var inputSchema59 = {
4979
+ var search_dictionary_default = withStandardDecorators(tool70);
4980
+ var inputSchema71 = {
4449
4981
  id: z.string().uuid().describe("UUID of the dictionary item to retrieve")
4450
4982
  };
4451
- var outputSchema59 = z.object({
4983
+ var outputSchema71 = z.object({
4452
4984
  id: z.string(),
4453
4985
  name: z.string(),
4454
4986
  translations: z.array(
@@ -4459,11 +4991,11 @@ var outputSchema59 = z.object({
4459
4991
  })
4460
4992
  ).describe("All translations for this dictionary item")
4461
4993
  });
4462
- var tool59 = {
4994
+ var tool71 = {
4463
4995
  name: "get-dictionary",
4464
4996
  description: "Get a dictionary item with all its translations across languages. Shows the key name and each language's translation value.",
4465
- inputSchema: inputSchema59,
4466
- outputSchema: outputSchema59,
4997
+ inputSchema: inputSchema71,
4998
+ outputSchema: outputSchema71,
4467
4999
  slices: ["read"],
4468
5000
  annotations: { readOnlyHint: true },
4469
5001
  handler: async ({ id }) => {
@@ -4485,8 +5017,8 @@ var tool59 = {
4485
5017
  });
4486
5018
  }
4487
5019
  };
4488
- var get_dictionary_default = withStandardDecorators(tool59);
4489
- var inputSchema60 = {
5020
+ var get_dictionary_default = withStandardDecorators(tool71);
5021
+ var inputSchema72 = {
4490
5022
  name: z.string().describe("The dictionary key name"),
4491
5023
  translations: z.array(
4492
5024
  z.object({
@@ -4496,16 +5028,16 @@ var inputSchema60 = {
4496
5028
  ).describe("Translations to set for this dictionary item"),
4497
5029
  parentId: z.string().uuid().optional().describe("UUID of the parent dictionary item, or omit to create at the root")
4498
5030
  };
4499
- var outputSchema60 = z.object({
5031
+ var outputSchema72 = z.object({
4500
5032
  message: z.string(),
4501
5033
  id: z.string(),
4502
5034
  name: z.string()
4503
5035
  });
4504
- var tool60 = {
5036
+ var tool72 = {
4505
5037
  name: "create-dictionary",
4506
5038
  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.",
4507
- inputSchema: inputSchema60,
4508
- outputSchema: outputSchema60,
5039
+ inputSchema: inputSchema72,
5040
+ outputSchema: outputSchema72,
4509
5041
  slices: ["create"],
4510
5042
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
4511
5043
  handler: async ({ name, translations, parentId }) => {
@@ -4522,8 +5054,8 @@ var tool60 = {
4522
5054
  });
4523
5055
  }
4524
5056
  };
4525
- var create_dictionary_default = withStandardDecorators(tool60);
4526
- var inputSchema61 = {
5057
+ var create_dictionary_default = withStandardDecorators(tool72);
5058
+ var inputSchema73 = {
4527
5059
  id: z.string().uuid().describe("UUID of the dictionary item to update"),
4528
5060
  translations: z.array(
4529
5061
  z.object({
@@ -4532,17 +5064,17 @@ var inputSchema61 = {
4532
5064
  })
4533
5065
  ).describe("Translations to update. Languages not listed here will keep their existing translations.")
4534
5066
  };
4535
- var outputSchema61 = z.object({
5067
+ var outputSchema73 = z.object({
4536
5068
  message: z.string(),
4537
5069
  id: z.string(),
4538
5070
  name: z.string(),
4539
5071
  updatedLanguages: z.array(z.string()).describe("ISO codes of languages that were updated")
4540
5072
  });
4541
- var tool61 = {
5073
+ var tool73 = {
4542
5074
  name: "update-dictionary",
4543
5075
  description: "Update translations for a dictionary item. Call get-dictionary first to see existing translations.",
4544
- inputSchema: inputSchema61,
4545
- outputSchema: outputSchema61,
5076
+ inputSchema: inputSchema73,
5077
+ outputSchema: outputSchema73,
4546
5078
  slices: ["update"],
4547
5079
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4548
5080
  handler: async ({ id, translations }) => {
@@ -4574,21 +5106,21 @@ var tool61 = {
4574
5106
  });
4575
5107
  }
4576
5108
  };
4577
- var update_dictionary_default = withStandardDecorators(tool61);
4578
- var inputSchema62 = {
5109
+ var update_dictionary_default = withStandardDecorators(tool73);
5110
+ var inputSchema74 = {
4579
5111
  id: z.string().uuid().describe("UUID of the dictionary item to move"),
4580
5112
  targetParentId: z.string().uuid().optional().describe("UUID of the destination parent dictionary item, or omit to move to the root")
4581
5113
  };
4582
- var outputSchema62 = z.object({
5114
+ var outputSchema74 = z.object({
4583
5115
  message: z.string(),
4584
5116
  id: z.string(),
4585
5117
  name: z.string()
4586
5118
  });
4587
- var tool62 = {
5119
+ var tool74 = {
4588
5120
  name: "move-dictionary",
4589
5121
  description: "Move a dictionary item to a different parent in the dictionary tree, or to the root. You will be asked to confirm.",
4590
- inputSchema: inputSchema62,
4591
- outputSchema: outputSchema62,
5122
+ inputSchema: inputSchema74,
5123
+ outputSchema: outputSchema74,
4592
5124
  slices: ["move"],
4593
5125
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
4594
5126
  handler: async ({ id, targetParentId }, extra) => {
@@ -4619,10 +5151,10 @@ var tool62 = {
4619
5151
  });
4620
5152
  }
4621
5153
  };
4622
- var move_dictionary_default = withStandardDecorators(tool62);
5154
+ var move_dictionary_default = withStandardDecorators(tool74);
4623
5155
 
4624
5156
  // src/umbraco-api/tools/dictionary/index.ts
4625
- var collection9 = {
5157
+ var collection10 = {
4626
5158
  metadata: {
4627
5159
  name: "dictionary",
4628
5160
  displayName: "Dictionary",
@@ -4630,13 +5162,13 @@ var collection9 = {
4630
5162
  },
4631
5163
  tools: () => [list_dictionary_default, search_dictionary_default, get_dictionary_default, create_dictionary_default, update_dictionary_default, move_dictionary_default]
4632
5164
  };
4633
- var dictionary_default = collection9;
4634
- var inputSchema63 = {
5165
+ var dictionary_default = collection10;
5166
+ var inputSchema75 = {
4635
5167
  tagGroup: z.string().optional().describe("Filter tags by group name, or omit to list all tags"),
4636
5168
  take: z.number().optional().default(50).describe("Number of tags to return"),
4637
5169
  skip: z.number().optional().default(0).describe("Number of tags to skip for pagination")
4638
5170
  };
4639
- var outputSchema63 = z.object({
5171
+ var outputSchema75 = z.object({
4640
5172
  items: z.array(
4641
5173
  z.object({
4642
5174
  id: z.number(),
@@ -4647,11 +5179,11 @@ var outputSchema63 = z.object({
4647
5179
  ).describe("Tags in use across the site"),
4648
5180
  total: z.number().describe("Total number of tags")
4649
5181
  });
4650
- var tool63 = {
5182
+ var tool75 = {
4651
5183
  name: "list-tags",
4652
5184
  description: "List tags in use across the site. Optionally filter by tag group. Shows how many content items use each tag.",
4653
- inputSchema: inputSchema63,
4654
- outputSchema: outputSchema63,
5185
+ inputSchema: inputSchema75,
5186
+ outputSchema: outputSchema75,
4655
5187
  slices: ["list"],
4656
5188
  annotations: { readOnlyHint: true },
4657
5189
  handler: async ({ tagGroup, take, skip }) => {
@@ -4668,10 +5200,10 @@ var tool63 = {
4668
5200
  });
4669
5201
  }
4670
5202
  };
4671
- var list_tags_default = withStandardDecorators(tool63);
5203
+ var list_tags_default = withStandardDecorators(tool75);
4672
5204
 
4673
5205
  // src/umbraco-api/tools/tag/index.ts
4674
- var collection10 = {
5206
+ var collection11 = {
4675
5207
  metadata: {
4676
5208
  name: "tag",
4677
5209
  displayName: "Tags",
@@ -4679,13 +5211,13 @@ var collection10 = {
4679
5211
  },
4680
5212
  tools: () => [list_tags_default]
4681
5213
  };
4682
- var tag_default = collection10;
5214
+ var tag_default = collection11;
4683
5215
  var TITLE_ALIASES = ["pageTitle", "title", "metaTitle", "seoTitle"];
4684
5216
  var META_DESC_ALIASES = ["metaDescription", "seoMetaDescription", "description"];
4685
- var inputSchema64 = {
5217
+ var inputSchema76 = {
4686
5218
  id: z.string().uuid().describe("The ID of the content page to audit")
4687
5219
  };
4688
- var outputSchema64 = z.object({
5220
+ var outputSchema76 = z.object({
4689
5221
  id: z.string().describe("Page ID"),
4690
5222
  name: z.string().describe("Page name"),
4691
5223
  url: z.string().describe("Page URL"),
@@ -4702,11 +5234,11 @@ var outputSchema64 = z.object({
4702
5234
  headings: z.array(z.object({ level: z.number(), text: z.string() })).describe("Headings found in body content"),
4703
5235
  images: z.array(z.object({ src: z.string(), alt: z.string(), hasAlt: z.boolean() })).describe("Images found in body content with alt text status")
4704
5236
  });
4705
- var tool64 = {
5237
+ var tool76 = {
4706
5238
  name: "audit-page-seo",
4707
5239
  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.",
4708
- inputSchema: inputSchema64,
4709
- outputSchema: outputSchema64,
5240
+ inputSchema: inputSchema76,
5241
+ outputSchema: outputSchema76,
4710
5242
  slices: ["read"],
4711
5243
  annotations: { readOnlyHint: true },
4712
5244
  handler: async ({ id }) => {
@@ -4730,11 +5262,11 @@ var tool64 = {
4730
5262
  const headings = extractHeadings(allHtml);
4731
5263
  const images = extractImages(allHtml);
4732
5264
  const bodyWordCount = countWords(extractTextContent(values));
4733
- const extra = doc;
5265
+ const url = await fetchPrimaryPublishedUrl(id);
4734
5266
  return createToolResult({
4735
5267
  id: doc.id,
4736
5268
  name: variant?.name ?? "Unknown",
4737
- url: extra.urls?.[0]?.url ?? "",
5269
+ url,
4738
5270
  hasTitle: title.length > 0,
4739
5271
  hasMetaDescription: metaDescription.length > 0,
4740
5272
  titleLength: title.length,
@@ -4750,13 +5282,13 @@ var tool64 = {
4750
5282
  });
4751
5283
  }
4752
5284
  };
4753
- var audit_page_seo_default = withStandardDecorators(tool64);
5285
+ var audit_page_seo_default = withStandardDecorators(tool76);
4754
5286
  var META_DESC_ALIASES2 = ["metaDescription", "seoMetaDescription", "description"];
4755
5287
  var BODY_CONTENT_MAX = 2e3;
4756
- var inputSchema65 = {
5288
+ var inputSchema77 = {
4757
5289
  id: z.string().uuid().describe("The ID of the content page to audit")
4758
5290
  };
4759
- var outputSchema65 = z.object({
5291
+ var outputSchema77 = z.object({
4760
5292
  id: z.string().describe("Page ID"),
4761
5293
  name: z.string().describe("Page name"),
4762
5294
  url: z.string().describe("Page URL"),
@@ -4767,11 +5299,11 @@ var outputSchema65 = z.object({
4767
5299
  documentType: z.string().describe("The document type name"),
4768
5300
  lastModified: z.string().describe("ISO date string of last modification")
4769
5301
  });
4770
- var tool65 = {
5302
+ var tool77 = {
4771
5303
  name: "audit-page-content",
4772
5304
  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.",
4773
- inputSchema: inputSchema65,
4774
- outputSchema: outputSchema65,
5305
+ inputSchema: inputSchema77,
5306
+ outputSchema: outputSchema77,
4775
5307
  slices: ["read"],
4776
5308
  annotations: { readOnlyHint: true },
4777
5309
  handler: async ({ id }) => {
@@ -4793,12 +5325,12 @@ var tool65 = {
4793
5325
  const fullBodyText = extractTextContent(values);
4794
5326
  const bodyContent = fullBodyText.slice(0, BODY_CONTENT_MAX);
4795
5327
  const wordCount = fullBodyText ? fullBodyText.split(/\s+/).filter(Boolean).length : 0;
4796
- const extra = doc;
4797
5328
  const dt = doc.documentType;
5329
+ const url = await fetchPrimaryPublishedUrl(id);
4798
5330
  return createToolResult({
4799
5331
  id: doc.id,
4800
5332
  name: variant?.name ?? "Unknown",
4801
- url: extra.urls?.[0]?.url ?? "",
5333
+ url,
4802
5334
  hasMetaDescription: metaDescription.length > 0,
4803
5335
  bodyWordCount: wordCount,
4804
5336
  metaDescription,
@@ -4808,10 +5340,10 @@ var tool65 = {
4808
5340
  });
4809
5341
  }
4810
5342
  };
4811
- var audit_page_content_default = withStandardDecorators(tool65);
5343
+ var audit_page_content_default = withStandardDecorators(tool77);
4812
5344
 
4813
5345
  // src/umbraco-api/tools/content-health/index.ts
4814
- var collection11 = {
5346
+ var collection12 = {
4815
5347
  metadata: {
4816
5348
  name: "content-health",
4817
5349
  displayName: "Content Health",
@@ -4819,8 +5351,8 @@ var collection11 = {
4819
5351
  },
4820
5352
  tools: () => [audit_page_seo_default, audit_page_content_default]
4821
5353
  };
4822
- var content_health_default = collection11;
4823
- var inputSchema66 = {
5354
+ var content_health_default = collection12;
5355
+ var inputSchema78 = {
4824
5356
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
4825
5357
  maxDepth: z.number().optional().default(5).describe("How many levels deep to scan (default 5)")
4826
5358
  };
@@ -4835,7 +5367,7 @@ var treeNodeSchema = z.lazy(
4835
5367
  children: z.array(treeNodeSchema)
4836
5368
  })
4837
5369
  );
4838
- var outputSchema66 = z.object({
5370
+ var outputSchema78 = z.object({
4839
5371
  tree: z.array(treeNodeSchema).describe("Hierarchical site tree with children nested inside each node"),
4840
5372
  totalPages: z.number().describe("Total number of pages found across all levels"),
4841
5373
  maxDepthFound: z.number().describe("The deepest level actually found during the scan"),
@@ -4849,6 +5381,9 @@ async function fetchTreeLevel(parentId, depth) {
4849
5381
  }
4850
5382
  async function buildTreeNodes(parentId, depth, maxDepth, pagesPerLevel, totalRef, maxDepthRef) {
4851
5383
  const items = await fetchTreeLevel(parentId);
5384
+ const urlsById = await fetchPrimaryPublishedUrlsBatch(
5385
+ items.map((item) => item.id).filter((id) => typeof id === "string")
5386
+ );
4852
5387
  const nodes = [];
4853
5388
  for (const item of items) {
4854
5389
  totalRef.count++;
@@ -4864,7 +5399,7 @@ async function buildTreeNodes(parentId, depth, maxDepth, pagesPerLevel, totalRef
4864
5399
  nodes.push({
4865
5400
  id: item.id ?? "",
4866
5401
  name: item.name ?? item.variants?.[0]?.name ?? "Unknown",
4867
- url: item.url ?? item.urls?.[0]?.url ?? "",
5402
+ url: urlsById.get(item.id) ?? "",
4868
5403
  documentType: item.documentType?.name ?? item.contentTypeName ?? "",
4869
5404
  depth,
4870
5405
  childCount: children.length,
@@ -4873,11 +5408,11 @@ async function buildTreeNodes(parentId, depth, maxDepth, pagesPerLevel, totalRef
4873
5408
  }
4874
5409
  return nodes;
4875
5410
  }
4876
- var tool66 = {
5411
+ var tool78 = {
4877
5412
  name: "report-site-tree-summary",
4878
5413
  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.",
4879
- inputSchema: inputSchema66,
4880
- outputSchema: outputSchema66,
5414
+ inputSchema: inputSchema78,
5415
+ outputSchema: outputSchema78,
4881
5416
  slices: ["read"],
4882
5417
  annotations: { readOnlyHint: true },
4883
5418
  handler: async ({ parentId, maxDepth }) => {
@@ -4894,14 +5429,14 @@ var tool66 = {
4894
5429
  });
4895
5430
  }
4896
5431
  };
4897
- var report_site_tree_summary_default = withStandardDecorators(tool66);
4898
- var inputSchema67 = {
5432
+ var report_site_tree_summary_default = withStandardDecorators(tool78);
5433
+ var inputSchema79 = {
4899
5434
  depthThreshold: z.number().optional().default(4).describe("Pages deeper than this level are reported (default 4)"),
4900
5435
  parentId: z.string().uuid().optional().describe("Scope to a subtree by parent page ID. Omit to start from root."),
4901
5436
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
4902
5437
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
4903
5438
  };
4904
- var outputSchema67 = z.object({
5439
+ var outputSchema79 = z.object({
4905
5440
  items: z.array(
4906
5441
  z.object({
4907
5442
  id: z.string(),
@@ -4916,11 +5451,11 @@ var outputSchema67 = z.object({
4916
5451
  scannedPages: z.number().describe("Total number of pages scanned during the walk"),
4917
5452
  threshold: z.number().describe("The depth threshold used for this scan")
4918
5453
  });
4919
- var tool67 = {
5454
+ var tool79 = {
4920
5455
  name: "report-deep-pages",
4921
5456
  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.",
4922
- inputSchema: inputSchema67,
4923
- outputSchema: outputSchema67,
5457
+ inputSchema: inputSchema79,
5458
+ outputSchema: outputSchema79,
4924
5459
  slices: ["read"],
4925
5460
  annotations: { readOnlyHint: true },
4926
5461
  handler: async ({ depthThreshold, parentId, take, skip }) => {
@@ -4932,6 +5467,9 @@ var tool67 = {
4932
5467
  if (!result.ok) return;
4933
5468
  const data = result.data;
4934
5469
  const items = data?.items ?? [];
5470
+ const urlsById = await fetchPrimaryPublishedUrlsBatch(
5471
+ items.map((item) => item.id).filter((id) => typeof id === "string")
5472
+ );
4935
5473
  for (const item of items) {
4936
5474
  if (scannedRef.count >= 500) break;
4937
5475
  scannedRef.count++;
@@ -4940,7 +5478,7 @@ var tool67 = {
4940
5478
  allPages.push({
4941
5479
  id: item.id ?? "",
4942
5480
  name,
4943
- url: item.url ?? item.urls?.[0]?.url ?? "",
5481
+ url: urlsById.get(item.id) ?? "",
4944
5482
  documentType: item.documentType?.name ?? item.contentTypeName ?? "",
4945
5483
  depth,
4946
5484
  rawDepth: depth,
@@ -4964,10 +5502,10 @@ var tool67 = {
4964
5502
  });
4965
5503
  }
4966
5504
  };
4967
- var report_deep_pages_default = withStandardDecorators(tool67);
5505
+ var report_deep_pages_default = withStandardDecorators(tool79);
4968
5506
 
4969
5507
  // src/umbraco-api/tools/site-structure/index.ts
4970
- var collection12 = {
5508
+ var collection13 = {
4971
5509
  metadata: {
4972
5510
  name: "site-structure",
4973
5511
  displayName: "Site Structure",
@@ -4975,12 +5513,12 @@ var collection12 = {
4975
5513
  },
4976
5514
  tools: () => [report_site_tree_summary_default, report_deep_pages_default]
4977
5515
  };
4978
- var site_structure_default = collection12;
4979
- var inputSchema68 = {
5516
+ var site_structure_default = collection13;
5517
+ var inputSchema80 = {
4980
5518
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to publish (max 10)"),
4981
5519
  includeDescendants: z.boolean().optional().default(false).describe("Whether to also publish all child pages of each page")
4982
5520
  };
4983
- var outputSchema68 = z.object({
5521
+ var outputSchema80 = z.object({
4984
5522
  message: z.string(),
4985
5523
  results: z.array(z.object({
4986
5524
  id: z.string(),
@@ -4994,11 +5532,11 @@ var outputSchema68 = z.object({
4994
5532
  failureCount: z.number(),
4995
5533
  skippedCount: z.number()
4996
5534
  });
4997
- var tool68 = {
5535
+ var tool80 = {
4998
5536
  name: "bulk-publish",
4999
5537
  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.",
5000
- inputSchema: inputSchema68,
5001
- outputSchema: outputSchema68,
5538
+ inputSchema: inputSchema80,
5539
+ outputSchema: outputSchema80,
5002
5540
  slices: ["publish"],
5003
5541
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5004
5542
  handler: async ({ ids, includeDescendants }, extra) => {
@@ -5050,11 +5588,11 @@ ${nameList}`;
5050
5588
  return createToolResult(buildBulkOutput("Published", results));
5051
5589
  }
5052
5590
  };
5053
- var bulk_publish_default = withStandardDecorators(tool68);
5054
- var inputSchema69 = {
5591
+ var bulk_publish_default = withStandardDecorators(tool80);
5592
+ var inputSchema81 = {
5055
5593
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to unpublish (max 10)")
5056
5594
  };
5057
- var outputSchema69 = z.object({
5595
+ var outputSchema81 = z.object({
5058
5596
  message: z.string(),
5059
5597
  results: z.array(z.object({
5060
5598
  id: z.string(),
@@ -5068,11 +5606,11 @@ var outputSchema69 = z.object({
5068
5606
  failureCount: z.number(),
5069
5607
  skippedCount: z.number()
5070
5608
  });
5071
- var tool69 = {
5609
+ var tool81 = {
5072
5610
  name: "bulk-unpublish",
5073
5611
  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.",
5074
- inputSchema: inputSchema69,
5075
- outputSchema: outputSchema69,
5612
+ inputSchema: inputSchema81,
5613
+ outputSchema: outputSchema81,
5076
5614
  slices: ["publish"],
5077
5615
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5078
5616
  handler: async ({ ids }, extra) => {
@@ -5128,7 +5666,7 @@ ${nameList}`;
5128
5666
  return createToolResult(buildBulkOutput("Unpublished", results));
5129
5667
  }
5130
5668
  };
5131
- var bulk_unpublish_default = withStandardDecorators(tool69);
5669
+ var bulk_unpublish_default = withStandardDecorators(tool81);
5132
5670
 
5133
5671
  // src/umbraco-api/tools/helpers/format-date.ts
5134
5672
  function formatDate(iso) {
@@ -5142,11 +5680,11 @@ function formatDate(iso) {
5142
5680
  }
5143
5681
 
5144
5682
  // src/umbraco-api/tools/bulk-operations/post/bulk-schedule-publish.ts
5145
- var inputSchema70 = {
5683
+ var inputSchema82 = {
5146
5684
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to schedule for publishing (max 10)"),
5147
5685
  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.")
5148
5686
  };
5149
- var outputSchema70 = z.object({
5687
+ var outputSchema82 = z.object({
5150
5688
  message: z.string(),
5151
5689
  results: z.array(z.object({
5152
5690
  id: z.string(),
@@ -5160,11 +5698,11 @@ var outputSchema70 = z.object({
5160
5698
  failureCount: z.number(),
5161
5699
  skippedCount: z.number()
5162
5700
  });
5163
- var tool70 = {
5701
+ var tool82 = {
5164
5702
  name: "bulk-schedule-publish",
5165
5703
  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.",
5166
- inputSchema: inputSchema70,
5167
- outputSchema: outputSchema70,
5704
+ inputSchema: inputSchema82,
5705
+ outputSchema: outputSchema82,
5168
5706
  slices: ["publish"],
5169
5707
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5170
5708
  handler: async ({ ids, publishDate }, extra) => {
@@ -5209,15 +5747,15 @@ ${nameList}`;
5209
5747
  return createToolResult(buildBulkOutput("Scheduled", results));
5210
5748
  }
5211
5749
  };
5212
- var bulk_schedule_publish_default = withStandardDecorators(tool70);
5213
- var inputSchema71 = {
5750
+ var bulk_schedule_publish_default = withStandardDecorators(tool82);
5751
+ var inputSchema83 = {
5214
5752
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5215
5753
  alias: z.string().describe("The property alias to set (call get-page first to verify it exists on the document type)"),
5216
5754
  value: z.any().describe("The value to set on the property"),
5217
5755
  culture: z.string().optional().describe("The culture code for variant content (omit for invariant properties)"),
5218
5756
  segment: z.string().optional().describe("The segment for segmented content (omit if not using segments)")
5219
5757
  };
5220
- var outputSchema71 = z.object({
5758
+ var outputSchema83 = z.object({
5221
5759
  message: z.string(),
5222
5760
  results: z.array(z.object({
5223
5761
  id: z.string(),
@@ -5232,11 +5770,11 @@ var outputSchema71 = z.object({
5232
5770
  failureCount: z.number(),
5233
5771
  skippedCount: z.number()
5234
5772
  });
5235
- var tool71 = {
5773
+ var tool83 = {
5236
5774
  name: "bulk-set-property",
5237
5775
  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.",
5238
- inputSchema: inputSchema71,
5239
- outputSchema: outputSchema71,
5776
+ inputSchema: inputSchema83,
5777
+ outputSchema: outputSchema83,
5240
5778
  slices: ["update"],
5241
5779
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5242
5780
  handler: async ({ ids, alias, value, culture, segment }, extra) => {
@@ -5283,12 +5821,12 @@ ${nameList}`;
5283
5821
  return createToolResult(buildBulkOutput("Updated", results));
5284
5822
  }
5285
5823
  };
5286
- var bulk_set_property_default = withStandardDecorators(tool71);
5287
- var inputSchema72 = {
5824
+ var bulk_set_property_default = withStandardDecorators(tool83);
5825
+ var inputSchema84 = {
5288
5826
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to move (max 10)"),
5289
5827
  targetParentId: z.string().uuid().describe("The ID of the destination parent page to move the pages into")
5290
5828
  };
5291
- var outputSchema72 = z.object({
5829
+ var outputSchema84 = z.object({
5292
5830
  message: z.string(),
5293
5831
  results: z.array(z.object({
5294
5832
  id: z.string(),
@@ -5302,11 +5840,11 @@ var outputSchema72 = z.object({
5302
5840
  failureCount: z.number(),
5303
5841
  skippedCount: z.number()
5304
5842
  });
5305
- var tool72 = {
5843
+ var tool84 = {
5306
5844
  name: "bulk-move",
5307
5845
  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.",
5308
- inputSchema: inputSchema72,
5309
- outputSchema: outputSchema72,
5846
+ inputSchema: inputSchema84,
5847
+ outputSchema: outputSchema84,
5310
5848
  slices: ["move"],
5311
5849
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5312
5850
  handler: async ({ ids, targetParentId }, extra) => {
@@ -5359,8 +5897,8 @@ ${nameList}`;
5359
5897
  return createToolResult(buildBulkOutput("Moved", results));
5360
5898
  }
5361
5899
  };
5362
- var bulk_move_default = withStandardDecorators(tool72);
5363
- var inputSchema73 = {
5900
+ var bulk_move_default = withStandardDecorators(tool84);
5901
+ var inputSchema85 = {
5364
5902
  ids: z.array(z.string().uuid()).min(1).max(10).describe("The IDs of the pages to update (max 10)"),
5365
5903
  contentTypeKey: z.string().uuid().describe("The block element type key to target. Use inspect-blocks to find this."),
5366
5904
  propertyAlias: z.string().describe("The document property alias containing the blocks (e.g. 'contentRows'). Use inspect-blocks to find this."),
@@ -5371,7 +5909,7 @@ var inputSchema73 = {
5371
5909
  culture: z.string().nullable().optional().describe("Culture code if the document property is variant"),
5372
5910
  segment: z.string().nullable().optional().describe("Segment if the document property is variant")
5373
5911
  };
5374
- var outputSchema73 = z.object({
5912
+ var outputSchema85 = z.object({
5375
5913
  message: z.string(),
5376
5914
  results: z.array(z.object({
5377
5915
  id: z.string(),
@@ -5389,10 +5927,10 @@ var outputSchema73 = z.object({
5389
5927
  skippedCount: z.number(),
5390
5928
  totalBlocksUpdated: z.number()
5391
5929
  });
5392
- function isBlockListOrGridValue3(value) {
5930
+ function isBlockListOrGridValue2(value) {
5393
5931
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
5394
5932
  }
5395
- function isRteWithBlocks3(value) {
5933
+ function isRteWithBlocks2(value) {
5396
5934
  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);
5397
5935
  }
5398
5936
  function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
@@ -5400,18 +5938,18 @@ function findMatchingBlocks(doc, propertyAlias, contentTypeKey) {
5400
5938
  const prop = allValues.find((v) => v.alias === propertyAlias);
5401
5939
  if (!prop) return [];
5402
5940
  let contentData = [];
5403
- if (isBlockListOrGridValue3(prop.value)) {
5941
+ if (isBlockListOrGridValue2(prop.value)) {
5404
5942
  contentData = prop.value.contentData;
5405
- } else if (isRteWithBlocks3(prop.value)) {
5943
+ } else if (isRteWithBlocks2(prop.value)) {
5406
5944
  contentData = prop.value.blocks.contentData;
5407
5945
  }
5408
5946
  return contentData.filter((block) => block.contentTypeKey === contentTypeKey).map((block) => ({ contentKey: block.key ?? "" })).filter((b) => b.contentKey !== "");
5409
5947
  }
5410
- var tool73 = {
5948
+ var tool85 = {
5411
5949
  name: "bulk-set-block-property",
5412
5950
  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.",
5413
- inputSchema: inputSchema73,
5414
- outputSchema: outputSchema73,
5951
+ inputSchema: inputSchema85,
5952
+ outputSchema: outputSchema85,
5415
5953
  slices: ["update"],
5416
5954
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5417
5955
  handler: async ({ ids, contentTypeKey, propertyAlias, values, culture, segment }, extra) => {
@@ -5591,10 +6129,10 @@ Changes will be saved but not published.`;
5591
6129
  });
5592
6130
  }
5593
6131
  };
5594
- var bulk_set_block_property_default = withStandardDecorators(tool73);
6132
+ var bulk_set_block_property_default = withStandardDecorators(tool85);
5595
6133
 
5596
6134
  // src/umbraco-api/tools/bulk-operations/index.ts
5597
- var collection13 = {
6135
+ var collection14 = {
5598
6136
  metadata: {
5599
6137
  name: "bulk-operations",
5600
6138
  displayName: "Bulk Operations",
@@ -5602,7 +6140,7 @@ var collection13 = {
5602
6140
  },
5603
6141
  tools: () => [bulk_publish_default, bulk_unpublish_default, bulk_schedule_publish_default, bulk_set_property_default, bulk_move_default, bulk_set_block_property_default]
5604
6142
  };
5605
- var bulk_operations_default = collection13;
6143
+ var bulk_operations_default = collection14;
5606
6144
 
5607
6145
  // src/umbraco-api/tools/member-reporting/get/member-type-helper.ts
5608
6146
  function memberTypeToString(memberType) {
@@ -5616,12 +6154,12 @@ function memberTypeToString(memberType) {
5616
6154
  }
5617
6155
 
5618
6156
  // src/umbraco-api/tools/member/get/search-members.ts
5619
- var inputSchema74 = {
6157
+ var inputSchema86 = {
5620
6158
  query: z.string().describe("Search term to find members by name or email address"),
5621
6159
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
5622
6160
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5623
6161
  };
5624
- var outputSchema74 = z.object({
6162
+ var outputSchema86 = z.object({
5625
6163
  items: z.array(z.object({
5626
6164
  id: z.string(),
5627
6165
  name: z.string(),
@@ -5632,11 +6170,11 @@ var outputSchema74 = z.object({
5632
6170
  })).describe("Matching members"),
5633
6171
  total: z.number().describe("Total number of matches")
5634
6172
  });
5635
- var tool74 = {
6173
+ var tool86 = {
5636
6174
  name: "search-members",
5637
6175
  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.",
5638
- inputSchema: inputSchema74,
5639
- outputSchema: outputSchema74,
6176
+ inputSchema: inputSchema86,
6177
+ outputSchema: outputSchema86,
5640
6178
  slices: ["search"],
5641
6179
  annotations: { readOnlyHint: true },
5642
6180
  handler: async ({ query, take, skip }) => {
@@ -5656,7 +6194,7 @@ var tool74 = {
5656
6194
  });
5657
6195
  }
5658
6196
  };
5659
- var search_members_default = withStandardDecorators(tool74);
6197
+ var search_members_default = withStandardDecorators(tool86);
5660
6198
 
5661
6199
  // src/umbraco-api/tools/member/sensitive-data-access.ts
5662
6200
  async function checkSensitiveDataAccess() {
@@ -5666,10 +6204,10 @@ async function checkSensitiveDataAccess() {
5666
6204
  }
5667
6205
 
5668
6206
  // src/umbraco-api/tools/member/get/get-member.ts
5669
- var inputSchema75 = {
6207
+ var inputSchema87 = {
5670
6208
  id: z.string().uuid().describe("The ID of the member to retrieve")
5671
6209
  };
5672
- var outputSchema75 = z.object({
6210
+ var outputSchema87 = z.object({
5673
6211
  id: z.string(),
5674
6212
  name: z.string(),
5675
6213
  email: z.string(),
@@ -5689,11 +6227,11 @@ var outputSchema75 = z.object({
5689
6227
  lastPasswordChangeDate: z.string().nullable(),
5690
6228
  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.")
5691
6229
  });
5692
- var tool75 = {
6230
+ var tool87 = {
5693
6231
  name: "get-member",
5694
6232
  description: "Get the full profile of a member including their groups, properties, approval status, and login history.",
5695
- inputSchema: inputSchema75,
5696
- outputSchema: outputSchema75,
6233
+ inputSchema: inputSchema87,
6234
+ outputSchema: outputSchema87,
5697
6235
  slices: ["read"],
5698
6236
  annotations: { readOnlyHint: true },
5699
6237
  handler: async ({ id }) => {
@@ -5719,12 +6257,12 @@ var tool75 = {
5719
6257
  });
5720
6258
  }
5721
6259
  };
5722
- var get_member_default = withStandardDecorators(tool75);
5723
- var inputSchema76 = {
6260
+ var get_member_default = withStandardDecorators(tool87);
6261
+ var inputSchema88 = {
5724
6262
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
5725
6263
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5726
6264
  };
5727
- var outputSchema76 = z.object({
6265
+ var outputSchema88 = z.object({
5728
6266
  items: z.array(z.object({
5729
6267
  id: z.string(),
5730
6268
  alias: z.string(),
@@ -5732,11 +6270,11 @@ var outputSchema76 = z.object({
5732
6270
  })).describe("Available member types"),
5733
6271
  total: z.number().describe("Total number of member types")
5734
6272
  });
5735
- var tool76 = {
6273
+ var tool88 = {
5736
6274
  name: "list-member-types",
5737
6275
  description: "List available member types. Use this before create-member to find a valid member type ID.",
5738
- inputSchema: inputSchema76,
5739
- outputSchema: outputSchema76,
6276
+ inputSchema: inputSchema88,
6277
+ outputSchema: outputSchema88,
5740
6278
  slices: ["list"],
5741
6279
  annotations: { readOnlyHint: true },
5742
6280
  handler: async ({ take, skip }) => {
@@ -5752,8 +6290,8 @@ var tool76 = {
5752
6290
  });
5753
6291
  }
5754
6292
  };
5755
- var list_member_types_default = withStandardDecorators(tool76);
5756
- var inputSchema77 = {
6293
+ var list_member_types_default = withStandardDecorators(tool88);
6294
+ var inputSchema89 = {
5757
6295
  email: z.string().email().describe("The email address for the new member"),
5758
6296
  username: z.string().describe("The username for the new member"),
5759
6297
  name: z.string().describe("The display name for the new member"),
@@ -5766,17 +6304,17 @@ var inputSchema77 = {
5766
6304
  value: z.any().describe("The property value")
5767
6305
  })).optional().describe("Custom property values to set on the new member")
5768
6306
  };
5769
- var outputSchema77 = z.object({
6307
+ var outputSchema89 = z.object({
5770
6308
  message: z.string(),
5771
6309
  id: z.string(),
5772
6310
  name: z.string(),
5773
6311
  email: z.string()
5774
6312
  });
5775
- var tool77 = {
6313
+ var tool89 = {
5776
6314
  name: "create-member",
5777
6315
  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.",
5778
- inputSchema: inputSchema77,
5779
- outputSchema: outputSchema77,
6316
+ inputSchema: inputSchema89,
6317
+ outputSchema: outputSchema89,
5780
6318
  slices: ["create"],
5781
6319
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
5782
6320
  handler: async ({ email, username, name, password, memberTypeId, isApproved, groups, values }) => {
@@ -5830,8 +6368,8 @@ var tool77 = {
5830
6368
  });
5831
6369
  }
5832
6370
  };
5833
- var create_member_default = withStandardDecorators(tool77);
5834
- var inputSchema78 = {
6371
+ var create_member_default = withStandardDecorators(tool89);
6372
+ var inputSchema90 = {
5835
6373
  id: z.string().uuid().describe("The ID of the member to update"),
5836
6374
  name: z.string().optional().describe("The new display name for the member"),
5837
6375
  email: z.string().email().optional().describe("The new email address for the member"),
@@ -5846,17 +6384,17 @@ var inputSchema78 = {
5846
6384
  value: z.any().describe("The new property value")
5847
6385
  })).optional().describe("Custom property values to update")
5848
6386
  };
5849
- var outputSchema78 = z.object({
6387
+ var outputSchema90 = z.object({
5850
6388
  message: z.string(),
5851
6389
  id: z.string(),
5852
6390
  name: z.string(),
5853
6391
  email: z.string()
5854
6392
  });
5855
- var tool78 = {
6393
+ var tool90 = {
5856
6394
  name: "update-member",
5857
6395
  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.",
5858
- inputSchema: inputSchema78,
5859
- outputSchema: outputSchema78,
6396
+ inputSchema: inputSchema90,
6397
+ outputSchema: outputSchema90,
5860
6398
  slices: ["update"],
5861
6399
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
5862
6400
  handler: async ({ id, name, email, username, newPassword, isTwoFactorEnabled, isApproved, isLockedOut, groups, values }, extra) => {
@@ -5912,21 +6450,21 @@ var tool78 = {
5912
6450
  });
5913
6451
  }
5914
6452
  };
5915
- var update_member_default = withStandardDecorators(tool78);
5916
- var inputSchema79 = {
6453
+ var update_member_default = withStandardDecorators(tool90);
6454
+ var inputSchema91 = {
5917
6455
  id: z.string().uuid().describe("The ID of the member to permanently delete")
5918
6456
  };
5919
- var outputSchema79 = z.object({
6457
+ var outputSchema91 = z.object({
5920
6458
  message: z.string(),
5921
6459
  id: z.string(),
5922
6460
  name: z.string(),
5923
6461
  email: z.string()
5924
6462
  });
5925
- var tool79 = {
6463
+ var tool91 = {
5926
6464
  name: "delete-member",
5927
6465
  description: "Permanently delete a member. This cannot be undone \u2014 there is no recycle bin for members. You will be asked to confirm.",
5928
- inputSchema: inputSchema79,
5929
- outputSchema: outputSchema79,
6466
+ inputSchema: inputSchema91,
6467
+ outputSchema: outputSchema91,
5930
6468
  slices: ["delete"],
5931
6469
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
5932
6470
  handler: async ({ id }, extra) => {
@@ -5948,10 +6486,10 @@ var tool79 = {
5948
6486
  });
5949
6487
  }
5950
6488
  };
5951
- var delete_member_default = withStandardDecorators(tool79);
6489
+ var delete_member_default = withStandardDecorators(tool91);
5952
6490
 
5953
6491
  // src/umbraco-api/tools/member/index.ts
5954
- var collection14 = {
6492
+ var collection15 = {
5955
6493
  metadata: {
5956
6494
  name: "member",
5957
6495
  displayName: "Members",
@@ -5959,23 +6497,23 @@ var collection14 = {
5959
6497
  },
5960
6498
  tools: () => [search_members_default, get_member_default, list_member_types_default, create_member_default, update_member_default, delete_member_default]
5961
6499
  };
5962
- var member_default = collection14;
5963
- var inputSchema80 = {
6500
+ var member_default = collection15;
6501
+ var inputSchema92 = {
5964
6502
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
5965
6503
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
5966
6504
  };
5967
- var outputSchema80 = z.object({
6505
+ var outputSchema92 = z.object({
5968
6506
  items: z.array(z.object({
5969
6507
  id: z.string(),
5970
6508
  name: z.string()
5971
6509
  })).describe("Member groups"),
5972
6510
  total: z.number().describe("Total number of member groups")
5973
6511
  });
5974
- var tool80 = {
6512
+ var tool92 = {
5975
6513
  name: "list-member-groups",
5976
6514
  description: "List all member groups. Use group names when creating or updating members to assign them to groups.",
5977
- inputSchema: inputSchema80,
5978
- outputSchema: outputSchema80,
6515
+ inputSchema: inputSchema92,
6516
+ outputSchema: outputSchema92,
5979
6517
  slices: ["list"],
5980
6518
  annotations: { readOnlyHint: true },
5981
6519
  handler: async ({ take, skip }) => {
@@ -5991,20 +6529,20 @@ var tool80 = {
5991
6529
  });
5992
6530
  }
5993
6531
  };
5994
- var list_member_groups_default = withStandardDecorators(tool80);
5995
- var inputSchema81 = {
6532
+ var list_member_groups_default = withStandardDecorators(tool92);
6533
+ var inputSchema93 = {
5996
6534
  name: z.string().describe("The name of the new member group")
5997
6535
  };
5998
- var outputSchema81 = z.object({
6536
+ var outputSchema93 = z.object({
5999
6537
  message: z.string(),
6000
6538
  id: z.string(),
6001
6539
  name: z.string()
6002
6540
  });
6003
- var tool81 = {
6541
+ var tool93 = {
6004
6542
  name: "create-member-group",
6005
6543
  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.",
6006
- inputSchema: inputSchema81,
6007
- outputSchema: outputSchema81,
6544
+ inputSchema: inputSchema93,
6545
+ outputSchema: outputSchema93,
6008
6546
  slices: ["create"],
6009
6547
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6010
6548
  handler: async ({ name }) => {
@@ -6017,20 +6555,20 @@ var tool81 = {
6017
6555
  });
6018
6556
  }
6019
6557
  };
6020
- var create_member_group_default = withStandardDecorators(tool81);
6021
- var inputSchema82 = {
6558
+ var create_member_group_default = withStandardDecorators(tool93);
6559
+ var inputSchema94 = {
6022
6560
  id: z.string().uuid().describe("The ID of the member group to delete")
6023
6561
  };
6024
- var outputSchema82 = z.object({
6562
+ var outputSchema94 = z.object({
6025
6563
  message: z.string(),
6026
6564
  id: z.string(),
6027
6565
  name: z.string()
6028
6566
  });
6029
- var tool82 = {
6567
+ var tool94 = {
6030
6568
  name: "delete-member-group",
6031
6569
  description: "Delete a member group. Members in this group will lose the group assignment. You will be asked to confirm.",
6032
- inputSchema: inputSchema82,
6033
- outputSchema: outputSchema82,
6570
+ inputSchema: inputSchema94,
6571
+ outputSchema: outputSchema94,
6034
6572
  slices: ["delete"],
6035
6573
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6036
6574
  handler: async ({ id }, extra) => {
@@ -6051,10 +6589,10 @@ var tool82 = {
6051
6589
  });
6052
6590
  }
6053
6591
  };
6054
- var delete_member_group_default = withStandardDecorators(tool82);
6592
+ var delete_member_group_default = withStandardDecorators(tool94);
6055
6593
 
6056
6594
  // src/umbraco-api/tools/member-group/index.ts
6057
- var collection15 = {
6595
+ var collection16 = {
6058
6596
  metadata: {
6059
6597
  name: "member-group",
6060
6598
  displayName: "Member Groups",
@@ -6062,74 +6600,82 @@ var collection15 = {
6062
6600
  },
6063
6601
  tools: () => [list_member_groups_default, create_member_group_default, delete_member_group_default]
6064
6602
  };
6065
- var member_group_default = collection15;
6066
- var inputSchema83 = {};
6067
- var outputSchema83 = z.object({
6068
- totalMembers: z.number().describe("Total number of members across all types and groups"),
6603
+ var member_group_default = collection16;
6604
+ var inputSchema95 = {};
6605
+ var outputSchema95 = z.object({
6606
+ totalMembers: z.number().describe("Total number of members across all types and groups (exact, server-reported \u2014 not capped by the sample)."),
6069
6607
  byType: z.array(z.object({
6070
6608
  memberType: z.string().describe("Member type alias or name"),
6071
6609
  count: z.number()
6072
- })).describe("Member counts grouped by member type. Maps naturally to a pie or bar chart."),
6610
+ })).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."),
6073
6611
  byGroup: z.array(z.object({
6074
6612
  group: z.string().describe("Member group name"),
6075
6613
  count: z.number()
6076
- })).describe("Member counts grouped by member group. Members with no group are excluded.")
6614
+ })).describe("Member counts grouped by member group \u2014 exact, server-reported per-group totals (uncapped). Members with no group are excluded.")
6077
6615
  });
6078
6616
  var PAGE_SIZE = 100;
6079
6617
  var MEMBER_CAP = 500;
6080
- var tool83 = {
6618
+ var tool95 = {
6081
6619
  name: "report-member-count",
6082
- 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.",
6083
- inputSchema: inputSchema83,
6084
- outputSchema: outputSchema83,
6620
+ 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.",
6621
+ inputSchema: inputSchema95,
6622
+ outputSchema: outputSchema95,
6085
6623
  slices: ["read"],
6086
6624
  annotations: { readOnlyHint: true },
6087
6625
  handler: async () => {
6088
- const allMembers = [];
6626
+ const sampledMembers = [];
6627
+ let totalMembers = 0;
6089
6628
  let cursor = encodeCursor({ s: 0, t: PAGE_SIZE });
6090
- while (allMembers.length < MEMBER_CAP) {
6629
+ while (sampledMembers.length < MEMBER_CAP) {
6091
6630
  const result = await chainCms("find-member", { cursor, orderBy: "username" });
6092
6631
  if (!result.ok) return result.errorResult;
6093
6632
  const data = result.data;
6094
6633
  const items = data.items ?? [];
6095
- allMembers.push(...items);
6634
+ if (typeof data.total === "number") totalMembers = data.total;
6635
+ sampledMembers.push(...items);
6096
6636
  const nextCursor = data.nextCursor;
6097
6637
  if (!nextCursor || items.length === 0) break;
6098
6638
  cursor = nextCursor;
6099
6639
  }
6640
+ if (totalMembers === 0 && sampledMembers.length > 0) totalMembers = sampledMembers.length;
6100
6641
  const typeCounts = /* @__PURE__ */ new Map();
6101
- for (const member of allMembers) {
6642
+ for (const member of sampledMembers) {
6102
6643
  const memberType = memberTypeToString(member.memberType);
6103
6644
  typeCounts.set(memberType, (typeCounts.get(memberType) ?? 0) + 1);
6104
6645
  }
6105
6646
  const groupResult = await chainCms("get-all-member-groups", {});
6106
6647
  if (!groupResult.ok) return groupResult.errorResult;
6107
6648
  const allGroups = groupResult.data.items ?? [];
6649
+ const named = allGroups.filter((g) => typeof g.name === "string");
6650
+ const perGroupResults = await Promise.all(
6651
+ named.map(
6652
+ (g) => chainCms("find-member", {
6653
+ memberGroupName: g.name,
6654
+ cursor: encodeCursor({ s: 0, t: 1 }),
6655
+ orderBy: "username"
6656
+ })
6657
+ )
6658
+ );
6108
6659
  const byGroup = [];
6109
- for (const group of allGroups) {
6110
- if (!group.name) continue;
6111
- const countResult = await chainCms("find-member", {
6112
- memberGroupName: group.name,
6113
- cursor: encodeCursor({ s: 0, t: 1 }),
6114
- orderBy: "username"
6115
- });
6116
- if (!countResult.ok) return countResult.errorResult;
6117
- byGroup.push({ group: group.name, count: countResult.data.total ?? 0 });
6660
+ for (let i = 0; i < named.length; i++) {
6661
+ const r = perGroupResults[i];
6662
+ if (!r.ok) return r.errorResult;
6663
+ byGroup.push({ group: named[i].name, count: r.data.total ?? 0 });
6118
6664
  }
6119
6665
  return createToolResult({
6120
- totalMembers: allMembers.length,
6666
+ totalMembers,
6121
6667
  byType: Array.from(typeCounts.entries()).map(([memberType, count]) => ({ memberType, count })).sort((a, b) => b.count - a.count),
6122
6668
  byGroup: byGroup.sort((a, b) => b.count - a.count)
6123
6669
  });
6124
6670
  }
6125
6671
  };
6126
- var report_member_count_default = withStandardDecorators(tool83);
6127
- var inputSchema84 = {
6672
+ var report_member_count_default = withStandardDecorators(tool95);
6673
+ var inputSchema96 = {
6128
6674
  groupName: z.string().describe("The name of the member group to filter by. Use list-member-groups to find valid group names."),
6129
6675
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6130
6676
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6131
6677
  };
6132
- var outputSchema84 = z.object({
6678
+ var outputSchema96 = z.object({
6133
6679
  groupName: z.string().describe("The group name used for this query"),
6134
6680
  items: z.array(z.object({
6135
6681
  id: z.string(),
@@ -6140,11 +6686,11 @@ var outputSchema84 = z.object({
6140
6686
  })).describe("Members belonging to the specified group"),
6141
6687
  total: z.number().describe("Total number of members in this group")
6142
6688
  });
6143
- var tool84 = {
6689
+ var tool96 = {
6144
6690
  name: "report-members-by-group",
6145
6691
  description: "List members belonging to a specific group. Use list-member-groups to find valid group names.",
6146
- inputSchema: inputSchema84,
6147
- outputSchema: outputSchema84,
6692
+ inputSchema: inputSchema96,
6693
+ outputSchema: outputSchema96,
6148
6694
  slices: ["read"],
6149
6695
  annotations: { readOnlyHint: true },
6150
6696
  handler: async ({ groupName, take, skip }) => {
@@ -6160,8 +6706,9 @@ var tool84 = {
6160
6706
  detail: `No member group named "${groupName}". Use list-member-groups to see existing group names.`
6161
6707
  });
6162
6708
  }
6709
+ const canonicalGroupName = groupMatch.name ?? groupName;
6163
6710
  const result = await chainCms("find-member", {
6164
- memberGroupName: groupMatch.name,
6711
+ memberGroupName: canonicalGroupName,
6165
6712
  cursor: buildChainedCursor(skip, take),
6166
6713
  orderBy: "username"
6167
6714
  });
@@ -6180,13 +6727,13 @@ var tool84 = {
6180
6727
  });
6181
6728
  }
6182
6729
  };
6183
- var report_members_by_group_default = withStandardDecorators(tool84);
6184
- var inputSchema85 = {
6730
+ var report_members_by_group_default = withStandardDecorators(tool96);
6731
+ var inputSchema97 = {
6185
6732
  inactiveDays: z.number().optional().default(90).describe("Number of days without a login before a member is considered inactive (default 90)"),
6186
6733
  take: z.number().optional().default(50).describe("Number of results to return after filtering (default 50)"),
6187
6734
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination (default 0)")
6188
6735
  };
6189
- var outputSchema85 = z.object({
6736
+ var outputSchema97 = z.object({
6190
6737
  items: z.array(z.object({
6191
6738
  id: z.string(),
6192
6739
  name: z.string(),
@@ -6201,11 +6748,11 @@ var outputSchema85 = z.object({
6201
6748
  });
6202
6749
  var PAGE_SIZE2 = 100;
6203
6750
  var MEMBER_CAP2 = 500;
6204
- var tool85 = {
6751
+ var tool97 = {
6205
6752
  name: "report-member-activity",
6206
6753
  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.",
6207
- inputSchema: inputSchema85,
6208
- outputSchema: outputSchema85,
6754
+ inputSchema: inputSchema97,
6755
+ outputSchema: outputSchema97,
6209
6756
  slices: ["read"],
6210
6757
  annotations: { readOnlyHint: true },
6211
6758
  handler: async ({ inactiveDays, take, skip }) => {
@@ -6259,10 +6806,10 @@ var tool85 = {
6259
6806
  });
6260
6807
  }
6261
6808
  };
6262
- var report_member_activity_default = withStandardDecorators(tool85);
6809
+ var report_member_activity_default = withStandardDecorators(tool97);
6263
6810
 
6264
6811
  // src/umbraco-api/tools/member-reporting/index.ts
6265
- var collection16 = {
6812
+ var collection17 = {
6266
6813
  metadata: {
6267
6814
  name: "member-reporting",
6268
6815
  displayName: "Member Reporting",
@@ -6270,22 +6817,22 @@ var collection16 = {
6270
6817
  },
6271
6818
  tools: () => [report_member_count_default, report_members_by_group_default, report_member_activity_default]
6272
6819
  };
6273
- var member_reporting_default = collection16;
6274
- var inputSchema86 = {
6820
+ var member_reporting_default = collection17;
6821
+ var inputSchema98 = {
6275
6822
  id: z.string().uuid().describe("The ID of the page to check publish status for")
6276
6823
  };
6277
- var outputSchema86 = z.object({
6824
+ var outputSchema98 = z.object({
6278
6825
  id: z.string(),
6279
6826
  name: z.string(),
6280
6827
  isPublished: z.boolean(),
6281
6828
  state: z.string(),
6282
6829
  variants: z.array(publishStatusVariantSchema)
6283
6830
  });
6284
- var tool86 = {
6831
+ var tool98 = {
6285
6832
  name: "get-publish-status",
6286
6833
  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.",
6287
- inputSchema: inputSchema86,
6288
- outputSchema: outputSchema86,
6834
+ inputSchema: inputSchema98,
6835
+ outputSchema: outputSchema98,
6289
6836
  slices: ["read"],
6290
6837
  annotations: { readOnlyHint: true },
6291
6838
  handler: async ({ id }) => {
@@ -6301,24 +6848,24 @@ var tool86 = {
6301
6848
  });
6302
6849
  }
6303
6850
  };
6304
- var get_publish_status_default = withStandardDecorators(tool86);
6305
- var inputSchema87 = {
6851
+ var get_publish_status_default = withStandardDecorators(tool98);
6852
+ var inputSchema99 = {
6306
6853
  id: z.string().uuid().describe("The ID of the page to schedule for publish"),
6307
6854
  publishDate: z.string().datetime().describe("The date and time to publish the page (ISO 8601 format, must be in the future)"),
6308
6855
  culture: z.string().optional().describe("Culture code for variant-specific scheduling (e.g. 'en-US'). Omit for invariant content.")
6309
6856
  };
6310
- var outputSchema87 = z.object({
6857
+ var outputSchema99 = z.object({
6311
6858
  message: z.string(),
6312
6859
  id: z.string(),
6313
6860
  name: z.string(),
6314
6861
  scheduledDate: z.string(),
6315
6862
  previewUrl: previewUrlSchema
6316
6863
  });
6317
- var tool87 = {
6864
+ var tool99 = {
6318
6865
  name: "schedule-publish",
6319
6866
  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.",
6320
- inputSchema: inputSchema87,
6321
- outputSchema: outputSchema87,
6867
+ inputSchema: inputSchema99,
6868
+ outputSchema: outputSchema99,
6322
6869
  slices: ["publish"],
6323
6870
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6324
6871
  handler: async ({ id, publishDate, culture }, extra) => {
@@ -6343,22 +6890,22 @@ var tool87 = {
6343
6890
  });
6344
6891
  }
6345
6892
  };
6346
- var schedule_publish_default = withStandardDecorators(tool87);
6347
- var inputSchema88 = {
6893
+ var schedule_publish_default = withStandardDecorators(tool99);
6894
+ var inputSchema100 = {
6348
6895
  id: z.string().uuid().describe("The ID of the page whose scheduled publish should be cancelled"),
6349
6896
  culture: z.string().optional().describe("Culture code to check for a scheduled variant (e.g. 'en-US'). Omit for invariant content.")
6350
6897
  };
6351
- var outputSchema88 = z.object({
6898
+ var outputSchema100 = z.object({
6352
6899
  message: z.string(),
6353
6900
  id: z.string(),
6354
6901
  name: z.string(),
6355
6902
  previewUrl: previewUrlSchema
6356
6903
  });
6357
- var tool88 = {
6904
+ var tool100 = {
6358
6905
  name: "cancel-schedule",
6359
6906
  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.",
6360
- inputSchema: inputSchema88,
6361
- outputSchema: outputSchema88,
6907
+ inputSchema: inputSchema100,
6908
+ outputSchema: outputSchema100,
6362
6909
  slices: ["publish"],
6363
6910
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
6364
6911
  handler: async ({ id, culture }, extra) => {
@@ -6396,10 +6943,10 @@ var tool88 = {
6396
6943
  });
6397
6944
  }
6398
6945
  };
6399
- var cancel_schedule_default = withStandardDecorators(tool88);
6946
+ var cancel_schedule_default = withStandardDecorators(tool100);
6400
6947
 
6401
6948
  // src/umbraco-api/tools/scheduling/index.ts
6402
- var collection17 = {
6949
+ var collection18 = {
6403
6950
  metadata: {
6404
6951
  name: "scheduling",
6405
6952
  displayName: "Scheduling",
@@ -6407,13 +6954,13 @@ var collection17 = {
6407
6954
  },
6408
6955
  tools: () => [get_publish_status_default, schedule_publish_default, cancel_schedule_default]
6409
6956
  };
6410
- var scheduling_default = collection17;
6411
- var inputSchema89 = {
6957
+ var scheduling_default = collection18;
6958
+ var inputSchema101 = {
6412
6959
  take: z.number().optional().default(50).describe("Number of results to return (default 50)"),
6413
6960
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination"),
6414
6961
  filter: z.string().optional().describe("Filter redirects by URL")
6415
6962
  };
6416
- var outputSchema89 = z.object({
6963
+ var outputSchema101 = z.object({
6417
6964
  items: z.array(
6418
6965
  z.object({
6419
6966
  id: z.string(),
@@ -6425,11 +6972,11 @@ var outputSchema89 = z.object({
6425
6972
  ).describe("URL redirects"),
6426
6973
  total: z.number().describe("Total number of redirects")
6427
6974
  });
6428
- var tool89 = {
6975
+ var tool101 = {
6429
6976
  name: "list-redirects",
6430
6977
  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.",
6431
- inputSchema: inputSchema89,
6432
- outputSchema: outputSchema89,
6978
+ inputSchema: inputSchema101,
6979
+ outputSchema: outputSchema101,
6433
6980
  slices: ["list"],
6434
6981
  annotations: { readOnlyHint: true },
6435
6982
  handler: async ({ take, skip, filter }) => {
@@ -6451,11 +6998,11 @@ var tool89 = {
6451
6998
  });
6452
6999
  }
6453
7000
  };
6454
- var list_redirects_default = withStandardDecorators(tool89);
6455
- var inputSchema90 = {
7001
+ var list_redirects_default = withStandardDecorators(tool101);
7002
+ var inputSchema102 = {
6456
7003
  id: z.string().uuid().describe("The ID of the redirect to retrieve")
6457
7004
  };
6458
- var outputSchema90 = z.object({
7005
+ var outputSchema102 = z.object({
6459
7006
  id: z.string(),
6460
7007
  originalUrl: z.string(),
6461
7008
  destinationUrl: z.string(),
@@ -6463,11 +7010,11 @@ var outputSchema90 = z.object({
6463
7010
  isAutomatic: z.boolean(),
6464
7011
  createDate: z.string()
6465
7012
  });
6466
- var tool90 = {
7013
+ var tool102 = {
6467
7014
  name: "get-redirect",
6468
7015
  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.",
6469
- inputSchema: inputSchema90,
6470
- outputSchema: outputSchema90,
7016
+ inputSchema: inputSchema102,
7017
+ outputSchema: outputSchema102,
6471
7018
  slices: ["read"],
6472
7019
  annotations: { readOnlyHint: true },
6473
7020
  handler: async ({ id }) => {
@@ -6484,17 +7031,17 @@ var tool90 = {
6484
7031
  });
6485
7032
  }
6486
7033
  };
6487
- var get_redirect_default = withStandardDecorators(tool90);
6488
- var inputSchema91 = {};
6489
- var outputSchema91 = z.object({
7034
+ var get_redirect_default = withStandardDecorators(tool102);
7035
+ var inputSchema103 = {};
7036
+ var outputSchema103 = z.object({
6490
7037
  isEnabled: z.boolean(),
6491
7038
  message: z.string()
6492
7039
  });
6493
- var tool91 = {
7040
+ var tool103 = {
6494
7041
  name: "get-redirect-status",
6495
7042
  description: "Check whether automatic URL redirect tracking is enabled on the site. When enabled, Umbraco automatically creates redirects when pages are moved or renamed.",
6496
- inputSchema: inputSchema91,
6497
- outputSchema: outputSchema91,
7043
+ inputSchema: inputSchema103,
7044
+ outputSchema: outputSchema103,
6498
7045
  slices: ["read"],
6499
7046
  annotations: { readOnlyHint: true },
6500
7047
  handler: async () => {
@@ -6507,20 +7054,20 @@ var tool91 = {
6507
7054
  });
6508
7055
  }
6509
7056
  };
6510
- var get_redirect_status_default = withStandardDecorators(tool91);
6511
- var inputSchema92 = {
7057
+ var get_redirect_status_default = withStandardDecorators(tool103);
7058
+ var inputSchema104 = {
6512
7059
  id: z.string().uuid().describe("The ID of the redirect to delete")
6513
7060
  };
6514
- var outputSchema92 = z.object({
7061
+ var outputSchema104 = z.object({
6515
7062
  message: z.string(),
6516
7063
  id: z.string(),
6517
7064
  originalUrl: z.string()
6518
7065
  });
6519
- var tool92 = {
7066
+ var tool104 = {
6520
7067
  name: "delete-redirect",
6521
7068
  description: "Delete a URL redirect. Visitors following the original URL will get a 404 error. You will be asked to confirm.",
6522
- inputSchema: inputSchema92,
6523
- outputSchema: outputSchema92,
7069
+ inputSchema: inputSchema104,
7070
+ outputSchema: outputSchema104,
6524
7071
  slices: ["delete"],
6525
7072
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
6526
7073
  handler: async ({ id }, extra) => {
@@ -6551,10 +7098,10 @@ var tool92 = {
6551
7098
  });
6552
7099
  }
6553
7100
  };
6554
- var delete_redirect_default = withStandardDecorators(tool92);
7101
+ var delete_redirect_default = withStandardDecorators(tool104);
6555
7102
 
6556
7103
  // src/umbraco-api/tools/redirect/index.ts
6557
- var collection18 = {
7104
+ var collection19 = {
6558
7105
  metadata: {
6559
7106
  name: "redirect",
6560
7107
  displayName: "Redirects",
@@ -6562,12 +7109,12 @@ var collection18 = {
6562
7109
  },
6563
7110
  tools: () => [list_redirects_default, get_redirect_default, get_redirect_status_default, delete_redirect_default]
6564
7111
  };
6565
- var redirect_default = collection18;
6566
- var inputSchema93 = {
7112
+ var redirect_default = collection19;
7113
+ var inputSchema105 = {
6567
7114
  id: z.string().uuid().describe("The ID of the content page or media item to look up references for"),
6568
7115
  type: z.enum(["document", "media"]).describe("Whether the ID refers to a content document or a media item")
6569
7116
  };
6570
- var outputSchema93 = z.object({
7117
+ var outputSchema105 = z.object({
6571
7118
  id: z.string(),
6572
7119
  name: z.string(),
6573
7120
  url: z.string(),
@@ -6582,11 +7129,31 @@ var outputSchema93 = z.object({
6582
7129
  ).describe("Pages that reference this item"),
6583
7130
  referenceCount: z.number().describe("Total number of pages referencing this item")
6584
7131
  });
6585
- var tool93 = {
7132
+ async function buildReferencedBy(refItems) {
7133
+ const docRefIds = refItems.filter((ref) => ref.$type === "DocumentReferenceResponseModel").map((ref) => ref.id);
7134
+ const urlsById = await fetchPrimaryPublishedUrlsBatch(docRefIds);
7135
+ return refItems.map((ref) => {
7136
+ if (ref.$type === "DocumentReferenceResponseModel") {
7137
+ return {
7138
+ id: ref.id,
7139
+ name: ref.variants?.[0]?.name ?? ref.name ?? "(unnamed)",
7140
+ url: urlsById.get(ref.id) ?? "",
7141
+ documentType: ref.documentType?.alias ?? ""
7142
+ };
7143
+ }
7144
+ return {
7145
+ id: ref.id,
7146
+ name: ref.name ?? "(unnamed)",
7147
+ url: "",
7148
+ documentType: ""
7149
+ };
7150
+ });
7151
+ }
7152
+ var tool105 = {
6586
7153
  name: "report-content-references",
6587
7154
  description: "Find which pages reference a given content page or media item. Useful before deleting or restructuring content to understand the impact.",
6588
- inputSchema: inputSchema93,
6589
- outputSchema: outputSchema93,
7155
+ inputSchema: inputSchema105,
7156
+ outputSchema: outputSchema105,
6590
7157
  slices: ["read"],
6591
7158
  annotations: { readOnlyHint: true },
6592
7159
  handler: async ({ id, type }) => {
@@ -6596,32 +7163,11 @@ var tool93 = {
6596
7163
  chainCms("get-document-by-id-referenced-by", { id })
6597
7164
  ]);
6598
7165
  let name = "Unknown";
6599
- let url = "";
6600
7166
  if (docResult.ok) {
6601
- const doc = docResult.data;
6602
- name = doc.variants?.[0]?.name ?? "Unknown";
6603
- url = doc.urls?.[0]?.url ?? "";
6604
- }
6605
- const referencedBy = [];
6606
- if (refResult.ok) {
6607
- for (const ref of refResult.data.items ?? []) {
6608
- if (ref.$type === "DocumentReferenceResponseModel") {
6609
- referencedBy.push({
6610
- id: ref.id,
6611
- name: ref.variants?.[0]?.name ?? ref.name ?? "(unnamed)",
6612
- url: ref.urls?.[0]?.url ?? ref.url ?? "",
6613
- documentType: ref.documentType?.alias ?? ""
6614
- });
6615
- } else {
6616
- referencedBy.push({
6617
- id: ref.id,
6618
- name: ref.name ?? "(unnamed)",
6619
- url: "",
6620
- documentType: ""
6621
- });
6622
- }
6623
- }
7167
+ name = docResult.data.variants?.[0]?.name ?? "Unknown";
6624
7168
  }
7169
+ const url = await fetchPrimaryPublishedUrl(id);
7170
+ const referencedBy = refResult.ok ? await buildReferencedBy(refResult.data.items ?? []) : [];
6625
7171
  return createToolResult({
6626
7172
  id,
6627
7173
  name,
@@ -6645,26 +7191,7 @@ var tool93 = {
6645
7191
  const entry = urlResult.data.items?.find((u) => u.id === id);
6646
7192
  url = entry?.urlInfos?.[0]?.url ?? "";
6647
7193
  }
6648
- const referencedBy = [];
6649
- if (refResult.ok) {
6650
- for (const ref of refResult.data.items ?? []) {
6651
- if (ref.$type === "DocumentReferenceResponseModel") {
6652
- referencedBy.push({
6653
- id: ref.id,
6654
- name: ref.variants?.[0]?.name ?? ref.name ?? "(unnamed)",
6655
- url: ref.urls?.[0]?.url ?? ref.url ?? "",
6656
- documentType: ref.documentType?.alias ?? ""
6657
- });
6658
- } else {
6659
- referencedBy.push({
6660
- id: ref.id,
6661
- name: ref.name ?? "(unnamed)",
6662
- url: "",
6663
- documentType: ""
6664
- });
6665
- }
6666
- }
6667
- }
7194
+ const referencedBy = refResult.ok ? await buildReferencedBy(refResult.data.items ?? []) : [];
6668
7195
  return createToolResult({
6669
7196
  id,
6670
7197
  name,
@@ -6676,18 +7203,18 @@ var tool93 = {
6676
7203
  }
6677
7204
  }
6678
7205
  };
6679
- var report_content_references_default = withStandardDecorators(tool93);
7206
+ var report_content_references_default = withStandardDecorators(tool105);
6680
7207
 
6681
7208
  // src/umbraco-api/tools/helpers/link-extractor.ts
6682
7209
  var UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
6683
- function isBlockListOrGridValue4(value) {
7210
+ function isBlockListOrGridValue3(value) {
6684
7211
  return value !== null && typeof value === "object" && !Array.isArray(value) && Array.isArray(value.contentData);
6685
7212
  }
6686
- function isRteWithBlocks4(value) {
7213
+ function isRteWithBlocks3(value) {
6687
7214
  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);
6688
7215
  }
6689
7216
  function isPlainRteValue(value) {
6690
- return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks4(value);
7217
+ return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.markup === "string" && !isRteWithBlocks3(value);
6691
7218
  }
6692
7219
  function extractHrefUrls(html) {
6693
7220
  const urls = [];
@@ -6797,7 +7324,7 @@ function extractLinksFromValues(values) {
6797
7324
  return;
6798
7325
  }
6799
7326
  if (typeof val === "object") {
6800
- if (isRteWithBlocks4(val)) {
7327
+ if (isRteWithBlocks3(val)) {
6801
7328
  processHtml(val.markup);
6802
7329
  const blockValues = extractBlockValues(val.blocks.contentData);
6803
7330
  for (const bv of blockValues) processValue(bv);
@@ -6807,7 +7334,7 @@ function extractLinksFromValues(values) {
6807
7334
  processHtml(val.markup);
6808
7335
  return;
6809
7336
  }
6810
- if (isBlockListOrGridValue4(val)) {
7337
+ if (isBlockListOrGridValue3(val)) {
6811
7338
  const blockValues = extractBlockValues(val.contentData);
6812
7339
  for (const bv of blockValues) processValue(bv);
6813
7340
  return;
@@ -6837,18 +7364,18 @@ async function resolveOutboundIds(candidateIds, excludeId) {
6837
7364
  const internalPages = [];
6838
7365
  const media = [];
6839
7366
  const filtered = excludeId ? candidateIds.filter((cid) => cid !== excludeId.toLowerCase()) : candidateIds;
7367
+ const urlsById = await fetchPrimaryPublishedUrlsBatch(filtered);
6840
7368
  await Promise.all(
6841
7369
  filtered.map(async (refId) => {
6842
7370
  try {
6843
7371
  const docResult = await chainCms("get-document-by-id", { id: refId });
6844
7372
  if (docResult.ok) {
6845
7373
  const refDoc = docResult.data;
6846
- const docExtra = refDoc;
6847
7374
  const docType = refDoc.documentType;
6848
7375
  internalPages.push({
6849
7376
  id: refId,
6850
7377
  name: refDoc.variants?.[0]?.name ?? "Unknown",
6851
- url: docExtra.urls?.[0]?.url ?? "",
7378
+ url: urlsById.get(refId) ?? "",
6852
7379
  documentType: docType?.alias ?? ""
6853
7380
  });
6854
7381
  return;
@@ -6874,10 +7401,10 @@ async function resolveOutboundIds(candidateIds, excludeId) {
6874
7401
  }
6875
7402
 
6876
7403
  // src/umbraco-api/tools/relationships/get/report-outbound-links.ts
6877
- var inputSchema94 = {
7404
+ var inputSchema106 = {
6878
7405
  id: z.string().uuid().describe("The ID of the page to analyze for outbound links")
6879
7406
  };
6880
- var outputSchema94 = z.object({
7407
+ var outputSchema106 = z.object({
6881
7408
  id: z.string(),
6882
7409
  name: z.string(),
6883
7410
  url: z.string(),
@@ -6909,11 +7436,11 @@ var outputSchema94 = z.object({
6909
7436
  totalLinks: z.number()
6910
7437
  })
6911
7438
  });
6912
- var tool94 = {
7439
+ var tool106 = {
6913
7440
  name: "report-outbound-links",
6914
7441
  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.",
6915
- inputSchema: inputSchema94,
6916
- outputSchema: outputSchema94,
7442
+ inputSchema: inputSchema106,
7443
+ outputSchema: outputSchema106,
6917
7444
  slices: ["read"],
6918
7445
  annotations: { readOnlyHint: true },
6919
7446
  handler: async ({ id }) => {
@@ -6922,7 +7449,7 @@ var tool94 = {
6922
7449
  const doc = result.data;
6923
7450
  const variant = doc.variants?.[0];
6924
7451
  const name = variant?.name ?? "Unknown";
6925
- const url = doc.urls?.[0]?.url ?? "";
7452
+ const url = await fetchPrimaryPublishedUrl(id);
6926
7453
  const values = doc.values ?? [];
6927
7454
  const links = extractLinksFromValues(values);
6928
7455
  const { internalPages, media } = await resolveOutboundIds(links.allIds, id);
@@ -6942,10 +7469,10 @@ var tool94 = {
6942
7469
  });
6943
7470
  }
6944
7471
  };
6945
- var report_outbound_links_default = withStandardDecorators(tool94);
7472
+ var report_outbound_links_default = withStandardDecorators(tool106);
6946
7473
 
6947
7474
  // src/umbraco-api/tools/relationships/index.ts
6948
- var collection19 = {
7475
+ var collection20 = {
6949
7476
  metadata: {
6950
7477
  name: "relationships",
6951
7478
  displayName: "Content Relationships",
@@ -6953,11 +7480,11 @@ var collection19 = {
6953
7480
  },
6954
7481
  tools: () => [report_content_references_default, report_outbound_links_default]
6955
7482
  };
6956
- var relationships_default = collection19;
6957
- var inputSchema95 = {
7483
+ var relationships_default = collection20;
7484
+ var inputSchema107 = {
6958
7485
  id: z.string().uuid().describe("The ID of the content page to read public access settings for")
6959
7486
  };
6960
- var outputSchema95 = z.object({
7487
+ var outputSchema107 = z.object({
6961
7488
  hasRestrictions: z.boolean().describe("True if the page has public access rules configured"),
6962
7489
  memberGroups: z.array(z.object({
6963
7490
  id: z.string(),
@@ -6968,11 +7495,11 @@ var outputSchema95 = z.object({
6968
7495
  errorPageId: z.string().nullable().describe("The ID of the page shown when an authenticated visitor is denied access"),
6969
7496
  message: z.string().describe("Human-readable summary of the access rules")
6970
7497
  });
6971
- var tool95 = {
7498
+ var tool107 = {
6972
7499
  name: "get-public-access",
6973
7500
  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.",
6974
- inputSchema: inputSchema95,
6975
- outputSchema: outputSchema95,
7501
+ inputSchema: inputSchema107,
7502
+ outputSchema: outputSchema107,
6976
7503
  slices: ["read"],
6977
7504
  annotations: { readOnlyHint: true },
6978
7505
  handler: async ({ id }) => {
@@ -7005,15 +7532,15 @@ var tool95 = {
7005
7532
  });
7006
7533
  }
7007
7534
  };
7008
- var get_public_access_default = withStandardDecorators(tool95);
7009
- var inputSchema96 = {
7535
+ var get_public_access_default = withStandardDecorators(tool107);
7536
+ var inputSchema108 = {
7010
7537
  id: z.string().uuid().describe("The ID of the content page to restrict"),
7011
7538
  memberGroupNames: z.array(z.string()).describe("Names of member groups allowed to view the page. Use list-member-groups to look up existing groups."),
7012
7539
  loginPageId: z.string().uuid().describe("The ID of the page visitors are redirected to when login is required"),
7013
7540
  errorPageId: z.string().uuid().describe("The ID of the page shown when an authenticated visitor is denied access"),
7014
7541
  memberUserNames: z.array(z.string()).optional().describe("Optional: specific member usernames allowed to view the page (in addition to group members)")
7015
7542
  };
7016
- var outputSchema96 = z.object({
7543
+ var outputSchema108 = z.object({
7017
7544
  message: z.string(),
7018
7545
  id: z.string(),
7019
7546
  memberGroupNames: z.array(z.string()),
@@ -7021,11 +7548,11 @@ var outputSchema96 = z.object({
7021
7548
  loginPageId: z.string(),
7022
7549
  errorPageId: z.string()
7023
7550
  });
7024
- var tool96 = {
7551
+ var tool108 = {
7025
7552
  name: "set-public-access",
7026
7553
  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.",
7027
- inputSchema: inputSchema96,
7028
- outputSchema: outputSchema96,
7554
+ inputSchema: inputSchema108,
7555
+ outputSchema: outputSchema108,
7029
7556
  slices: ["update"],
7030
7557
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
7031
7558
  handler: async ({ id, memberGroupNames, loginPageId, errorPageId, memberUserNames }, extra) => {
@@ -7063,19 +7590,19 @@ var tool96 = {
7063
7590
  });
7064
7591
  }
7065
7592
  };
7066
- var set_public_access_default = withStandardDecorators(tool96);
7067
- var inputSchema97 = {
7593
+ var set_public_access_default = withStandardDecorators(tool108);
7594
+ var inputSchema109 = {
7068
7595
  id: z.string().uuid().describe("The ID of the content page to remove public access restrictions from")
7069
7596
  };
7070
- var outputSchema97 = z.object({
7597
+ var outputSchema109 = z.object({
7071
7598
  message: z.string(),
7072
7599
  id: z.string()
7073
7600
  });
7074
- var tool97 = {
7601
+ var tool109 = {
7075
7602
  name: "remove-public-access",
7076
7603
  description: "Remove all public access restrictions from a content page, making it publicly viewable again. You will be asked to confirm.",
7077
- inputSchema: inputSchema97,
7078
- outputSchema: outputSchema97,
7604
+ inputSchema: inputSchema109,
7605
+ outputSchema: outputSchema109,
7079
7606
  slices: ["delete"],
7080
7607
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
7081
7608
  handler: async ({ id }, extra) => {
@@ -7090,10 +7617,10 @@ var tool97 = {
7090
7617
  });
7091
7618
  }
7092
7619
  };
7093
- var remove_public_access_default = withStandardDecorators(tool97);
7620
+ var remove_public_access_default = withStandardDecorators(tool109);
7094
7621
 
7095
7622
  // src/umbraco-api/tools/public-access/index.ts
7096
- var collection20 = {
7623
+ var collection21 = {
7097
7624
  metadata: {
7098
7625
  name: "public-access",
7099
7626
  displayName: "Public Access",
@@ -7101,7 +7628,7 @@ var collection20 = {
7101
7628
  },
7102
7629
  tools: () => [get_public_access_default, set_public_access_default, remove_public_access_default]
7103
7630
  };
7104
- var public_access_default = collection20;
7631
+ var public_access_default = collection21;
7105
7632
 
7106
7633
  // src/umbraco-api/tools/helpers/runtime.ts
7107
7634
  var isHostedRuntime = () => {
@@ -7111,7 +7638,7 @@ var isHostedRuntime = () => {
7111
7638
  };
7112
7639
 
7113
7640
  // src/umbraco-api/tools/notifications/get/get-content-notifications.ts
7114
- var inputSchema98 = {
7641
+ var inputSchema110 = {
7115
7642
  id: z.string().uuid().describe("UUID of the content page to read notification subscriptions for")
7116
7643
  };
7117
7644
  var subscriptionSchema = z.object({
@@ -7119,16 +7646,16 @@ var subscriptionSchema = z.object({
7119
7646
  alias: z.string().describe("Human-readable action alias (e.g. publish, unpublish, save, delete)"),
7120
7647
  subscribed: z.boolean().describe("True if the current user is subscribed to this action")
7121
7648
  });
7122
- var outputSchema98 = z.object({
7649
+ var outputSchema110 = z.object({
7123
7650
  id: z.string(),
7124
7651
  subscriptions: z.array(subscriptionSchema),
7125
7652
  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")
7126
7653
  });
7127
- var tool98 = {
7654
+ var tool110 = {
7128
7655
  name: "get-content-notifications",
7129
7656
  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.",
7130
- inputSchema: inputSchema98,
7131
- outputSchema: outputSchema98,
7657
+ inputSchema: inputSchema110,
7658
+ outputSchema: outputSchema110,
7132
7659
  slices: ["read"],
7133
7660
  annotations: { readOnlyHint: true },
7134
7661
  enabled: isHostedRuntime,
@@ -7144,21 +7671,21 @@ var tool98 = {
7144
7671
  return createToolResult({ id, subscriptions, subscribedActionIds });
7145
7672
  }
7146
7673
  };
7147
- var get_content_notifications_default = withStandardDecorators(tool98);
7148
- var inputSchema99 = {
7674
+ var get_content_notifications_default = withStandardDecorators(tool110);
7675
+ var inputSchema111 = {
7149
7676
  id: z.string().uuid().describe("UUID of the content page to update notification subscriptions for"),
7150
7677
  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.")
7151
7678
  };
7152
- var outputSchema99 = z.object({
7679
+ var outputSchema111 = z.object({
7153
7680
  message: z.string(),
7154
7681
  id: z.string(),
7155
7682
  subscribedActionIds: z.array(z.string())
7156
7683
  });
7157
- var tool99 = {
7684
+ var tool111 = {
7158
7685
  name: "set-content-notifications",
7159
7686
  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.",
7160
- inputSchema: inputSchema99,
7161
- outputSchema: outputSchema99,
7687
+ inputSchema: inputSchema111,
7688
+ outputSchema: outputSchema111,
7162
7689
  slices: ["update"],
7163
7690
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
7164
7691
  enabled: isHostedRuntime,
@@ -7176,10 +7703,10 @@ var tool99 = {
7176
7703
  });
7177
7704
  }
7178
7705
  };
7179
- var set_content_notifications_default = withStandardDecorators(tool99);
7706
+ var set_content_notifications_default = withStandardDecorators(tool111);
7180
7707
 
7181
7708
  // src/umbraco-api/tools/notifications/index.ts
7182
- var collection21 = {
7709
+ var collection22 = {
7183
7710
  metadata: {
7184
7711
  name: "notifications",
7185
7712
  displayName: "Content Notifications",
@@ -7187,7 +7714,7 @@ var collection21 = {
7187
7714
  },
7188
7715
  tools: () => isHostedRuntime() ? [get_content_notifications_default, set_content_notifications_default] : []
7189
7716
  };
7190
- var notifications_default = collection21;
7717
+ var notifications_default = collection22;
7191
7718
  var mediaTools = {
7192
7719
  listRoot: "get-recycle-bin-media-root",
7193
7720
  listChildren: "get-recycle-bin-media-children",
@@ -7250,13 +7777,13 @@ function formatNamePreview(names, total) {
7250
7777
  }
7251
7778
 
7252
7779
  // src/umbraco-api/tools/recycle-bin/get/list-recycle-bin.ts
7253
- var inputSchema100 = {
7780
+ var inputSchema112 = {
7254
7781
  type: z.enum(["content", "media"]).describe("Which recycle bin to list: content (pages) or media."),
7255
7782
  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."),
7256
7783
  take: z.number().optional().default(20).describe("Number of results to return (default 20)"),
7257
7784
  skip: z.number().optional().default(0).describe("Number of results to skip for pagination")
7258
7785
  };
7259
- var outputSchema100 = z.object({
7786
+ var outputSchema112 = z.object({
7260
7787
  items: z.array(z.object({
7261
7788
  id: z.string(),
7262
7789
  name: z.string(),
@@ -7265,11 +7792,11 @@ var outputSchema100 = z.object({
7265
7792
  })).describe("Trashed items at this level of the recycle bin"),
7266
7793
  total: z.number().describe("Total number of trashed items at this level (before pagination)")
7267
7794
  });
7268
- var tool100 = {
7795
+ var tool112 = {
7269
7796
  name: "list-recycle-bin",
7270
7797
  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.",
7271
- inputSchema: inputSchema100,
7272
- outputSchema: outputSchema100,
7798
+ inputSchema: inputSchema112,
7799
+ outputSchema: outputSchema112,
7273
7800
  slices: ["list", "tree"],
7274
7801
  annotations: { readOnlyHint: true },
7275
7802
  handler: async ({ type, parentId, take, skip }) => {
@@ -7292,22 +7819,22 @@ var tool100 = {
7292
7819
  });
7293
7820
  }
7294
7821
  };
7295
- var list_recycle_bin_default = withStandardDecorators(tool100);
7296
- var inputSchema101 = {
7822
+ var list_recycle_bin_default = withStandardDecorators(tool112);
7823
+ var inputSchema113 = {
7297
7824
  id: z.string().uuid().describe("ID of the trashed item to permanently delete."),
7298
7825
  type: z.enum(["content", "media"]).describe("Which recycle bin the item is in.")
7299
7826
  };
7300
- var outputSchema101 = z.object({
7827
+ var outputSchema113 = z.object({
7301
7828
  message: z.string(),
7302
7829
  id: z.string(),
7303
7830
  name: z.string(),
7304
7831
  descendantCount: z.number().optional().describe("Descendants also deleted when the item was a folder")
7305
7832
  });
7306
- var tool101 = {
7833
+ var tool113 = {
7307
7834
  name: "permanent-delete-recycle-bin-item",
7308
7835
  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.",
7309
- inputSchema: inputSchema101,
7310
- outputSchema: outputSchema101,
7836
+ inputSchema: inputSchema113,
7837
+ outputSchema: outputSchema113,
7311
7838
  slices: ["delete"],
7312
7839
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7313
7840
  handler: async ({ id, type }, extra) => {
@@ -7354,20 +7881,20 @@ var tool101 = {
7354
7881
  });
7355
7882
  }
7356
7883
  };
7357
- var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool101);
7358
- var inputSchema102 = {
7884
+ var permanent_delete_recycle_bin_item_default = withStandardDecorators(tool113);
7885
+ var inputSchema114 = {
7359
7886
  type: z.enum(["content", "media"]).describe("Which recycle bin to empty.")
7360
7887
  };
7361
- var outputSchema102 = z.object({
7888
+ var outputSchema114 = z.object({
7362
7889
  message: z.string(),
7363
7890
  type: z.enum(["content", "media"]),
7364
7891
  topLevelCount: z.number().describe("Number of top-level items that were in the bin before emptying (descendants are not counted).")
7365
7892
  });
7366
- var tool102 = {
7893
+ var tool114 = {
7367
7894
  name: "empty-recycle-bin",
7368
7895
  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.",
7369
- inputSchema: inputSchema102,
7370
- outputSchema: outputSchema102,
7896
+ inputSchema: inputSchema114,
7897
+ outputSchema: outputSchema114,
7371
7898
  slices: ["delete"],
7372
7899
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
7373
7900
  handler: async ({ type }, extra) => {
@@ -7412,10 +7939,10 @@ var tool102 = {
7412
7939
  });
7413
7940
  }
7414
7941
  };
7415
- var empty_recycle_bin_default = withStandardDecorators(tool102);
7942
+ var empty_recycle_bin_default = withStandardDecorators(tool114);
7416
7943
 
7417
7944
  // src/umbraco-api/tools/recycle-bin/index.ts
7418
- var collection22 = {
7945
+ var collection23 = {
7419
7946
  metadata: {
7420
7947
  name: "recycle-bin",
7421
7948
  displayName: "Recycle Bin",
@@ -7423,9 +7950,9 @@ var collection22 = {
7423
7950
  },
7424
7951
  tools: () => [list_recycle_bin_default, permanent_delete_recycle_bin_item_default, empty_recycle_bin_default]
7425
7952
  };
7426
- var recycle_bin_default = collection22;
7427
- var inputSchema103 = {};
7428
- var outputSchema103 = z.object({
7953
+ var recycle_bin_default = collection23;
7954
+ var inputSchema115 = {};
7955
+ var outputSchema115 = z.object({
7429
7956
  id: z.string(),
7430
7957
  name: z.string(),
7431
7958
  userName: z.string(),
@@ -7447,11 +7974,11 @@ var outputSchema103 = z.object({
7447
7974
  documentStartNodeIds: z.array(z.string()).describe("Content node IDs the user is restricted to. Empty when hasDocumentRootAccess is true."),
7448
7975
  mediaStartNodeIds: z.array(z.string()).describe("Media node IDs the user is restricted to. Empty when hasMediaRootAccess is true.")
7449
7976
  });
7450
- var tool103 = {
7977
+ var tool115 = {
7451
7978
  name: "get-current-user",
7452
7979
  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.",
7453
- inputSchema: inputSchema103,
7454
- outputSchema: outputSchema103,
7980
+ inputSchema: inputSchema115,
7981
+ outputSchema: outputSchema115,
7455
7982
  slices: ["read"],
7456
7983
  annotations: { readOnlyHint: true },
7457
7984
  handler: async () => {
@@ -7490,10 +8017,10 @@ var tool103 = {
7490
8017
  });
7491
8018
  }
7492
8019
  };
7493
- var get_current_user_default = withStandardDecorators(tool103);
8020
+ var get_current_user_default = withStandardDecorators(tool115);
7494
8021
 
7495
8022
  // src/umbraco-api/tools/account/index.ts
7496
- var collection23 = {
8023
+ var collection24 = {
7497
8024
  metadata: {
7498
8025
  name: "account",
7499
8026
  displayName: "Account",
@@ -7501,7 +8028,7 @@ var collection23 = {
7501
8028
  },
7502
8029
  tools: () => [get_current_user_default]
7503
8030
  };
7504
- var account_default = collection23;
8031
+ var account_default = collection24;
7505
8032
 
7506
8033
  // src/config/mode-registry.ts
7507
8034
  var toolModes = [
@@ -7517,6 +8044,12 @@ var toolModes = [
7517
8044
  description: "Browse, search, upload, and manage media files and folders",
7518
8045
  collections: ["media", "media-management"]
7519
8046
  },
8047
+ {
8048
+ name: "library",
8049
+ displayName: "Library Elements",
8050
+ description: "Browse, view, and manage reusable Library elements (Umbraco 18 Library section)",
8051
+ collections: ["element"]
8052
+ },
7520
8053
  {
7521
8054
  name: "blueprints",
7522
8055
  displayName: "Blueprints",
@@ -7627,6 +8160,7 @@ var collections = [
7627
8160
  versioning_default,
7628
8161
  media_default,
7629
8162
  media_management_default,
8163
+ element_default,
7630
8164
  blueprint_default,
7631
8165
  language_default,
7632
8166
  translation_default,