Skip to main content
Glama
EoinFalconer

Granola MCP Server

by EoinFalconer

filter_by_folder

Filter meetings by folder to organize and access specific meeting content within the Granola.ai workspace.

Instructions

Filter meetings by folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idYesFolder ID to filter by

Implementation Reference

  • Complete filter_by_folder tool implementation with registration, schema, and handler logic. The tool filters meetings by folder ID, retrieves documents from that folder, and returns a formatted list of document titles and dates.
    // Tool: filter_by_folder
    server.addTool({
      name: 'filter_by_folder',
      description: 'Filter meetings by folder',
      parameters: z.object({
        folder_id: z.string().describe('Folder ID to filter by')
      }),
      execute: async ({ folder_id }) => {
        await ensureDataLoaded();
    
        // Find the folder
        const folder = foldersCache.find(f => f.id === folder_id);
        if (!folder) {
          return `Folder '${folder_id}' not found`;
        }
    
        const folderName = folder.title || folder.name || 'Untitled';
        const docIds = folder.document_ids || [];
    
        const docs = docIds
          .map(id => documentsCache.get(id))
          .filter((doc): doc is GranolaDocument => doc !== undefined);
    
        if (docs.length === 0) {
          return `No documents found in folder '${folderName}'`;
        }
    
        const output: string[] = [
          `# Documents in Folder: ${folderName}\n`,
          `Found ${docs.length} document(s)\n`
        ];
    
        for (const doc of docs) {
          output.push(`• **${getTitle(doc)}** (${doc.id})`);
          output.push(`  Date: ${formatDate(doc.created_at)}`);
          output.push('');
        }
    
        return output.join('\n');
      }
    });
  • Zod schema defining the tool's input parameters: folder_id as a required string with description.
    parameters: z.object({
      folder_id: z.string().describe('Folder ID to filter by')
    }),
  • Execute function that implements the tool logic: loads data, finds folder by ID, retrieves documents, and formats output with titles and dates.
    execute: async ({ folder_id }) => {
      await ensureDataLoaded();
    
      // Find the folder
      const folder = foldersCache.find(f => f.id === folder_id);
      if (!folder) {
        return `Folder '${folder_id}' not found`;
      }
    
      const folderName = folder.title || folder.name || 'Untitled';
      const docIds = folder.document_ids || [];
    
      const docs = docIds
        .map(id => documentsCache.get(id))
        .filter((doc): doc is GranolaDocument => doc !== undefined);
    
      if (docs.length === 0) {
        return `No documents found in folder '${folderName}'`;
      }
    
      const output: string[] = [
        `# Documents in Folder: ${folderName}\n`,
        `Found ${docs.length} document(s)\n`
      ];
    
      for (const doc of docs) {
        output.push(`• **${getTitle(doc)}** (${doc.id})`);
        output.push(`  Date: ${formatDate(doc.created_at)}`);
        output.push('');
      }
    
      return output.join('\n');
    }
  • Helper function formatDate that converts date strings to formatted local date strings for display in the tool output.
    function formatDate(dateStr: string | null | undefined): string {
      if (!dateStr) return 'Unknown date';
      try {
        const date = new Date(dateStr);
        return date.toLocaleString('en-US', {
          year: 'numeric',
          month: '2-digit',
          day: '2-digit',
          hour: '2-digit',
          minute: '2-digit',
          hour12: false
        });
      } catch {
        return dateStr;
      }
  • Helper function getTitle that safely extracts document title with fallback to 'Untitled Meeting'.
    function getTitle(doc: GranolaDocument): string {
      return doc.title || 'Untitled Meeting';
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('filter') but doesn't explain what 'filter' entails—whether it returns a subset of meetings, modifies data, requires permissions, or has side effects. This leaves critical behavioral traits unspecified.

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 is appropriately sized and front-loaded, directly stating the tool's function without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't clarify what 'filter' returns (e.g., a list of meetings, metadata), how results are structured, or error conditions. For a tool with one parameter but no structured context, more detail is needed.

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?

The schema description coverage is 100%, with the parameter 'folder_id' fully documented in the schema. The description adds no additional meaning beyond implying the parameter's role in filtering, so it meets the baseline for high schema coverage without compensating value.

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 ('filter') and resource ('meetings') with a specific criterion ('by folder'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'filter_by_workspace' or 'search_meetings', which prevents a perfect score.

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 'search_meetings'. It lacks context about prerequisites (e.g., needing a folder ID from 'list_folders') or exclusions, leaving usage ambiguous.

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