Skip to main content
Glama
btn0s

Granola MCP Server

by btn0s

search_granola_notes

Search through Granola notes and documents using a query string to find relevant meeting content and information.

Instructions

Search through Granola notes/documents by query string. Returns matching documents with their content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find matching notes/documents
limitNoMaximum number of results to return (default: 10)

Implementation Reference

  • Handler function for the 'search_granola_notes' tool. Searches Granola documents using the API client, processes content by converting ProseMirror to Markdown, and returns results as JSON.
    case "search_granola_notes": {
      const query = args?.query as string;
      const limit = (args?.limit as number) || 10;
      const results = await apiClient.searchDocuments(query, limit);
    
      const processedResults = await Promise.all(
        results.map(async (doc) => {
          let markdown = "";
          let hasContent = false;
    
          if (
            doc.last_viewed_panel &&
            typeof doc.last_viewed_panel === "object" &&
            doc.last_viewed_panel.content &&
            typeof doc.last_viewed_panel.content === "object" &&
            doc.last_viewed_panel.content.type === "doc"
          ) {
            markdown = convertProseMirrorToMarkdown(
              doc.last_viewed_panel.content
            );
            hasContent = markdown.trim().length > 0;
          } else if (
            doc.notes &&
            typeof doc.notes === "object" &&
            doc.notes.type === "doc"
          ) {
            markdown = convertProseMirrorToMarkdown(doc.notes);
            hasContent = markdown.trim().length > 0;
          }
    
          return {
            id: doc.id,
            title: doc.title || "Untitled",
            markdown: markdown.substring(0, 2000) || "",
            content_preview: markdown.substring(0, 500) || "",
            has_content: hasContent,
            created_at: doc.created_at,
            updated_at: doc.updated_at,
          };
        })
      );
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                query,
                count: processedResults.length,
                results: processedResults,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Input schema definition for the 'search_granola_notes' tool, specifying query (required string) and optional limit (number).
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Search query to find matching notes/documents",
        },
        limit: {
          type: "number",
          description: "Maximum number of results to return (default: 10)",
          default: 10,
        },
      },
      required: ["query"],
    },
  • src/index.ts:28-47 (registration)
    Registration of the 'search_granola_notes' tool in the tools array, which is returned by the ListTools handler.
    {
      name: "search_granola_notes",
      description:
        "Search through Granola notes/documents by query string. Returns matching documents with their content.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Search query to find matching notes/documents",
          },
          limit: {
            type: "number",
            description: "Maximum number of results to return (default: 10)",
            default: 10,
          },
        },
        required: ["query"],
      },
    },
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 tool searches and returns results, but lacks details on permissions, rate limits, pagination, error handling, or what 'matching' entails (e.g., full-text search, metadata). This is inadequate for a search 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 that front-loads the core purpose ('Search through Granola notes/documents by query string') and adds a brief outcome statement. There is no wasted text, and it's appropriately sized for a simple search tool.

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 explain the return format beyond 'matching documents with their content', leaving gaps in understanding result structure, error cases, or behavioral traits. For a search tool with 2 parameters and no structured output, more context 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 clear documentation for both parameters ('query' and 'limit'). The description adds minimal value beyond the schema, mentioning 'query string' and 'matching documents' but not elaborating on search syntax or result formatting. Baseline 3 is appropriate as 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 through') and resource ('Granola notes/documents'), with a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'search_granola_events' or 'search_granola_transcripts' beyond mentioning 'notes/documents', which leaves some ambiguity about scope boundaries.

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 'list_granola_documents' or other search siblings. It mentions the return of 'matching documents with their content' but doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer usage 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/btn0s/granola-mcp'

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