Skip to main content
Glama

Delete Document

delete_doc
Destructive

Permanently removes a document from an AFFiNE workspace and requests content deletion after exact doc ID confirmation; use only for destructive cleanup.

Instructions

Remove a document from the workspace list and request content deletion. AFFiNE servers may acknowledge this request while retaining readable content that still syncs. Content deletion is reported only after absence is verified; otherwise the result is partial with a warning. This is destructive; use trash_doc for recoverable cleanup or revoke_doc to remove public access.

Input Schema

NameRequiredDescriptionDefault
docIdYesAFFiNE document id.
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.
confirmDocIdYesMust exactly match docId to confirm permanent document deletion.
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
docIdNo
errorNo
deletedNo
detailsNo
causeCodeNo
retryableNo
workspaceIdNo
recoveryGuidanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing a non-obvious server behavior: AFFiNE may acknowledge the request while retaining readable, still-syncing content, and the tool reports deletion only after absence is verified, otherwise returning a partial result with a warning. That is exactly the kind of eventual-consistency caveat an agent cannot infer from destructiveHint=true, and it materially changes how the caller should interpret the outcome.

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?

Three sentences, front-loaded with the action, then the risk caveat, then the sibling routing. Every sentence carries distinct information with no restatement of the name or title.

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

Completeness5/5

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

With full schema coverage, explicit annotations, and an output schema handling return values, the description only needs to supply risk and routing context — which it does comprehensively. Nothing needed to invoke this correctly is missing.

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%, so docId, workspaceId, confirmDocId and expectedRevision are all documented in the schema itself. The description adds no additional parameter-level detail (e.g., when expectedRevision should be supplied), so the baseline of 3 applies.

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?

States a specific verb (remove/delete) and resource (document), and immediately separates it from sibling operations by naming trash_doc and revoke_doc. An agent can tell exactly what this does and how it differs from the other deletion-adjacent tools without opening a schema.

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

Usage Guidelines5/5

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

Explicit routing: 'use trash_doc for recoverable cleanup or revoke_doc to remove public access.' The condition that selects this tool over its alternatives is stated, and the destructive framing reinforces when it is appropriate.

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