Skip to main content
Glama
peadams21

Google Calendar MCP Server

by peadams21

list_calendars

Retrieve available Google Calendars with options to filter by access role and include deleted or hidden calendars.

Instructions

List available Google Calendars

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
minAccessRoleNoMinimum access role filter
showDeletedNoInclude deleted calendars (default: false)
showHiddenNoInclude hidden calendars (default: false)

Implementation Reference

  • The main handler function that executes the list_calendars tool logic, calling the Google Calendar API to list calendars.
    async function handleListCalendars(args: z.infer<typeof ListCalendarsArgsSchema>) { try { const response = await calendar.calendarList.list({ minAccessRole: args.minAccessRole, showDeleted: args.showDeleted, showHidden: args.showHidden, }); return { content: [ { type: "text", text: JSON.stringify({ success: true, calendars: response.data.items || [], summary: `Found ${(response.data.items || []).length} calendars`, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : "Unknown error", }, null, 2), }, ], isError: true, }; } }
  • Zod schema for validating input arguments to the list_calendars tool.
    const ListCalendarsArgsSchema = z.object({ minAccessRole: z.enum(["freeBusyReader", "owner", "reader", "writer"]).optional(), showDeleted: z.boolean().optional().default(false), showHidden: z.boolean().optional().default(false), });
  • src/index.ts:311-334 (registration)
    Tool registration in the tools array, defining name, description, and input schema for list_calendars.
    { name: "list_calendars", description: "List available Google Calendars", inputSchema: { type: "object", properties: { minAccessRole: { type: "string", enum: ["freeBusyReader", "owner", "reader", "writer"], description: "Minimum access role filter", }, showDeleted: { type: "boolean", description: "Include deleted calendars (default: false)", default: false, }, showHidden: { type: "boolean", description: "Include hidden calendars (default: false)", default: false, }, }, }, },
  • Dispatch case in the main CallToolRequestSchema handler that routes to the list_calendars handler after validation.
    case "list_calendars": { const validatedArgs = ListCalendarsArgsSchema.parse(args); return await handleListCalendars(validatedArgs); }

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/peadams21/Google-Calendar-MCP-Server'

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