Skip to main content
Glama

Read Document Content

read_doc
Read-onlyIdempotent

Reads AFFiNE document block content and revision, returning text and formatting deltas so callers can write with expectedRevision and reject stale edits.

Instructions

Read document block content and its revision via WebSocket snapshot. Pass revision as expectedRevision on a document write to reject stale edits through a shared MCP server. Each block includes plain text and formatting-preserving deltas. Set includeMarkdown: true to also get rendered markdown, which can be lossy for unsupported inline attributes.

Input Schema

NameRequiredDescriptionDefault
docIdYesAFFiNE document id.
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.
includeMarkdownNoIf true, includes rendered markdown in the response. Equivalent to also calling export_doc_markdown.

Output Schema

NameRequiredDescriptionDefault
okNo
codeNo
tagsNo
docIdNo
errorNo
titleNo
blocksNo
existsNo
detailsNo
markdownNo
revisionNo
causeCodeNo
plainTextNo
retryableNo
blockCountNo
recoveryGuidanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, so the safety profile is covered; the description adds genuinely new context — the WebSocket snapshot read path, the block-level return shape with formatting-preserving deltas, and a lossiness warning for markdown on unsupported inline attributes. The phrase 'through a shared MCP server' is vague filler but the rest is substantive.

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?

Four front-loaded sentences, each carrying distinct information: purpose, concurrency workflow, return shape, and the markdown opt-in caveat. Minor waste in 'through a shared MCP server', which adds no decision-relevant information.

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?

An output schema exists, so return-value enumeration is unnecessary, and docId/workspaceId semantics are fully covered by the schema. For a read of possibly large documents, a note on block ordering or result size would close the remaining gap, but nothing essential is missing.

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 earns a step up by explaining what the returned revision is for (as expectedRevision on writes) and by warning that includeMarkdown 'can be lossy for unsupported inline attributes' — a caveat the schema states neutrally as 'equivalent to export_doc_markdown'.

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?

States a specific verb and resource — 'Read document block content and its revision' — plus the mechanism ('via WebSocket snapshot') and what the payload contains (blocks with plain text and deltas). It does not, however, distinguish itself from the closely named sibling get_doc or from export_doc_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 Guidelines3/5

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

Useful cross-tool guidance is present: 'Pass revision as expectedRevision on a document write to reject stale edits', and the includeMarkdown flag is scoped ('also get rendered markdown'). But there is no explicit statement of when to choose read_doc over get_doc, list_docs, or export_doc_markdown, so the selection decision is only implied.

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