tool: update blocks content #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
built a super basic MCP tool to edit block content
first request has a cold start, it parses
basehub.d.ts
to figure out context. The idea is to support prompts like "change the hero title to…" and resolve the right componentlimitations: right now you need to be exact with component names, which can be annoying. I imagine multiple layers to get the right instance id, even a "contains" fallback (e.g "change the text that says 'this is a hero'") but that would probably require access to the actual content, not sure if that's possible or even desirable
super early poc it works, but far from the UX/DX i have in mind. Posting in case someone wants to build on it or has ideas
prompts to test (marketing website template):
"change the hero title to 'lorem ipsum' and the subtitle to 'lorem ipsum 2'"
"change the callout title to 'lorem ipsum'"
"change the cta button title to 'lorem ipsum'"
only supports string fields for now
demo:
update-blocks-content.mp4