Skip to main content
Glama

Get Orphan Documents

get_orphan_docs
Read-onlyIdempotent

Identify documents with no parent links in an AFFiNE workspace to locate orphaned content for cleanup.

Instructions

Find all documents that have no parent (not linked from any other doc via embed_linked_doc / embed_synced_doc blocks or inline LinkedPage references). Useful for workspace hygiene. Note: scans all docs — O(n). Each doc includes an inTrash flag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
orphansNo
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive traits, so the description adds valuable context beyond them: it notes the O(n) scan behavior across all docs and mentions that each doc includes an inTrash flag. This gives the agent performance and output expectations not covered by annotations.

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?

The description is three sentences with no redundant information. It front-loads the core purpose, then adds context and a performance warning, with each sentence earning its place. No excessive detail or filler.

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?

With an output schema present and annotations covering safety, the description is mostly complete for a read-only listing tool. It defines the core concept and adds performance and output details, but it omits any explanation of the workspaceId parameter, leaving a minor completeness gap. Overall, it covers the essential context well.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description does not mention the sole parameter workspaceId at all. While the parameter name is relatively self-explanatory, the description fails to clarify its role (e.g., whether it scopes the search to a specific workspace or defaults to all), leaving a gap that the description should compensate for.

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 uses a specific verb ('Find all documents') and a clearly defined resource ('orphan docs'), explicitly defining what qualifies as orphaned (no parent via embed_linked_doc, embed_synced_doc, or inline LinkedPage references). This clearly distinguishes it from sibling tools like list_docs or search_docs by focusing on parentless documents.

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?

The description offers a use case ('Useful for workspace hygiene') which implies when to use the tool, but it does not explicitly state when to prefer this over alternatives or provide exclusions. No comparisons to sibling tools are made, leaving the usage guidance implicit rather than explicit.

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