Replace Document With Markdown
replace_doc_with_markdownReplaces a document's main note content with Markdown, letting you overwrite an AFFiNE doc's body from Markdown text. Use it to update document content programmatically.
Instructions
Replace the main note content of a document with markdown content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docId | Yes | AFFiNE document id. | |
| strict | No | ||
| markdown | Yes | Markdown content to replace with | |
| allowEmpty | No | Set true to explicitly allow clearing the main note when Markdown produces no blocks. | |
| workspaceId | No | AFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured. | |
| 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 | ||
| kind | No | ||
| docId | No | ||
| error | No | ||
| lossy | No | ||
| stats | No | ||
| details | No | ||
| replaced | No | ||
| warnings | No | ||
| causeCode | No | ||
| retryable | No | ||
| workspaceId | No | ||
| recoveryGuidance | No |