Skip to main content
Glama

Update Frame Children

update_frame_children

Replace a frame's owned elements (shapes, notes, groups) by providing a list of element IDs. Optionally resize the frame to fit its new contents or leave its position unchanged.

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

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdNoWorkspace ID (optional if default set)
docIdYesDocument ID
blockIdYesFrame block id (flavour affine:frame).
childElementIdsYesFull list of ids the frame should own/contain. Replaces any existing ownership.
resizeToFitNoIf 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).
paddingNoPadding (px) used when resizeToFit is true (default 40). Ignored when resizeToFit=false.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It details: wholesale replacement via childElementIds, drag behavior, handling of unresolvable IDs (returned as 'missing'), resize logic with padding and title band, and the special case of an empty array skipping resize. This is comprehensive and transparent, with no contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise (5 sentences) and front-loaded with the core purpose. Every sentence adds distinct information (wholesale replacement, element types, behavior, resize options, clear ownership). It avoids redundancy and is well-structured for readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description covers main behaviors but lacks some completeness. It hints at output (missing IDs) but doesn't fully describe return values. Error conditions (e.g., invalid blockId, missing workspace) are not addressed. Parameter count and required fields are fully described, but overall completeness is slightly below excellent due to missing output details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds significant value: it explains that childElementIds is a full replacement list, clarifies the default and effect of resizeToFit (recompute xywh), specifies padding default (40px), and notes that empty array clears ownership with no resize. This goes beyond the schema's property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it replaces a frame block's contents wholesale, specifying the resource (frame) and the action (replace children). It lists the types of elements accepted (surface and edgeless blocks), distinguishing it from sibling tools like add_surface_element or delete_surface_element that operate on individual elements. However, it does not explicitly contrast with all related siblings (e.g., update_edgeless_block), but the core purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool: to replace all children of a frame. It covers behavior for dragging, missing IDs, and options like resizeToFit and padding. However, it does not explicitly state when not to use it or suggest alternatives for incremental updates (e.g., add_surface_element). The usage context is implied but not fully delineated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DAWNCR0W/affine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server