Skip to main content
Glama

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
NameRequiredDescriptionDefault
folderNoOptional. Filter by folder name (case-insensitive) or folder ID.
limitNoMax results per page (default: 20, max: 100)
cursorNoPagination cursor from a previous response

Implementation Reference

  • 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);
        }
      },
    );

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/UnMarkdown/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server