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
Address PR feedback: merge get_component actions, rename settings to metadata
- Merge get_component_by_id and get_component_by_name into single get_component action
- Rename get/set_component_settings to get/set_component_metadata
- Update refine validator and error message
Copy file name to clipboardExpand all lines: src/tools/deComponents.ts
+15-19Lines changed: 15 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -183,27 +183,24 @@ export function registerDEComponentsTools(
183
183
.describe(
184
184
"Get all components, only valid if you are connected to Webflow Designer.",
185
185
),
186
-
get_component_by_id: z
186
+
get_component: z
187
187
.object({
188
188
component_id: z
189
189
.string()
190
-
.describe("The id of the component to get"),
191
-
})
192
-
.optional()
193
-
.describe("Get a component by its ID"),
194
-
get_component_by_name: z
195
-
.object({
190
+
.optional()
191
+
.describe("The id of the component to get. Use this or name."),
196
192
name: z
197
193
.string()
198
-
.describe("The name of the component"),
194
+
.optional()
195
+
.describe("The name of the component. Use this or component_id."),
199
196
group: z
200
197
.string()
201
198
.optional()
202
-
.describe("Optional group to narrow the search"),
199
+
.describe("Optional group to narrow the search when using name"),
203
200
})
204
201
.optional()
205
202
.describe(
206
-
"Get a component by its name, optionally within a specific group",
203
+
"Get a component by ID or by name. Provide component_id for ID lookup, or name (and optional group) for name lookup.",
207
204
),
208
205
open_component_canvas: z
209
206
.object({
@@ -215,17 +212,17 @@ export function registerDEComponentsTools(
215
212
.describe(
216
213
"Open the component canvas for editing a component directly",
217
214
),
218
-
get_component_settings: z
215
+
get_component_metadata: z
219
216
.object({
220
217
component_id: z
221
218
.string()
222
219
.describe("The id of the component"),
223
220
})
224
221
.optional()
225
222
.describe(
226
-
"Get the settings (name, group, description) of a component",
223
+
"Get the metadata (name, group, description) of a component",
227
224
),
228
-
set_component_settings: z
225
+
set_component_metadata: z
229
226
.object({
230
227
component_id: z
231
228
.string()
@@ -245,7 +242,7 @@ export function registerDEComponentsTools(
245
242
})
246
243
.optional()
247
244
.describe(
248
-
"Update settings (name, group, description) of a component",
245
+
"Update metadata (name, group, description) of a component",
249
246
),
250
247
rename_component: z
251
248
.object({
@@ -284,17 +281,16 @@ export function registerDEComponentsTools(
284
281
d.open_component_view,
285
282
d.close_component_view,
286
283
d.get_all_components,
287
-
d.get_component_by_id,
288
-
d.get_component_by_name,
284
+
d.get_component,
289
285
d.open_component_canvas,
290
-
d.get_component_settings,
291
-
d.set_component_settings,
286
+
d.get_component_metadata,
287
+
d.set_component_metadata,
292
288
d.rename_component,
293
289
d.unregister_component,
294
290
].filter(Boolean).length>=1,
295
291
{
296
292
message:
297
-
"Provide at least one of check_if_inside_component_view, transform_element_to_component, create_blank_component, insert_component_instance, open_component_view, close_component_view, get_all_components, get_component_by_id, get_component_by_name, open_component_canvas, get_component_settings, set_component_settings, rename_component, unregister_component.",
293
+
"Provide at least one of check_if_inside_component_view, transform_element_to_component, create_blank_component, insert_component_instance, open_component_view, close_component_view, get_all_components, get_component, open_component_canvas, get_component_metadata, set_component_metadata, rename_component, unregister_component.",
0 commit comments