Skip to main content
Glama
EoinFalconer

Granola MCP Server

by EoinFalconer

search_meetings

Find meetings by searching titles, content, or participants to quickly locate specific discussions and information within your meeting records.

Instructions

Search meetings by title, content, or participants

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for meetings
limitNoMaximum number of results

Implementation Reference

  • Main handler function for search_meetings tool that searches through cached meetings by title and content, scoring results, and returning formatted output with meeting metadata
    execute: async ({ query, limit }) => {
      await ensureDataLoaded();
    
      if (documentsCache.size === 0) {
        return 'No meeting data available';
      }
    
      const queryLower = safeString(query).toLowerCase();
      const results: Array<{ score: number; doc: GranolaDocument }> = [];
    
      for (const doc of documentsCache.values()) {
        let score = 0;
    
        // Search in title (with null check)
        const title = safeString(doc.title).toLowerCase();
        if (title.includes(queryLower)) {
          score += 2;
        }
    
        // Search in content
        const content = safeString(extractContent(doc)).toLowerCase();
        if (content.includes(queryLower)) {
          score += 1;
        }
    
        if (score > 0) {
          results.push({ score, doc });
        }
      }
    
      results.sort((a, b) => b.score - a.score);
      const topResults = results.slice(0, limit);
    
      if (topResults.length === 0) {
        return `No meetings found matching '${query}'`;
      }
    
      const output: string[] = [`Found ${topResults.length} meeting(s) matching '${query}':\n`];
    
      for (const { doc } of topResults) {
        output.push(`• **${getTitle(doc)}** (${doc.id})`);
        output.push(`  Date: ${formatDate(doc.created_at)}`);
    
        if (doc.workspace_name) {
          output.push(`  Workspace: ${doc.workspace_name}`);
        }
    
        if (doc.folders && doc.folders.length > 0) {
          const folderNames = doc.folders.map(f => f.name).join(', ');
          output.push(`  Folders: ${folderNames}`);
        }
    
        output.push('');
      }
    
      return output.join('\n');
    }
  • src/server.ts:128-193 (registration)
    Tool registration using FastMCP server.addTool() with name, description, parameter schema (Zod), and execute handler for search_meetings
    // Tool: search_meetings
    server.addTool({
      name: 'search_meetings',
      description: 'Search meetings by title, content, or participants',
      parameters: z.object({
        query: z.string().describe('Search query for meetings'),
        limit: z.number().optional().default(10).describe('Maximum number of results')
      }),
      execute: async ({ query, limit }) => {
        await ensureDataLoaded();
    
        if (documentsCache.size === 0) {
          return 'No meeting data available';
        }
    
        const queryLower = safeString(query).toLowerCase();
        const results: Array<{ score: number; doc: GranolaDocument }> = [];
    
        for (const doc of documentsCache.values()) {
          let score = 0;
    
          // Search in title (with null check)
          const title = safeString(doc.title).toLowerCase();
          if (title.includes(queryLower)) {
            score += 2;
          }
    
          // Search in content
          const content = safeString(extractContent(doc)).toLowerCase();
          if (content.includes(queryLower)) {
            score += 1;
          }
    
          if (score > 0) {
            results.push({ score, doc });
          }
        }
    
        results.sort((a, b) => b.score - a.score);
        const topResults = results.slice(0, limit);
    
        if (topResults.length === 0) {
          return `No meetings found matching '${query}'`;
        }
    
        const output: string[] = [`Found ${topResults.length} meeting(s) matching '${query}':\n`];
    
        for (const { doc } of topResults) {
          output.push(`• **${getTitle(doc)}** (${doc.id})`);
          output.push(`  Date: ${formatDate(doc.created_at)}`);
    
          if (doc.workspace_name) {
            output.push(`  Workspace: ${doc.workspace_name}`);
          }
    
          if (doc.folders && doc.folders.length > 0) {
            const folderNames = doc.folders.map(f => f.name).join(', ');
            output.push(`  Folders: ${folderNames}`);
          }
    
          output.push('');
        }
    
        return output.join('\n');
      }
    });
  • Zod schema defining input parameters for search_meetings: query (required string) and limit (optional number with default 10)
    parameters: z.object({
      query: z.string().describe('Search query for meetings'),
      limit: z.number().optional().default(10).describe('Maximum number of results')
    }),
  • Helper function ensureDataLoaded() that checks if data cache is empty or stale, and triggers data loading if needed
    async function ensureDataLoaded() {
      const now = Date.now();
      if (documentsCache.size === 0 || (now - lastFetchTime) > CACHE_TTL) {
        await loadData();
      }
    }
  • Helper function extractContent() that extracts text content from GranolaDocument's ProseMirror structure for searching
    function extractContent(doc: GranolaDocument): string {
      if (!doc.last_viewed_panel?.content) {
        return '';
      }
    
      const content = doc.last_viewed_panel.content;
      if (content.type === 'doc') {
        return extractTextFromProseMirror(content);
      }
    
      return '';
    }
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 search functionality but doesn't describe what the tool returns (e.g., meeting IDs, summaries, full details), whether results are paginated, if there are rate limits, or authentication requirements. For a search tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration. Every word earns its place.

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 complexity of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, how results are structured, or any behavioral traits like error handling. For a tool that likely returns multiple results, more context is needed to be fully useful.

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 both parameters ('query' and 'limit') with descriptions. The description adds no additional parameter semantics beyond what's in the schema, such as query syntax examples or limit constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('search') and resource ('meetings'), and specifies the searchable attributes ('by title, content, or participants'). It distinguishes from siblings like 'get_meeting_content' or 'get_meeting_details' by focusing on search rather than retrieval. However, it doesn't explicitly differentiate from 'filter_by_folder' or 'filter_by_workspace', which might also involve meeting selection.

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. It doesn't mention when to prefer this search tool over sibling tools like 'filter_by_folder', 'filter_by_workspace', or 'get_meeting_details', nor does it specify any prerequisites or exclusions. Usage is implied but not explicitly stated.

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