@cplace/mcp-server 1.7.11 → 1.8.5

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.
Files changed (62) hide show
  1. package/dist/searchConversion.js +1 -1
  2. package/dist/searchConversion.js.map +1 -1
  3. package/dist/tools/board-widget.d.ts +50 -10
  4. package/dist/tools/board-widget.d.ts.map +1 -1
  5. package/dist/tools/common-schemas.d.ts +4 -5
  6. package/dist/tools/common-schemas.d.ts.map +1 -1
  7. package/dist/tools/common-schemas.js +39 -21
  8. package/dist/tools/common-schemas.js.map +1 -1
  9. package/dist/tools/csv-export.d.ts +472 -4
  10. package/dist/tools/csv-export.d.ts.map +1 -1
  11. package/dist/tools/csv-export.js +4 -8
  12. package/dist/tools/csv-export.js.map +1 -1
  13. package/dist/tools/jobs.d.ts +2 -2
  14. package/dist/tools/jobs.d.ts.map +1 -1
  15. package/dist/tools/jobs.js +3 -2
  16. package/dist/tools/jobs.js.map +1 -1
  17. package/dist/tools/layout-richstring-shared.d.ts +5 -0
  18. package/dist/tools/layout-richstring-shared.d.ts.map +1 -0
  19. package/dist/tools/layout-richstring-shared.js +35 -0
  20. package/dist/tools/layout-richstring-shared.js.map +1 -0
  21. package/dist/tools/layout-richstring-translator.d.ts +36 -0
  22. package/dist/tools/layout-richstring-translator.d.ts.map +1 -0
  23. package/dist/tools/layout-richstring-translator.js +695 -0
  24. package/dist/tools/layout-richstring-translator.js.map +1 -0
  25. package/dist/tools/layout-richstring-widgets.d.ts +6 -112
  26. package/dist/tools/layout-richstring-widgets.d.ts.map +1 -1
  27. package/dist/tools/layout-richstring-widgets.js +9 -204
  28. package/dist/tools/layout-richstring-widgets.js.map +1 -1
  29. package/dist/tools/layout.d.ts +64 -16
  30. package/dist/tools/layout.d.ts.map +1 -1
  31. package/dist/tools/layout.js +77 -16
  32. package/dist/tools/layout.js.map +1 -1
  33. package/dist/tools/pages.d.ts +2 -2
  34. package/dist/tools/pages.d.ts.map +1 -1
  35. package/dist/tools/pages.js +3 -12
  36. package/dist/tools/pages.js.map +1 -1
  37. package/dist/tools/resource-planner-widget.d.ts +54 -14
  38. package/dist/tools/resource-planner-widget.d.ts.map +1 -1
  39. package/dist/tools/resource-planner-widget.js +52 -13
  40. package/dist/tools/resource-planner-widget.js.map +1 -1
  41. package/dist/tools/search.d.ts +476 -8
  42. package/dist/tools/search.d.ts.map +1 -1
  43. package/dist/tools/search.js +8 -12
  44. package/dist/tools/search.js.map +1 -1
  45. package/dist/tools/system.d.ts.map +1 -1
  46. package/dist/tools/system.js +2 -1
  47. package/dist/tools/system.js.map +1 -1
  48. package/dist/tools/type-management.js +1 -1
  49. package/dist/tools/type-management.js.map +1 -1
  50. package/dist/tools/version-history.d.ts +4 -4
  51. package/dist/tools/version-history.d.ts.map +1 -1
  52. package/dist/tools/version-history.js +5 -4
  53. package/dist/tools/version-history.js.map +1 -1
  54. package/dist/tools/widgets.d.ts +2 -2
  55. package/dist/tools/widgets.d.ts.map +1 -1
  56. package/dist/tools/widgets.js +3 -2
  57. package/dist/tools/widgets.js.map +1 -1
  58. package/dist/tools/workspace-core.d.ts +2 -2
  59. package/dist/tools/workspace-core.d.ts.map +1 -1
  60. package/dist/tools/workspace-core.js +3 -2
  61. package/dist/tools/workspace-core.js.map +1 -1
  62. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
3
  import { CplaceApiClient } from '../api.js';
4
- export declare const LayoutContextSchema: z.ZodUnion<[z.ZodObject<{
4
+ export declare const LayoutContextSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
5
5
  type: z.ZodLiteral<"page">;
6
6
  pageUID: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
@@ -25,12 +25,20 @@ export declare const LayoutContextSchema: z.ZodUnion<[z.ZodObject<{
25
25
  workspaceId: string;
26
26
  typeInternalName: string;
27
27
  alternativeLayoutName?: string | undefined;
28
- }>]>;
28
+ }>]>, {
29
+ type: "page";
30
+ pageUID: string;
31
+ } | {
32
+ type: "type";
33
+ workspaceId: string;
34
+ typeInternalName: string;
35
+ alternativeLayoutName?: string | undefined;
36
+ }, unknown>;
29
37
  export declare const LAYOUT_TOOL_DEFINITIONS: {
30
38
  readonly cplace_execute_layout_script: {
31
- readonly description: "Execute a layout script — either a full layout.define() replacement or per-widget edit verbs.\n\nTWO MODES (determined by script content):\n\nMODE 1 — FULL REPLACE (layout.define):\n- Script calls layout.define() exactly once to declare the complete layout structure\n- Replaces the entire layout atomically\n- Same behavior as before\n\nMODE 2 — EDIT VERBS (per-widget):\n- Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget(), layout.moveWidget(), layout.addRow(), layout.compact()\n- Each call collects an operation; all operations commit atomically or fail together\n- Cannot mix layout.define() with edit verbs in the same script\n\nEDIT VERBS:\n layout.updateWidget(\"widgetId\", { \"cf.cplace.x\": newValue }) — partial config merge (only specified keys change)\n layout.addWidget({ widgetType: \"cf.platform.wiki\", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 }, configuration: { ... } })\n layout.removeWidget(\"widgetId\")\n layout.moveWidget(\"widgetId\", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 })\n layout.addRow(rowIndex, [6, 6]) — column proportions must sum to 12\n layout.compact() — remove empty rows\n\nWORKFLOW for per-widget edit:\n1. Read: cplace_get_layout_script with widgetIds to get layout.updateWidget() fragments\n2. Edit: modify the config values in the fragment\n3. Execute: post the modified script via this tool\n\nKEY BEHAVIORS (for layout.define mode):\n- The script must call layout.define() exactly once\n- The entire layout is atomically replaced — previous layout is fully overwritten\n- Script timeout: 30 seconds\n- Widget IDs: auto-generated if omitted; if provided without '_' prefix, '_' is prepended automatically\n\nRESPONSE OUTCOMES:\n- VALID_COMPLETE: Layout saved, all widgets fully configured\n- VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)\n- Validation errors: Layout NOT saved — structural or widget errors returned with details\n- Generic errors: Entity not found, permission denied, script errors\n\nVALIDATION FEEDBACK:\n- Structural errors: invalid column proportions (must be 3-12 each, sum to 12 per row)\n- Widget errors: unknown widget types, invalid configurations\n- Warnings: widgets saved but missing optional configuration (e.g., search filter not set)\n\nTIP: After a VALID_INCOMPLETE response, re-run layout.define() with corrected widget configuration to resolve warnings.\n\nCOMMON WIDGET TYPES (platform, always available):\ncf.platform.attributes, cf.cplace.platform.attributesGroup,\ncf.platform.wiki, cf.platform.richString, cf.cplace.demoWidgets.demoRichString,\ncf.platform.embeddedSearchAsTable, cf.cplace.platform.tableWidget,\ncf.platform.connectedBarChart, cf.platform.connectedPieChart,\ncf.platform.connectedMatrix, cf.platform.connectedTableFilter,\ncf.platform.incomingReferences, cf.platform.comments, cf.platform.files,\ncf.cplace.visualizations.scriptingHighcharts\n\nFor app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext \"AS_WIDGET\".";
39
+ readonly description: "Execute a layout script — either a full layout.define() replacement or per-widget edit verbs.\n\nTWO MODES (determined by script content):\n\nMODE 1 — FULL REPLACE (layout.define):\n- Script calls layout.define() exactly once to declare the complete layout structure\n- Replaces the entire layout atomically\n- Same behavior as before\n\nMODE 2 — EDIT VERBS (per-widget):\n- Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget(), layout.moveWidget(), layout.addRow(), layout.compact()\n- Each call collects an operation; all operations commit atomically or fail together\n- Cannot mix layout.define() with edit verbs in the same script\n\nEDIT VERBS:\n layout.updateWidget(\"widgetId\", { \"cf.cplace.x\": newValue }) — partial config merge (only specified keys change)\n layout.addWidget({ widgetType: \"cf.platform.wiki\", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 }, configuration: { ... } })\n layout.removeWidget(\"widgetId\")\n layout.moveWidget(\"widgetId\", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 })\n layout.addRow(rowIndex, [6, 6]) — column proportions must sum to 12\n layout.compact() — remove empty rows\n\nWORKFLOW for per-widget edit:\n1. Read: cplace_get_layout_script with widgetIds to get layout.updateWidget() fragments\n2. Edit: modify the config values in the fragment\n3. Execute: post the modified script via this tool\n\nKEY BEHAVIORS (for layout.define mode):\n- The script must call layout.define() exactly once\n- The entire layout is atomically replaced — previous layout is fully overwritten\n- Script timeout: 30 seconds\n- Widget IDs: MUST be omitted from layout.define. Ids are assigned by the server and returned in the response. Use the returned id in subsequent layout.updateWidget() calls.\n\nRESPONSE OUTCOMES:\n- VALID_COMPLETE: Layout saved, all widgets fully configured\n- VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)\n- Validation errors: Layout NOT saved — structural or widget errors returned with details\n- Generic errors: Entity not found, permission denied, script errors\n\nVALIDATION FEEDBACK:\n- Structural errors: invalid column proportions (must be 3-12 each, sum to 12 per row)\n- Widget errors: unknown widget types, invalid configurations\n- Warnings: widgets saved but missing optional configuration (e.g., search filter not set)\n\nTIP: After a VALID_INCOMPLETE response, re-run layout.define() with corrected widget configuration to resolve warnings.\n\nCOMMON WIDGET TYPES (platform, always available):\ncf.platform.attributes, cf.cplace.platform.attributesGroup,\ncf.platform.wiki, cf.platform.richString, cf.cplace.demoWidgets.demoRichString,\ncf.platform.embeddedSearchAsTable, cf.cplace.platform.tableWidget,\ncf.platform.connectedBarChart, cf.platform.connectedPieChart,\ncf.platform.connectedMatrix, cf.platform.connectedTableFilter,\ncf.platform.incomingReferences, cf.platform.comments, cf.platform.files,\ncf.cplace.visualizations.scriptingHighcharts\n\nFor app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext \"AS_WIDGET\".\n\nRICHSTRING WIDGETS AND EMBEDDED WIDGETS (decoded form):\nRichString widgets (cf.platform.richString, cf.cplace.demoWidgets.demoRichString)\nhold HTML in their 'content' config. Embedded widgets inside that HTML are\nexpressed in decoded form:\n <embeddedwidget id=\"id_w1\" type=\"cf.platform.singleAttribute\">{\"properties\":{\"attribute\":\"name\"}}</embeddedwidget>\n\nSemantics when submitting a script:\n • Tag with an existing id + same type → update (properties replace current)\n • Tag without id → insert new embedded widget (backend assigns id)\n • Existing id omitted from new content → delete\n • Unknown id, duplicate id, or type change for same id → error\n\nRaw base64 <embeddedwidget>BASE64</embeddedwidget> tags are REJECTED on writes.\nFetch current decoded form via cplace_get_layout_script.\n\nIMPORTANT: Decoded <embeddedwidget> tags must appear directly inline in a content: value.\nDo NOT build the tag in a variable and pass it — the parser rejects tags outside content: literals.\n ✅ layout.updateWidget(\"id\", { content: '<embeddedwidget type=\"...\">...</embeddedwidget>' });\n ❌ var tag = '<embeddedwidget ...>...</embeddedwidget>'; layout.updateWidget(\"id\", { content: tag });\n\nFor atomic single-embedded-widget edits without rewriting the full script,\nsee cplace_layout_richstring_* tools.";
32
40
  readonly inputSchema: {
33
- readonly context: z.ZodUnion<[z.ZodObject<{
41
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
34
42
  type: z.ZodLiteral<"page">;
35
43
  pageUID: z.ZodString;
36
44
  }, "strip", z.ZodTypeAny, {
@@ -54,7 +62,15 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
54
62
  workspaceId: string;
55
63
  typeInternalName: string;
56
64
  alternativeLayoutName?: string | undefined;
57
- }>]>;
65
+ }>]>, {
66
+ type: "page";
67
+ pageUID: string;
68
+ } | {
69
+ type: "type";
70
+ workspaceId: string;
71
+ typeInternalName: string;
72
+ alternativeLayoutName?: string | undefined;
73
+ }, unknown>;
58
74
  readonly script: z.ZodString;
59
75
  };
60
76
  readonly annotations: {
@@ -64,7 +80,7 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
64
80
  readonly cplace_get_layout_overview: {
65
81
  readonly description: "Get layout structure for page or type. Provides an overview of the layout grid including rows, columns, and widget summaries for both page and type layouts.";
66
82
  readonly inputSchema: {
67
- readonly context: z.ZodUnion<[z.ZodObject<{
83
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
68
84
  type: z.ZodLiteral<"page">;
69
85
  pageUID: z.ZodString;
70
86
  }, "strip", z.ZodTypeAny, {
@@ -88,16 +104,24 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
88
104
  workspaceId: string;
89
105
  typeInternalName: string;
90
106
  alternativeLayoutName?: string | undefined;
91
- }>]>;
107
+ }>]>, {
108
+ type: "page";
109
+ pageUID: string;
110
+ } | {
111
+ type: "type";
112
+ workspaceId: string;
113
+ typeInternalName: string;
114
+ alternativeLayoutName?: string | undefined;
115
+ }, unknown>;
92
116
  };
93
117
  readonly annotations: {
94
118
  readonly title: "Get Layout Overview";
95
119
  };
96
120
  };
97
121
  readonly cplace_get_layout_widget_details: {
98
- readonly description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.";
122
+ readonly description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.\n\nRichString widget content appears in decoded form: `<embeddedwidget id=\"…\" type=\"…\">{\"properties\":{…}}</embeddedwidget>` — no base64.";
99
123
  readonly inputSchema: {
100
- readonly context: z.ZodUnion<[z.ZodObject<{
124
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
101
125
  type: z.ZodLiteral<"page">;
102
126
  pageUID: z.ZodString;
103
127
  }, "strip", z.ZodTypeAny, {
@@ -121,7 +145,15 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
121
145
  workspaceId: string;
122
146
  typeInternalName: string;
123
147
  alternativeLayoutName?: string | undefined;
124
- }>]>;
148
+ }>]>, {
149
+ type: "page";
150
+ pageUID: string;
151
+ } | {
152
+ type: "type";
153
+ workspaceId: string;
154
+ typeInternalName: string;
155
+ alternativeLayoutName?: string | undefined;
156
+ }, unknown>;
125
157
  readonly widgetId: z.ZodString;
126
158
  };
127
159
  readonly annotations: {
@@ -129,9 +161,9 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
129
161
  };
130
162
  };
131
163
  readonly cplace_get_layout_script: {
132
- readonly description: "Get the current layout as an executable script for a page or type layout.\n\nTWO MODES (determined by widgetIds parameter):\n\nWITHOUT widgetIds: Returns the full layout as a layout.define({...}) script (same as before).\n\nWITH widgetIds: Returns layout.updateWidget(\"id\", {config}) fragments for just the specified widgets.\nThe output is directly executable — post it back via cplace_execute_layout_script.\n\nROUND-TRIP WORKFLOW:\n1. GET: Use this tool (with widgetIds for selective read, without for full layout)\n2. EDIT: Modify the script as needed\n3. APPLY: Use cplace_execute_layout_script to apply";
164
+ readonly description: "Get the current layout as an executable script for a page or type layout.\n\nTWO MODES (determined by widgetIds parameter):\n\nWITHOUT widgetIds: Returns the full layout as a layout.define({...}) script (same as before).\n\nWITH widgetIds: Returns layout.updateWidget(\"id\", {config}) fragments for just the specified widgets.\nThe output is directly executable — post it back via cplace_execute_layout_script.\n\nROUND-TRIP WORKFLOW:\n1. GET: Use this tool (with widgetIds for selective read, without for full layout)\n2. EDIT: Modify the script as needed\n3. APPLY: Use cplace_execute_layout_script to apply\n\nRichString widget content is returned in decoded form:\n <embeddedwidget id=\"…\" type=\"…\">{\"properties\":{…}}</embeddedwidget>\nThe output is directly executable — base64 tags are never emitted.";
133
165
  readonly inputSchema: {
134
- readonly context: z.ZodUnion<[z.ZodObject<{
166
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
135
167
  type: z.ZodLiteral<"page">;
136
168
  pageUID: z.ZodString;
137
169
  }, "strip", z.ZodTypeAny, {
@@ -155,7 +187,15 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
155
187
  workspaceId: string;
156
188
  typeInternalName: string;
157
189
  alternativeLayoutName?: string | undefined;
158
- }>]>;
190
+ }>]>, {
191
+ type: "page";
192
+ pageUID: string;
193
+ } | {
194
+ type: "type";
195
+ workspaceId: string;
196
+ typeInternalName: string;
197
+ alternativeLayoutName?: string | undefined;
198
+ }, unknown>;
159
199
  readonly widgetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
160
200
  };
161
201
  readonly annotations: {
@@ -163,9 +203,9 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
163
203
  };
164
204
  };
165
205
  readonly cplace_edit_layout: {
166
- readonly description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_execute_layout_script when making small changes to large layouts to avoid reproducing the entire definition.";
206
+ readonly description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_execute_layout_script when making small changes to large layouts to avoid reproducing the entire definition.\n\nRichString widget content is in decoded form. `old_str` must match the decoded form exactly as returned by cplace_get_layout_script. Raw base64 <embeddedwidget> tags are rejected in both `old_str` and `new_str`.";
167
207
  readonly inputSchema: {
168
- readonly context: z.ZodUnion<[z.ZodObject<{
208
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
169
209
  type: z.ZodLiteral<"page">;
170
210
  pageUID: z.ZodString;
171
211
  }, "strip", z.ZodTypeAny, {
@@ -189,7 +229,15 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
189
229
  workspaceId: string;
190
230
  typeInternalName: string;
191
231
  alternativeLayoutName?: string | undefined;
192
- }>]>;
232
+ }>]>, {
233
+ type: "page";
234
+ pageUID: string;
235
+ } | {
236
+ type: "type";
237
+ workspaceId: string;
238
+ typeInternalName: string;
239
+ alternativeLayoutName?: string | undefined;
240
+ }, unknown>;
193
241
  readonly old_str: z.ZodString;
194
242
  readonly new_str: z.ZodString;
195
243
  readonly replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;IAW0F,CAAC;AAa3H,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsM1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA+V7E"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAe5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAWgD,CAAC;AAajF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqO1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAqY7E"}
@@ -3,7 +3,9 @@ import { debugLogWithTag } from "../logger.js";
3
3
  import { checkResponseSize } from "../utils.js";
4
4
  import { applyStrReplace } from '../str-replace-utils.js';
5
5
  import { determineApiEndpoint, buildRequestParams, findWidgetById } from './widget-tool-helpers.js';
6
- export const LayoutContextSchema = z.union([
6
+ import { jsonStringToObject } from './common-schemas.js';
7
+ import { decodeRichStringsInLayout, decodeRichStringsInScript, encodeRichStringsInScript, containsRawBase64Tag, DecodedWidgetParseError } from './layout-richstring-translator.js';
8
+ export const LayoutContextSchema = jsonStringToObject(z.union([
7
9
  z.object({
8
10
  type: z.literal("page"),
9
11
  pageUID: z.string().describe("Page UID (e.g., 'page/abc123')")
@@ -14,7 +16,7 @@ export const LayoutContextSchema = z.union([
14
16
  typeInternalName: z.string().describe("Type internal name (e.g., 'cf.example.myType')"),
15
17
  alternativeLayoutName: z.string().optional().describe("Alternative layout name (optional)")
16
18
  })
17
- ]).describe("Layout target - specify whether operating on page or type layout (pass as a JSON object, NOT a JSON string)");
19
+ ]).describe("Layout target - specify whether operating on page or type layout"));
18
20
  const TOOL_EXECUTE_LAYOUT_SCRIPT = 'cplace_execute_layout_script';
19
21
  const TOOL_GET_LAYOUT_OVERVIEW = 'cplace_get_layout_overview';
20
22
  const TOOL_GET_LAYOUT_WIDGET_DETAILS = 'cplace_get_layout_widget_details';
@@ -53,7 +55,7 @@ KEY BEHAVIORS (for layout.define mode):
53
55
  - The script must call layout.define() exactly once
54
56
  - The entire layout is atomically replaced — previous layout is fully overwritten
55
57
  - Script timeout: 30 seconds
56
- - Widget IDs: auto-generated if omitted; if provided without '_' prefix, '_' is prepended automatically
58
+ - Widget IDs: MUST be omitted from layout.define. Ids are assigned by the server and returned in the response. Use the returned id in subsequent layout.updateWidget() calls.
57
59
 
58
60
  RESPONSE OUTCOMES:
59
61
  - VALID_COMPLETE: Layout saved, all widgets fully configured
@@ -77,7 +79,30 @@ cf.platform.connectedMatrix, cf.platform.connectedTableFilter,
77
79
  cf.platform.incomingReferences, cf.platform.comments, cf.platform.files,
78
80
  cf.cplace.visualizations.scriptingHighcharts
79
81
 
80
- For app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext "AS_WIDGET".`,
82
+ For app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext "AS_WIDGET".
83
+
84
+ RICHSTRING WIDGETS AND EMBEDDED WIDGETS (decoded form):
85
+ RichString widgets (cf.platform.richString, cf.cplace.demoWidgets.demoRichString)
86
+ hold HTML in their 'content' config. Embedded widgets inside that HTML are
87
+ expressed in decoded form:
88
+ <embeddedwidget id="id_w1" type="cf.platform.singleAttribute">{"properties":{"attribute":"name"}}</embeddedwidget>
89
+
90
+ Semantics when submitting a script:
91
+ • Tag with an existing id + same type → update (properties replace current)
92
+ • Tag without id → insert new embedded widget (backend assigns id)
93
+ • Existing id omitted from new content → delete
94
+ • Unknown id, duplicate id, or type change for same id → error
95
+
96
+ Raw base64 <embeddedwidget>BASE64</embeddedwidget> tags are REJECTED on writes.
97
+ Fetch current decoded form via cplace_get_layout_script.
98
+
99
+ IMPORTANT: Decoded <embeddedwidget> tags must appear directly inline in a content: value.
100
+ Do NOT build the tag in a variable and pass it — the parser rejects tags outside content: literals.
101
+ ✅ layout.updateWidget("id", { content: '<embeddedwidget type="...">...</embeddedwidget>' });
102
+ ❌ var tag = '<embeddedwidget ...>...</embeddedwidget>'; layout.updateWidget("id", { content: tag });
103
+
104
+ For atomic single-embedded-widget edits without rewriting the full script,
105
+ see cplace_layout_richstring_* tools.`,
81
106
  inputSchema: {
82
107
  context: LayoutContextSchema,
83
108
  script: z.string().describe(`JavaScript code that calls layout.define() exactly once OR one or more edit verbs.
@@ -91,7 +116,6 @@ layout.define({
91
116
  proportion: 6, // Column width: integer 3-12, all columns in a row must sum to 12
92
117
  widgets: [
93
118
  {
94
- id: "myWidget", // Optional: explicit widget ID (auto-prefixed with '_' if missing prefix)
95
119
  type: "cf.platform.embeddedSearchAsTable", // Required: widget type identifier
96
120
  config: { // Optional: widget configuration key-value pairs (use {en: "...", de: "..."} for localized strings)
97
121
  title: { en: "My Table", de: "Meine Tabelle" },
@@ -124,7 +148,7 @@ COLUMN PROPORTION RULES:
124
148
  - Common patterns: [12] (full width), [6,6] (two equal), [4,4,4] (three equal), [8,4] (main + sidebar), [3,9] (sidebar + main)
125
149
 
126
150
  WIDGET FIELDS (for layout.define):
127
- - id (optional): Explicit widget ID. Auto-prefixed with '_' if it doesn't start with '_'. Auto-generated if omitted.
151
+ - id: Do NOT provide. Ids are assigned by the server and returned in the response.
128
152
  - type (required): Widget type identifier (e.g., 'cf.platform.wiki', 'cf.platform.embeddedSearchAsTable', 'cf.platform.comments', 'cf.platform.files')
129
153
  - config (optional): Key-value object of widget configuration. Keys are config attribute names from cplace_get_widget_definition. IMPORTANT: Attribute names vary per widget type — some use short names (e.g., 'search', 'height'), others use fully-qualified names (e.g., 'cf.cplace.platform.attributesGroup.localizedTitle'). Do NOT guess attribute names — call cplace_get_widget_definition with includeDetails: true first. Omit 'cf.platform.entity' entirely (it defaults to the current page; passing empty causes errors). Values are strings, numbers, booleans, or objects. For localizedString attributes, use locale keys: { en: "English", de: "German" }.
130
154
  - embeddedLayouts (optional): Object mapping layout attribute names to nested layout specs. Used for container widgets (tab groups, attributes groups).
@@ -169,7 +193,12 @@ layout.define({
169
193
  });
170
194
 
171
195
  Per-widget edit example:
172
- layout.updateWidget("myTable", { "height": 800 });`)
196
+ layout.updateWidget("myTable", { "height": 800 });
197
+
198
+ EMBEDDED WIDGET CONSTRAINT:
199
+ <embeddedwidget> tags must appear directly inline in content: string literals — not in variables.
200
+ ✅ layout.updateWidget("id", { content: '<embeddedwidget ...>...</embeddedwidget>' });
201
+ ❌ var tag = '<embeddedwidget ...>'; layout.updateWidget("id", { content: tag });`)
173
202
  },
174
203
  annotations: { title: "Execute Layout Script" }
175
204
  },
@@ -181,7 +210,7 @@ layout.updateWidget("myTable", { "height": 800 });`)
181
210
  annotations: { title: "Get Layout Overview" }
182
211
  },
183
212
  [TOOL_GET_LAYOUT_WIDGET_DETAILS]: {
184
- description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.",
213
+ description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.\n\nRichString widget content appears in decoded form: `<embeddedwidget id=\"…\" type=\"…\">{\"properties\":{…}}</embeddedwidget>` — no base64.",
185
214
  inputSchema: {
186
215
  context: LayoutContextSchema,
187
216
  widgetId: z.string().describe("The unique widget identifier to get details for")
@@ -201,7 +230,11 @@ The output is directly executable — post it back via cplace_execute_layout_scr
201
230
  ROUND-TRIP WORKFLOW:
202
231
  1. GET: Use this tool (with widgetIds for selective read, without for full layout)
203
232
  2. EDIT: Modify the script as needed
204
- 3. APPLY: Use cplace_execute_layout_script to apply`,
233
+ 3. APPLY: Use cplace_execute_layout_script to apply
234
+
235
+ RichString widget content is returned in decoded form:
236
+ <embeddedwidget id="…" type="…">{"properties":{…}}</embeddedwidget>
237
+ The output is directly executable — base64 tags are never emitted.`,
205
238
  inputSchema: {
206
239
  context: LayoutContextSchema,
207
240
  widgetIds: z.array(z.string()).optional().describe("Optional list of widget IDs to read. When provided, returns layout.updateWidget() fragments for just those widgets instead of the full layout.define() script. Widget IDs can be found via cplace_get_layout_overview.")
@@ -209,7 +242,7 @@ ROUND-TRIP WORKFLOW:
209
242
  annotations: { title: "Get Layout Script" }
210
243
  },
211
244
  [TOOL_EDIT_LAYOUT]: {
212
- description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_execute_layout_script when making small changes to large layouts to avoid reproducing the entire definition.",
245
+ description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_execute_layout_script when making small changes to large layouts to avoid reproducing the entire definition.\n\nRichString widget content is in decoded form. `old_str` must match the decoded form exactly as returned by cplace_get_layout_script. Raw base64 <embeddedwidget> tags are rejected in both `old_str` and `new_str`.",
213
246
  inputSchema: {
214
247
  context: LayoutContextSchema,
215
248
  old_str: z.string().describe("The exact text to find in the layout definition (must match exactly, including whitespace and line breaks)"),
@@ -232,11 +265,12 @@ export function registerLayoutTools(server, client) {
232
265
  const endpoint = context.type === "page"
233
266
  ? "json/page/layoutScript"
234
267
  : "json/type/layoutScript";
268
+ const encodedScript = await encodeRichStringsInScript(client, context, script);
235
269
  let requestBody;
236
270
  if (context.type === "page") {
237
271
  requestBody = {
238
272
  pageUID: context.pageUID,
239
- script
273
+ script: encodedScript
240
274
  };
241
275
  }
242
276
  else {
@@ -244,13 +278,16 @@ export function registerLayoutTools(server, client) {
244
278
  workspaceId: context.workspaceId,
245
279
  typeInternalName: context.typeInternalName,
246
280
  ...(context.alternativeLayoutName && { alternativeLayoutName: context.alternativeLayoutName }),
247
- script
281
+ script: encodedScript
248
282
  };
249
283
  }
250
284
  const rawResponse = await client.makeRawApiRequest(endpoint, 'POST', undefined, requestBody);
251
285
  debugLogWithTag('EXECUTE_LAYOUT_SCRIPT', `Raw response success: ${rawResponse.success}, status: ${rawResponse.status || 'N/A'}`);
252
286
  let response;
253
287
  if (rawResponse.success === true) {
288
+ if (rawResponse.result) {
289
+ await decodeRichStringsInLayout(client, rawResponse.result);
290
+ }
254
291
  response = {
255
292
  operation: "EXECUTE_LAYOUT_SCRIPT",
256
293
  success: true,
@@ -315,6 +352,12 @@ export function registerLayoutTools(server, client) {
315
352
  }
316
353
  catch (error) {
317
354
  debugLogWithTag('EXECUTE_LAYOUT_SCRIPT', `Error: ${error instanceof Error ? error.message : String(error)}`);
355
+ if (error instanceof DecodedWidgetParseError) {
356
+ return {
357
+ content: [{ type: "text", text: error.message }],
358
+ isError: true
359
+ };
360
+ }
318
361
  return {
319
362
  content: [{
320
363
  type: "text",
@@ -364,6 +407,7 @@ export function registerLayoutTools(server, client) {
364
407
  debugLogWithTag('LAYOUT', `Getting widget details for ${widgetId} from ${context.type} layout`);
365
408
  try {
366
409
  const layoutResult = await getLayoutOverview(client, context);
410
+ await decodeRichStringsInLayout(client, layoutResult);
367
411
  const foundWidget = findWidgetById(layoutResult.rows, widgetId);
368
412
  if (!foundWidget) {
369
413
  return {
@@ -412,10 +456,11 @@ export function registerLayoutTools(server, client) {
412
456
  isError: true
413
457
  };
414
458
  }
459
+ const decodedScript = await decodeRichStringsInScript(client, rawResponse.script);
415
460
  const response = {
416
461
  context,
417
462
  ...(widgetIds && { widgetIds }),
418
- script: rawResponse.script
463
+ script: decodedScript
419
464
  };
420
465
  const sizeCheck = checkResponseSize(response);
421
466
  if (sizeCheck.tooLarge) {
@@ -445,6 +490,15 @@ export function registerLayoutTools(server, client) {
445
490
  server.registerTool(TOOL_EDIT_LAYOUT, LAYOUT_TOOL_DEFINITIONS[TOOL_EDIT_LAYOUT], async ({ context, old_str, new_str, replace_all = false }) => {
446
491
  debugLogWithTag('EDIT_LAYOUT', `Editing ${context.type} layout`);
447
492
  try {
493
+ if (containsRawBase64Tag(old_str) || containsRawBase64Tag(new_str)) {
494
+ return {
495
+ content: [{
496
+ type: "text",
497
+ text: 'Raw base64 <embeddedwidget> tags are not accepted in str_replace. Use the decoded form:\n <embeddedwidget id="…" type="…">{"properties":{…}}</embeddedwidget>\nFetch the current decoded form via cplace_get_layout_script.'
498
+ }],
499
+ isError: true
500
+ };
501
+ }
448
502
  const readEndpoint = context.type === "page"
449
503
  ? "json/page/layoutScript"
450
504
  : "json/type/layoutScript";
@@ -456,7 +510,7 @@ export function registerLayoutTools(server, client) {
456
510
  isError: true
457
511
  };
458
512
  }
459
- const currentScript = rawResponse.script;
513
+ const currentScript = await decodeRichStringsInScript(client, rawResponse.script);
460
514
  if (currentScript === undefined || currentScript === null || currentScript === '') {
461
515
  return {
462
516
  content: [{ type: "text", text: `Error: No layout definition found for this ${context.type}. Use cplace_execute_layout_script to create a new layout.` }],
@@ -470,16 +524,17 @@ export function registerLayoutTools(server, client) {
470
524
  isError: true
471
525
  };
472
526
  }
527
+ const encodedNewScript = await encodeRichStringsInScript(client, context, result.newContent);
473
528
  let writeBody;
474
529
  if (context.type === "page") {
475
- writeBody = { pageUID: context.pageUID, script: result.newContent };
530
+ writeBody = { pageUID: context.pageUID, script: encodedNewScript };
476
531
  }
477
532
  else {
478
533
  writeBody = {
479
534
  workspaceId: context.workspaceId,
480
535
  typeInternalName: context.typeInternalName,
481
536
  ...(context.alternativeLayoutName && { alternativeLayoutName: context.alternativeLayoutName }),
482
- script: result.newContent
537
+ script: encodedNewScript
483
538
  };
484
539
  }
485
540
  const writeResponse = await client.makeRawApiRequest(readEndpoint, 'POST', undefined, writeBody);
@@ -502,6 +557,12 @@ export function registerLayoutTools(server, client) {
502
557
  }
503
558
  catch (error) {
504
559
  debugLogWithTag('EDIT_LAYOUT', `Error: ${error instanceof Error ? error.message : String(error)}`);
560
+ if (error instanceof DecodedWidgetParseError) {
561
+ return {
562
+ content: [{ type: "text", text: error.message }],
563
+ isError: true
564
+ };
565
+ }
505
566
  return {
506
567
  content: [{ type: "text", text: `Error editing layout: ${error instanceof Error ? error.message : String(error)}` }],
507
568
  isError: true
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGpG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;KAC/D,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QACvE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACvF,qBAAqB,EAAE,CA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AAI,CAAC,SAAS,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAEjO,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;aAChD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAe,CAAC,aAAa,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACnG,IAAI,KAAK,YAAY,uBAAuB,EAAE,CAAC;gBAC7C,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;oBAChD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBACpH,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -60,8 +60,8 @@ export declare const PAGE_TOOL_DEFINITIONS: {
60
60
  readonly name: z.ZodOptional<z.ZodString>;
61
61
  readonly parentUID: z.ZodOptional<z.ZodString>;
62
62
  readonly content: z.ZodOptional<z.ZodString>;
63
- readonly attributes: z.ZodOptional<z.ZodAny>;
64
- readonly builtinAttributes: z.ZodOptional<z.ZodAny>;
63
+ readonly attributes: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, unknown>;
64
+ readonly builtinAttributes: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, unknown>;
65
65
  };
66
66
  readonly annotations: {
67
67
  readonly title: "Manage Page";
@@ -1 +1 @@
1
- {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/tools/pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAc5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFxB,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAuY3E"}
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/tools/pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAc5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFxB,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA4X3E"}
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { debugLogWithTag } from "../logger.js";
3
3
  import { checkResponseSize } from '../utils.js';
4
- import { DATE_TIME_FORMAT_DESCRIPTION, validateNotJsonString } from "./common-schemas.js";
4
+ import { DATE_TIME_FORMAT_DESCRIPTION, jsonStringToObject } from "./common-schemas.js";
5
5
  import { applyStrReplace } from '../str-replace-utils.js';
6
6
  const TOOL_DELETE_PAGE = 'cplace_delete_page';
7
7
  const TOOL_DELETE_PAGE_WITH_CHILDREN = 'cplace_delete_page_with_children';
@@ -59,7 +59,7 @@ export const PAGE_TOOL_DEFINITIONS = {
59
59
  name: z.string().optional().describe("Page name. For create operations: optional if type has name generation pattern (auto-generates from pattern), otherwise required. For update operations: optional. Name generation pattern syntax: <attributeName> for attribute values, {###} for sequential counter, {0000} for zero-padded counter. Example: '<title>-{0000}' generates 'ProjectAlpha-0001'. Provide explicit name to override pattern. Use cplace_get_type_datamodel to check if type supports name generation."),
60
60
  parentUID: z.string().optional().describe("Parent page UID for hierarchy. For create: sets initial parent. For update: moves page (use empty string to remove parent)."),
61
61
  content: z.string().optional().describe("HTML content for the page. Use HTML markup, not markdown - e.g. '<strong>bold</strong>' not '**bold**'. For update: use empty string to remove content."),
62
- attributes: z.any().optional().describe(`Pass as a JSON object (NOT \`customAttributes\`, NOT a JSON string). Custom attribute values as key-value pairs. 🔍 IMPORTANT: Use 'cplace_get_type_datamodel' tool first to understand attribute requirements and constraints. Supports:
62
+ attributes: jsonStringToObject(z.any().optional()).describe(`Pass as a JSON object (NOT \`customAttributes\`, NOT a JSON string). Custom attribute values as key-value pairs. 🔍 IMPORTANT: Use 'cplace_get_type_datamodel' tool first to understand attribute requirements and constraints. Supports:
63
63
  - String values: "text"
64
64
  - Numeric values: 42 or 3.14
65
65
  - Boolean values: true/false
@@ -76,7 +76,7 @@ The system automatically detects attribute types from the page type definition a
76
76
  - Proper multiplicity validation (single vs multi-valued)
77
77
  - Automatic type conversion and validation
78
78
  - Enhanced error messages with attribute-specific details`),
79
- builtinAttributes: z.any().optional().describe(`Builtin/mixin-provided attributes (optional for schedules). Supports:
79
+ builtinAttributes: jsonStringToObject(z.any().optional()).describe(`Builtin/mixin-provided attributes (optional for schedules). Supports:
80
80
  - owner: Person UID as string (e.g., "person/123abc456") - Sets/updates the page owner for schedules
81
81
  - For update only: Use null to remove builtin attribute values
82
82
 
@@ -104,15 +104,6 @@ export function registerPageTools(server, client) {
104
104
  server.registerTool(TOOL_MANAGE_PAGE, PAGE_TOOL_DEFINITIONS[TOOL_MANAGE_PAGE], async (params) => {
105
105
  const { operation } = params;
106
106
  debugLogWithTag('MANAGE_PAGE', `${operation} page operation`);
107
- for (const [paramName, value] of [
108
- ['attributes', params.attributes],
109
- ['builtinAttributes', params.builtinAttributes],
110
- ]) {
111
- const jsonStringError = validateNotJsonString(value, paramName, 'object');
112
- if (jsonStringError) {
113
- return { content: [{ type: "text", text: jsonStringError.message }], isError: true };
114
- }
115
- }
116
107
  try {
117
108
  if (operation === "create") {
118
109
  if (!params.workspaceId || !params.typeInternalName) {