Skip to content

Add component management and canvas navigation schemas#102

Merged
bertenator merged 5 commits intosaifrom
blank-components
Apr 1, 2026
Merged

Add component management and canvas navigation schemas#102
bertenator merged 5 commits intosaifrom
blank-components

Conversation

@memo-pineda
Copy link
Copy Markdown
Contributor

@memo-pineda memo-pineda commented Mar 31, 2026

Summary

Adds Zod schemas for new beta component tool actions and canvas navigation to de_component_tool, plus updated guidance in webflow_guide_tool.

New actions (all beta-gated)

Action DE API Jira
create_blank_component webflow.registerComponent(options) STRUCT-3521
open_canvas webflow.openCanvas(component | { pageId }) STRUCT-3559
search_components webflow.searchComponents({ q? }) STRUCT-3560, STRUCT-3684
get_instance_count component.getInstanceCount() STRUCT-3526
get_current_component webflow.getCurrentComponent() STRUCT-3660
get_parent_component element.getParentComponent() STRUCT-3661
insert_slot el.append(webflow.elementPresets.Slot) STRUCT-3587
open_page_canvas (page tool) webflow.openCanvas({ pageId }) STRUCT-3620

Rules updates

  • Added guidance for all new beta component actions
  • New "Canvas Navigation" section explaining open_canvas vs open_component_view/close_component_view

Notes

  • open_canvas replaces the previous open_component_canvas and now accepts either component_id or page_id
  • TODO: Consider removing open_page_canvas from de_page_tool in the future to reduce redundancy with open_canvas

Test plan

Use the beta SSE endpoint (/beta/sse) in Cursor and run the following prompt:

Test all beta component tool actions. Follow each step in order, verifying success before continuing. Use the de_component_tool with the beta endpoint.

1. Search Components (no query — list all)
   - Call search_components with no q parameter
   - Report back the list of components found with their names, groups, and instance counts

2. Search Components (with query)
   - Call search_components with q set to a name from step 1 (pick the first one)
   - Confirm the filtered results match

3. Search Components (by description)
   - Call search_components with q set to a keyword from a component's description (if any were returned in step 1)

4. Create Blank Component (name only)
   - Call create_blank_component with name: "MCP Test Component"
   - Save the returned component ID

5. Create Blank Component (with group and description)
   - Call create_blank_component with name: "MCP Test Component 2", group: "MCP Test Group", description: "Created by MCP test prompt"
   - Save the returned component ID

6. Get Instance Count (zero instances)
   - Call get_instance_count with the component_id from step 4
   - Confirm count is 0

7. Search Components (verify new components appear)
   - Call search_components with q: "MCP Test"
   - Confirm both components from steps 4 and 5 appear

8. Open Canvas (component by ID)
   - Call open_canvas with component_id from step 4
   - Confirm success

9. Get Current Component (while on component canvas)
   - Call get_current_component
   - Confirm it returns the component from step 4

10. Insert Slot (default append)
    - Get the root element of the current view
    - Call insert_slot with the root element's ID
    - Confirm the returned SlotElement info

11. Insert Slot (prepend)
    - Call insert_slot with same root element ID and position: "prepend"
    - Confirm a second slot was created

12. Get Parent Component (element inside component)
    - Using the slot element ID from step 10, call get_parent_component
    - Confirm it returns the component from step 4

13. Open Canvas (navigate to second component)
    - Call open_canvas with component_id from step 5
    - Confirm success

14. Get Current Component (verify switch)
    - Call get_current_component
    - Confirm it now returns the component from step 5

15. Open Canvas (exit to page)
    - Call open_canvas with a page_id to return to a page
    - Confirm success

16. Get Current Component (while on page)
    - Call get_current_component
    - Confirm it returns null

17. Get Parent Component (page-level element)
    - Select any element on the page, call get_parent_component with its ID
    - Confirm it returns null

18. Get Instance Count (after inserting instance)
    - Insert an instance of "MCP Test Component" onto the page using insert_component_instance
    - Call get_instance_count with component_id from step 4
    - Confirm count is now 1

19. Cleanup
    - Unregister both test components
    - Confirm both are removed

After each step, report: action name, status (success/error), and key data returned.

Expected results

  • All 19 steps should return status: "success" (except step 16/17 which return success with null data)
  • search_components should return rich metadata (name, group, description, instances, canEdit, library)
  • get_current_component should return component info on canvas, null on page
  • get_parent_component should return component info for elements inside components, null for page-level
  • open_canvas with page_id should exit component canvas
  • insert_slot should work only inside component editing context

🤖 Generated with Claude Code

memo-pineda and others added 5 commits March 30, 2026 14:23
…_parent_component schemas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ort, update rules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@memo-pineda memo-pineda changed the title Add blank component and open canvas schemas Add component management and canvas navigation schemas Apr 1, 2026
@memo-pineda memo-pineda marked this pull request as ready for review April 1, 2026 22:00
@memo-pineda memo-pineda requested a review from a team as a code owner April 1, 2026 22:00
@memo-pineda memo-pineda requested review from viratatwebflow and zmcnellis and removed request for a team and zmcnellis April 1, 2026 22:00
@bertenator bertenator merged commit e499575 into sai Apr 1, 2026
6 checks passed
@bertenator bertenator deleted the blank-components branch April 1, 2026 22:52
{
message:
"Provide at least one of create_page, create_page_folder, get_current_page, switch_page.",
"Provide at least one of create_page, create_page_folder, get_current_page, switch_page, open_page_canvas.",
Copy link
Copy Markdown
Collaborator

@viratatwebflow viratatwebflow Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open_page_canvas why can't it be part of component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants