Skip to main content
Glama
EoinFalconer

Granola MCP Server

by EoinFalconer

list_folders

Retrieve all document folders from Granola.ai meeting intelligence to organize meeting notes and transcripts by workspace.

Instructions

List all document folders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNoOptional workspace ID to filter by

Implementation Reference

  • Main implementation of the list_folders tool - defines the tool with its name, description, parameters (optional workspace_id filter), and the execute function that retrieves folders from cache, filters by workspace if provided, and returns a formatted list of folders with their IDs and document counts.
    // Tool: list_folders
    server.addTool({
      name: 'list_folders',
      description: 'List all document folders',
      parameters: z.object({
        workspace_id: z.string().optional().describe('Optional workspace ID to filter by')
      }),
      execute: async ({ workspace_id }) => {
        await ensureDataLoaded();
    
        let folders = foldersCache;
        if (workspace_id) {
          folders = folders.filter(f => f.workspace_id === workspace_id);
        }
    
        if (folders.length === 0) {
          return 'No folders found';
        }
    
        const output: string[] = ['# Folders\n'];
    
        for (const folder of folders) {
          const name = folder.title || folder.name || 'Untitled';
          const docIds = folder.document_ids || [];
    
          output.push(`## ${name}`);
          output.push(`**ID:** ${folder.id}`);
          output.push(`**Documents:** ${docIds.length}`);
          output.push('');
        }
    
        return output.join('\n');
      }
    });
  • src/server.ts:286-319 (registration)
    Tool registration using server.addTool() - registers the list_folders tool with the MCP server, defining its schema and handler in a single call.
    // Tool: list_folders
    server.addTool({
      name: 'list_folders',
      description: 'List all document folders',
      parameters: z.object({
        workspace_id: z.string().optional().describe('Optional workspace ID to filter by')
      }),
      execute: async ({ workspace_id }) => {
        await ensureDataLoaded();
    
        let folders = foldersCache;
        if (workspace_id) {
          folders = folders.filter(f => f.workspace_id === workspace_id);
        }
    
        if (folders.length === 0) {
          return 'No folders found';
        }
    
        const output: string[] = ['# Folders\n'];
    
        for (const folder of folders) {
          const name = folder.title || folder.name || 'Untitled';
          const docIds = folder.document_ids || [];
    
          output.push(`## ${name}`);
          output.push(`**ID:** ${folder.id}`);
          output.push(`**Documents:** ${docIds.length}`);
          output.push('');
        }
    
        return output.join('\n');
      }
    });
  • Input schema definition using zod - defines the parameters for list_folders as an optional workspace_id string that can be used to filter folders by workspace.
    parameters: z.object({
      workspace_id: z.string().optional().describe('Optional workspace ID to filter by')
    }),
  • Type definition for DocumentList interface - defines the shape of folder objects including id, title, name, created_at, workspace_id, owner_id, document_ids array, and optional documents and is_favourite fields.
    export interface DocumentList {
      id: string;
      title?: string;
      name?: string;
      created_at: string;
      workspace_id?: string;
      owner_id?: string;
      document_ids?: string[];
      documents?: GranolaDocument[];
      is_favourite?: boolean;
    }
  • ensureDataLoaded() helper function - ensures the folder cache is populated and fresh by calling loadData() if the cache is empty or expired, used by the list_folders tool handler.
    async function ensureDataLoaded() {
      const now = Date.now();
      if (documentsCache.size === 0 || (now - lastFetchTime) > CACHE_TTL) {
        await loadData();
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('List') but doesn't describe what 'all' means (e.g., pagination, limits), whether it requires authentication, rate limits, or what the output format looks like. This is inadequate for a tool with zero annotation coverage.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple list operation and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a list operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'all' entails (e.g., completeness, limitations), the return format, or how it differs from sibling filtering tools. The context signals indicate this tool has parameters and siblings, but the description doesn't address these complexities.

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%, so the schema already documents the single optional parameter. The description doesn't add any parameter-specific information beyond what's in the schema, but since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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?

The description clearly states the verb ('List') and resource ('all document folders'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'filter_by_folder' or 'filter_by_workspace' that might also involve folder operations, so it doesn't reach the highest clarity level.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'filter_by_workspace' or 'list_workspaces'. It doesn't mention any prerequisites, exclusions, or specific contexts for usage, leaving the agent to infer relationships from tool names alone.

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

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