Skip to main content
Glama

get_granola_document

Retrieve a specific Granola document by its ID to access notes, transcripts, or meeting content from the Granola MCP Server.

Instructions

Get a specific Granola document by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID to retrieve

Implementation Reference

  • Handler function for the 'get_granola_document' tool. Fetches the document by ID, converts ProseMirror content to Markdown, and returns a JSON response with document details.
    case "get_granola_document": { const id = args?.id as string; const doc = await apiClient.getDocumentById(id); if (!doc) { return { content: [ { type: "text", text: JSON.stringify({ error: `Document with id ${id} not found`, }), }, ], isError: true, }; } let markdown = ""; 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 ); } else if ( doc.notes && typeof doc.notes === "object" && doc.notes.type === "doc" ) { markdown = convertProseMirrorToMarkdown(doc.notes); } return { content: [ { type: "text", text: JSON.stringify( { id: doc.id, title: doc.title || "Untitled", markdown, created_at: doc.created_at, updated_at: doc.updated_at, metadata: { type: doc.type, people: doc.people, google_calendar_event: doc.google_calendar_event, }, }, null, 2 ), }, ], }; }
  • src/index.ts:108-121 (registration)
    Registration of the 'get_granola_document' tool in the tools array, including name, description, and input schema. Used by ListToolsRequestHandler.
    { name: "get_granola_document", description: "Get a specific Granola document by its ID.", inputSchema: { type: "object", properties: { id: { type: "string", description: "The document ID to retrieve", }, }, required: ["id"], }, },
  • Input schema definition for the 'get_granola_document' tool, specifying required 'id' parameter.
    inputSchema: { type: "object", properties: { id: { type: "string", description: "The document ID to retrieve", }, }, required: ["id"], },
  • Helper method in GranolaApiClient that retrieves a specific document by ID from all fetched documents.
    async getDocumentById(id: string): Promise<GranolaDocument | null> { const allDocs = await this.getAllDocuments(); return allDocs.find((doc) => doc.id === id) || null; }

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