Skip to main content
Glama

Append Block

append_block

Add document blocks to AFFiNE pages with canonical types or legacy aliases, strict validation, and precise placement control. Insert paragraphs, tables, embeds, frames, and notes at a chosen position.

Instructions

Append document blocks with canonical types and legacy aliases (supports placement + strict validation).

Input Schema

NameRequiredDescriptionDefault
xNoX position on the edgeless canvas for frame/edgeless_text/note (default 0). Prefer ≥40px between sibling bounds; BlockSuite does not auto-arrange.
yNoY position on the edgeless canvas for frame/edgeless_text/note (default 0).
urlNoURL for bookmark/embeds. Runtime validation also enforces provider-specific hosts.
htmlNoRaw html for embed_html
nameNoAttachment file name
rowsNoTable row count
sizeNoAttachment/image file size in bytes
textNoBlock content as plain text or a delta array. For LinkedPage references, set insert to one ASCII space and pass the pageId in reference attributes; visible labels are resolved by AFFiNE.
typeYesBlock type. Canonical: paragraph|heading|quote|list|code|divider|callout|latex|table|bookmark|image|attachment|embed_youtube|embed_github|embed_figma|embed_loom|embed_html|embed_linked_doc|embed_synced_doc|embed_iframe|database|data_view|surface_ref|frame|edgeless_text|note. Legacy aliases remain supported.
docIdYesAFFiNE document id.
embedNoAttachment embed mode
latexNoLatex expression
levelNoHeading level for type=heading
styleNoList style for type=list
widthNoWidth for frame/edgeless_text/note.
designNoDesign payload for embed_html
heightNoHeight for frame/edgeless_text/note. When `markdown` is set and height is omitted, an over-estimate is computed from the content — AFFiNE's render-time ResizeObserver corrects `prop:xywh` to the true DOM-measured height on first browser open.
pageIdNoTarget page/doc id for linked/synced doc embeds
strictNoStrict validation mode (default true)
captionNoCode caption when type is code
checkedNoTodo state when type is todo
columnsNoTable column count
paddingNoDefault padding (px) for `childElementIds` auto-sizing on frames (each side, plus +30px title band) and fallback gap for `stackAfter` (default 40).
languageNoCode language when type is code
markdownNoWhen type='note', parse this markdown into heading/paragraph/list/code child blocks inside the note (BlockSuite-native: mirrors what happens when you paste markdown into an edgeless note). Takes precedence over 'text' for note children. Ignored for other block types.
mimeTypeNoAttachment mime type
sourceIdNoBlob key returned by upload_blob for image/attachment
viewModeNoInitial data view preset for type=database or type=data_view. Defaults: database=table, data_view=kanban
iframeUrlNoOverride iframe src for embed_iframe
placementNoOptional insertion target/position
referenceNoTarget id for surface_ref
tableDataNoPlain-text cell contents for type='table', as rows of columns. Row count must equal `rows` and every row length must equal `columns`. Omit to create an empty table.
backgroundNoBackground for frame/note. Frame default 'transparent'. For notes, prefer AFFiNE's adaptive `--affine-note-background-<color>` family — `blue` / `purple` / `yellow` / `green` / `teal` / `red` / `orange` / `magenta` / `grey` / `white` / `black`. For specific per-theme colors, pass a `{light, dark}` hex object like `{light:'#fff', dark:'#252525'}`.
refFlavourNoTarget flavour for surface_ref (e.g. affine:frame)
stackAfterNoLayout helper — position this block relative to one or more existing edgeless blocks. Picks the furthest anchor in `direction` for the stack axis, and centers the new block on the anchor group's union on the orthogonal axis (matches how BlockSuite aligns selection-derived blocks; reduces to inherit-anchor-x when widths match). Caller-provided x/y on the orthogonal axis still wins. Works for frame/note/edgeless_text. Example: `stackAfter: { blockId: [f1, f2, f3], gap: 80 }` stacks below whichever column frame ends lowest, centered across all three. Note heights shift at first render (page-root grows with the title, content notes shrink/grow with their children); give extra gap and fix up with `update_edgeless_block` if the down/right chain drifts.
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.
bookmarkStyleNoBookmark card style
childElementIdsNoFor type='frame' only. The frame's contents. Accepts ids of surface elements (shapes/connectors/groups) AND edgeless blocks (notes/frames/edgeless-text) — BlockSuite's prop:childElementIds holds both, matching what the editor writes when you drag a note into a frame. Dragging the frame drags every owned member. Ids that don't resolve come back under 'missing'. When width/height are omitted the frame is sized to the union of resolvable child bounds + padding + a 30px title band.
tableCellDeltasNoRich-text deltas per cell for type="table", parallel to `tableData` as [row][column][delta]. A cell with deltas here overrides plain text at the same position. LinkedPage references require insert: " " and a pageId in reference attributes.
expectedRevisionNoOptional 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

NameRequiredDescriptionDefault
okNo
codeNo
kindNo
typeNo
docIdNo
errorNo
blockIdNo
detailsNo
flavourNo
appendedNo
blockTypeNo
causeCodeNo
retryableNo
legacyTypeNo
workspaceIdNo
normalizedTypeNo
recoveryGuidanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare the write profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), so the description is not required to restate safety. But it adds almost nothing behavioral: it name-drops "strict validation" without saying what strict rejects or that it defaults to true, gives no hint that appends are non-idempotent and can duplicate blocks, and says nothing about revision checks or the failure modes the 40-param surface implies.

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?

A single front-loaded sentence with no padding, so nothing is wasted. The parenthetical is slightly vague filler, but the text is compact and the primary action leads.

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

Completeness2/5

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

For a 40-parameter mutation tool with nested objects, edgeless-canvas geometry, and many overlapping siblings, one sentence is far short of complete: an agent gets no routing guidance, no sense of the edgeless-vs-document distinction, and no warning about strict-mode rejections. An output schema does exist, so return values need not be described, but the selection and behavioral context is largely absent.

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

Parameters3/5

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

Schema description coverage is 100% and each of the 40 parameters carries substantive inline documentation, so the baseline of 3 applies. The description contributes only the high-level notion of canonical types/legacy aliases, placement, and strict validation; it adds no semantics for any individual parameter beyond what the schema already states.

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 verb+resource pair ("Append document blocks") is unambiguous and the parenthetical adds that canonical types, legacy aliases, placement, and strict validation are involved. It never distinguishes itself from nearby siblings such as append_markdown, append_semantic_section, add_surface_element, or create_doc_from_markdown, so an agent must infer the boundary.

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

Usage Guidelines2/5

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

There is no statement of when to reach for this tool versus the many alternative append/insert tools in the sibling list. No prerequisites, no exclusions, no note about document mode vs edgeless canvas, which the schema clearly supports.

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

Deploy Server

Other Tools