Skip to main content
Glama

list_documents

Retrieve all documents and folders from your Dynalist account to organize and access your content efficiently.

Instructions

List all documents and folders in your Dynalist account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that lists all documents and folders by calling client.listFiles(), filtering and mapping them, building URLs, and returning a JSON-formatted text content response.
    async () => { const response = await client.listFiles(); const documents = response.files .filter((f) => f.type === "document") .map((f) => ({ id: f.id, title: f.title, url: buildDynalistUrl(f.id), permission: getPermissionLabel(f.permission), })); const folders = response.files .filter((f) => f.type === "folder") .map((f) => ({ id: f.id, title: f.title, children: f.children, })); return { content: [ { type: "text", text: JSON.stringify({ documents, folders, root_file_id: response.root_file_id }, null, 2), }, ], }; }
  • Registration of the list_documents tool using server.tool(), with empty input schema {} and inline handler function.
    server.tool( "list_documents", "List all documents and folders in your Dynalist account", {}, async () => { const response = await client.listFiles(); const documents = response.files .filter((f) => f.type === "document") .map((f) => ({ id: f.id, title: f.title, url: buildDynalistUrl(f.id), permission: getPermissionLabel(f.permission), })); const folders = response.files .filter((f) => f.type === "folder") .map((f) => ({ id: f.id, title: f.title, children: f.children, })); return { content: [ { type: "text", text: JSON.stringify({ documents, folders, root_file_id: response.root_file_id }, null, 2), }, ], }; } );
  • Helper function getPermissionLabel used within the list_documents handler to convert numeric permission to readable label.
    function getPermissionLabel(permission: number): string { switch (permission) { case 0: return "none"; case 1: return "read"; case 2: return "edit"; case 3: return "manage"; case 4: return "owner"; default: return "unknown"; } }

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/cristip73/dynalist-mcp'

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