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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID to retrieve |
Implementation Reference
- src/index.ts:350-409 (handler)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"], }, },
- src/index.ts:111-120 (schema)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"], },
- src/granola-api.ts:146-149 (helper)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; }