ui_builder_apply
Apply design mutations — insertNode, setProperty, deleteNode, moveNode and the rest of DesignMutationV1 — as one operation. baseRevision is the revision you read; the outcome reports conflicts or rejected edits. This is how an agent adds a scaffold, fills its slots and sets modifiers. Use setStateVariable with name and declaration to add or edit state, removeStateVariable with name to remove unused state, and setEventBinding with nodeId, event and an ordered actions array to edit behavior. An empty actions array removes the event handler. removeNodeProperty (or a setProperty whose value is {"type":"null"}) unsets the property — the way back after trying one — and is refused, naming the node and the field, when the catalog requires it. When somebody has commented on the design and you have not acknowledged it, the outcome carries a comments block naming the threads waiting on you; read it, because it is somebody talking about what you are editing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | A grant token from poll_access, when you cannot set the X-Compose-Preview-Token header yourself — an MCP client fixes its headers at connect time, so this is how a token approved during this session is used in it. Prefer the header where you control it. | |
| clientId | No | ||
| designId | Yes | ||
| operations | Yes | DesignMutationV1 objects. State example: {"type":"setStateVariable","name":"expanded","declaration":{"type":"value","valueType":"bool","initialValue":false,"nullable":false,"persistence":"preview"}}. Event example: {"type":"setEventBinding","nodeId":"button","event":"click","actions":[{"type":"toggle","variable":"expanded"}]}. Declare state before binding it in the batch. | |
| operationId | Yes | Your id for this operation; makes a retry idempotent. | |
| baseRevision | Yes | The revision these mutations were written against. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||