You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
componentName: z.string().describe('The name of the component.'),
18
-
props: z.object({}).describe('The props of the component.'),
19
-
children: z.array(z.lazy(()=>nodeArraySchema)).describe('The children of the component')
20
-
})
21
-
22
7
constinputSchema=z.object({
23
8
parentId: z
24
9
.string()
25
10
.optional()
26
11
.describe(
27
12
'The id of the parent node. If not provided, the new node will be added to the root. if you don\'t know the parentId, you can use the tool "get_page_schema" to get the page schema. if you want to add to page root, just don\'t provide the parentId.'
28
13
),
29
-
newNodeData: z.lazy(()=>nodeSchema).describe('The new node data.'),
14
+
newNodeData: z.object({
15
+
componentName: z.string().describe('The name of the component.'),
16
+
props: z.record(z.string(),z.any()).describe('The props of the component.'),
17
+
children: z
18
+
.array(z.record(z.string(),z.any()))
19
+
.describe('Array of child nodes; each child has the same shape as newNodeData (recursive tree).')
20
+
}),
30
21
position: z
31
22
.enum(['before','after'])
32
23
.optional()
@@ -60,11 +51,6 @@ export const addNode = {
60
51
const{ props ={}, children =[]}=newNodeData
61
52
62
53
constvalidateResult=validateParams(args,{
63
-
componentName: {
64
-
required: true,
65
-
message:
66
-
'Component name is required, if you don\'t know the component name, you can use the tool "get_component_list" to get the component detail.'
0 commit comments