Skip to main content
Glama

Append Block

append_block

Append blocks to AFFiNE documents with canonical types and legacy aliases, including placement control and strict validation.

Instructions

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

Input Schema

TableJSON 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 text
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
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
kindYes
typeYes
docIdYes
blockIdYes
flavourYes
appendedYes
blockTypeYes
legacyTypeYes
workspaceIdYes
normalizedTypeYes
Behavior3/5

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

Annotations already indicate a non-read-only, non-destructive, non-idempotent operation. The description adds that it supports placement and strict validation, which provides some context beyond annotations. However, it does not describe side effects, error behavior, or ordering guarantees, so it is adequate but not rich.

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

Conciseness5/5

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

Single sentence, front-loaded with 'Append document blocks', and contains no filler. Every phrase ('canonical types and legacy aliases', 'supports placement + strict validation') conveys key differentiating features.

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

Completeness4/5

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

Despite the tool's complexity (37 params, nested objects), the schema provides exhaustive documentation, and an output schema exists. The description summarizes the core value proposition compactly, though it omits details like edgeless vs doc contexts and markdown parsing, which are captured in the schema. This is sufficient for an agent guided by schema.

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% with detailed parameter descriptions, so the baseline is 3. The description mentions canonical types/aliases, placement, and strict validation, but these are already covered in the schema (e.g., type's 'Legacy aliases remain supported', placement and strict properties). No additional meaning is added.

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

Purpose5/5

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

The description clearly states the tool appends document blocks, and emphasizes canonical types, legacy aliases, placement, and strict validation. This distinguishes it from sibling tools like append_markdown (raw markdown) and append_semantic_section (semantic sections), even though it doesn't explicitly name them.

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?

No explicit when-to-use or alternative guidance is provided. The description states what the tool does but does not contrast it with append_markdown, append_semantic_section, or update_edgeless_block. Users/agents must infer usage from the tool name and sibling context.

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/irfanhak123/affine-mcp-server'

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