Skip to main content
Glama
EoinFalconer

Granola MCP Server

by EoinFalconer

list_workspaces

Retrieve all available workspaces in Granola.ai to organize and access meeting notes, transcripts, and content across projects.

Instructions

List all available workspaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.ts:259-284 (registration)
    Tool registration for 'list_workspaces' using FastMCP server.addTool(). Includes tool name, description, parameters schema (empty object), and the execute handler function that lists all available workspaces from workspacesCache.
    // Tool: list_workspaces server.addTool({ name: 'list_workspaces', description: 'List all available workspaces', parameters: z.object({}), execute: async () => { await ensureDataLoaded(); if (workspacesCache.length === 0) { return 'No workspaces found'; } const output: string[] = ['# Workspaces\n']; for (const ws of workspacesCache) { output.push(`## ${ws.name || 'Unnamed Workspace'}`); output.push(`**ID:** ${ws.id}`); if (ws.created_at) { output.push(`**Created:** ${formatDate(ws.created_at)}`); } output.push(''); } return output.join('\n'); } });
  • Handler function that executes the list_workspaces tool. Ensures data is loaded, checks if workspacesCache is empty, then formats and returns a markdown list of all workspaces with their ID, name, and creation date.
    execute: async () => { await ensureDataLoaded(); if (workspacesCache.length === 0) { return 'No workspaces found'; } const output: string[] = ['# Workspaces\n']; for (const ws of workspacesCache) { output.push(`## ${ws.name || 'Unnamed Workspace'}`); output.push(`**ID:** ${ws.id}`); if (ws.created_at) { output.push(`**Created:** ${formatDate(ws.created_at)}`); } output.push(''); } return output.join('\n'); }
  • Workspace interface defining the structure of workspace objects with id, name, created_at, and optional owner_id fields. This is the type used for workspacesCache items.
    export interface Workspace { id: string; name: string; created_at: string; owner_id?: string; }
  • ensureDataLoaded helper function called by the list_workspaces handler. Checks if cache is empty or stale and triggers loadData() if needed to ensure fresh data.
    async function ensureDataLoaded() { const now = Date.now(); if (documentsCache.size === 0 || (now - lastFetchTime) > CACHE_TTL) { await loadData(); } }
  • formatDate helper function used by the list_workspaces handler to format workspace creation dates in a human-readable format with local timezone.
    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; } }

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