Update Frame Children
update_frame_childrenReplace a frame block's entire child set with specified surface elements or edgeless blocks, optionally resizing the frame to fit its new contents and returning unresolved IDs.
Instructions
Replace a frame block's contents wholesale. Accepts ids of surface elements (shapes/connectors/groups) AND edgeless blocks (notes/frames/edgeless-text) — all go into BlockSuite's prop:childElementIds map, matching what the editor writes when you drag members into a frame. Dragging the frame drags every owned member. Ids that don't resolve come back under 'missing'. By default the frame is resized to fit its new contents (plus padding + title band); set resizeToFit=false to leave xywh untouched. Pass [] to clear ownership (resize is skipped in that case).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | Document ID | |
| blockId | Yes | Frame block id (flavour affine:frame). | |
| padding | No | Padding (px) used when resizeToFit is true (default 40). Ignored when resizeToFit=false. | |
| resizeToFit | No | If true (default), recompute xywh from the union of resolvable child bounds + padding + title band. Set to false to preserve the frame's current box (useful when you want ownership-only edits or manual positioning). | |
| workspaceId | No | Workspace ID (optional if default set) | |
| childElementIds | Yes | Full list of ids the frame should own/contain. Replaces any existing ownership. | |
| expectedRevision | No | Optional read_doc revision of this primary document. Reject stale content before writing. Covers document content, not workspace metadata; requires all writers to share one MCP server. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| code | No | ||
| xywh | No | ||
| error | No | ||
| blockId | No | ||
| details | No | ||
| flavour | No | ||
| missing | No | ||
| resized | No | ||
| updated | No | ||
| ownedIds | No | ||
| causeCode | No | ||
| retryable | No | ||
| recoveryGuidance | No |