Skip to main content
Glama

Restore Document from Trash

restore_doc
Idempotent

Restore a document from the AFFiNE trash without altering its content. Use this safe retry action to recover deleted AFFiNE documents by document ID and workspace ID.

Instructions

Restore a document from the AFFiNE trash without changing its content. This is safe to retry.

Input Schema

NameRequiredDescriptionDefault
docIdYesAFFiNE document id.
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.

Output Schema

NameRequiredDescriptionDefault
okNo
codeNo
kindNo
docIdNo
errorNo
titleNo
statusNo
changedNo
detailsNo
inTrashNo
causeCodeNo
retryableNo
trashDateNo
workspaceIdNo
readBackVerifiedNo
recoveryGuidanceNo
previouslyInTrashNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare idempotentHint=true, destructiveHint=false and readOnlyHint=false, so 'safe to retry' largely restates structured data. 'Without changing its content' is genuinely new behavioral context (the restore preserves body content), but nothing is said about error handling, permission/auth requirements, or behavior when the doc is not in trash.

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?

Two short sentences with zero filler, and the core action is front-loaded before the retry-safety note. Every clause carries 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 values need not be explained, and the annotations cover the safety/idempotency profile. What's missing is only the precondition that the document must currently be trashed and any failure mode, which would materially help an agent avoid a wrong call.

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 both parameters (docId, workspaceId) carry their own descriptions, including the conditional guidance for omitting workspaceId. The description adds nothing beyond the schema, so the baseline 3 applies.

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?

Names a specific verb and resource plus the state it acts on ('document from the AFFiNE trash'), which implicitly positions it as the inverse of trash_doc/delete_doc. It does not name those siblings explicitly, so the differentiation is inferred rather than stated.

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?

Usage is only implied — the agent must infer that this applies to documents that have already been trashed. There is no statement of preconditions, no 'use X instead if...' routing to trash_doc or delete_doc, and no note about what happens on a non-trashed docId.

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