swebsy_edit_section
Update an existing webpage component by supplying a full replacement tree, complete HTML, or a small JSON patch; keep existing IDs so attached styles remain intact.
Instructions
Modify an existing component. By default this edits the selected component. To edit a component identified by read_page, provide its targetPath; an explicit path overrides the canvas selection. Preferred: provide component — the full replacement component tree (compact DSL OK), best for structural changes. Alternative: provide html — the complete modified HTML string. Fallback: provide patch — JSON Patch (RFC 6902) for tiny single-property tweaks. Supply exactly one. Preserve existing IDs: an id kept in the edit keeps the styles attached to it; an id you drop loses them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | The complete modified HTML for the target component. Prefer existing semantic/theme classes over raw Tailwind utilities. Preserve existing id attributes. | |
| patch | No | JSON Patch (RFC 6902) operations applied to the target component JSON. Only for tiny single-property tweaks. | |
| summary | Yes | 1 sentence explaining what the edit does. | |
| component | No | Full replacement component tree. Use compact DSL (t/c/x/a/k) to save tokens. Preserve existing attributes.id values. A `style` object merges into the styles already on that id, so you only send the declarations that change. | |
| targetPath | No | Zero-based component indexes from the current page root, exactly as returned by the most recent `read_page` call (for example [0] for the first top-level section or [0, 2] for its third child). Use this when the user names or relatively identifies a component instead of selecting it. |