Skip to main content
Glama
by ricleedo

calendar-list-calendars

Retrieve all available Google Calendar calendars to view and manage your scheduled events and appointments across multiple calendars.

Instructions

List all available calendars

Input Schema

NameRequiredDescriptionDefault
maxResultsNoMaximum number of calendars to return

Input Schema (JSON Schema)

{ "properties": { "maxResults": { "default": 10, "description": "Maximum number of calendars to return", "maximum": 250, "minimum": 1, "type": "number" } }, "type": "object" }

Implementation Reference

  • Main handler function that lists all available Google Calendars using the Google Calendar API v3. It authenticates, fetches the calendar list with maxResults parameter, maps the data, formats it to markdown using formatCalendarsToMarkdown, and returns structured content or error.
    export async function listCalendars( params: z.infer<ReturnType<typeof listCalendarsSchema>> ) { try { const auth = createCalendarAuth(); const calendar = google.calendar({ version: "v3", auth }); const response = await calendar.calendarList.list({ maxResults: params.maxResults, }); const calendars = response.data.items?.map((cal) => ({ id: cal.id, summary: cal.summary, description: cal.description, timeZone: cal.timeZone, accessRole: cal.accessRole, primary: cal.primary, backgroundColor: cal.backgroundColor, foregroundColor: cal.foregroundColor, })); return { content: [ { type: "text" as const, text: formatCalendarsToMarkdown(calendars || []), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error listing calendars: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }
  • Zod schema definition for the input parameters of the listCalendars tool. Defines optional maxResults (number, 1-250, default 10).
    export const listCalendarsSchema = () => z.object({ maxResults: z .number() .min(1) .max(250) .default(10) .describe("Maximum number of calendars to return"), });
  • src/index.ts:260-267 (registration)
    Registers the "calendar-list-calendars" tool on the MCP server inside registerCalendarTools function, providing name, description, schema from listCalendarsSchema, and thin wrapper handler calling listCalendars.
    server.tool( "calendar-list-calendars", "List all available calendars", listCalendarsSchema().shape, async (params) => { return await listCalendars(params); } );

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/ricleedo/Google-Service-MCP'

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