list_documents
Retrieve saved documents with pagination and optional folder filtering to manage your Unmarkdown workspace content.
Instructions
List your saved documents with pagination. Optionally filter by folder name or ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Optional. Filter by folder name (case-insensitive) or folder ID. | |
| limit | No | Max results per page (default: 20, max: 100) | |
| cursor | No | Pagination cursor from a previous response |
Implementation Reference
- src/tools.ts:128-173 (handler)The registration and handler logic for the 'list_documents' tool. It defines the schema for 'folder', 'limit', and 'cursor' and invokes the '/v1/documents' API endpoint.
// 3. list_documents server.tool( "list_documents", "List your saved documents with pagination. Optionally filter by folder name or ID.", { folder: z .string() .optional() .describe("Optional. Filter by folder name (case-insensitive) or folder ID."), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Max results per page (default: 20, max: 100)"), cursor: z .string() .optional() .describe("Pagination cursor from a previous response"), }, { title: "List Documents", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, async ({ folder, limit, cursor }) => { try { const query: Record<string, string> = {}; if (folder) query.folder = folder; if (limit) query.limit = String(limit); if (cursor) query.cursor = cursor; const result = await client.request( "GET", "/v1/documents", undefined, query, ); return jsonResult(result); } catch (err) { return errorResult(err); } }, );