Skip to main content
Glama

get_calendars

List available calendars from Microsoft Outlook to view and manage your schedule directly through the MCP server integration.

Instructions

List available calendars

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes PowerShell script to list all available Outlook calendars (default and additional folders).
    async getCalendars(): Promise<any[]> { try { const script = ` try { Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook" -ErrorAction Stop $outlook = New-Object -ComObject Outlook.Application -ErrorAction Stop $namespace = $outlook.GetNamespace("MAPI") # Build calendars array $calendars = @() # Add default calendar $calendars += [PSCustomObject]@{ Name = "Default" Owner = $namespace.CurrentUser.Name IsDefault = $true } # Add other calendars foreach ($folder in $namespace.Folders) { try { $calendarFolder = $folder.Folders("Calendar") if ($calendarFolder) { $calendars += [PSCustomObject]@{ Name = "$($folder.Name) - Calendar" Owner = $folder.Name IsDefault = $false } } } catch { } } Write-Output ($calendars | ConvertTo-Json -Compress) } catch { Write-Output ([PSCustomObject]@{ Error = $_.Exception.Message } | ConvertTo-Json -Compress) } `; const result = await this.executePowerShell(script); const cleanResult = result.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, '').trim(); const data = JSON.parse(cleanResult); if (data.Error) { throw new Error(data.Error); } return Array.isArray(data) ? data : [data]; } catch (error) { throw new Error(`Failed to get calendars: ${error instanceof Error ? error.message : String(error)}`); } }
  • MCP server tool call handler that invokes outlookManager.getCalendars() and formats the response.
    case 'get_calendars': { const calendars = await outlookManager.getCalendars(); return { content: [ { type: 'text', text: `📅 **Available Calendars**\nTotal: ${calendars.length} calendars\n\n` + calendars.map((calendar, index) => `${index + 1}. ${calendar.IsDefault ? '⭐' : '📅'} **${calendar.Name}**\n Owner: ${calendar.Owner}` ).join('\n') }, ], }; }
  • src/index.ts:449-455 (registration)
    Tool registration in the MCP server's listTools response, including name, description, and empty input schema.
    name: "get_calendars", description: "List available calendars", inputSchema: { type: "object", properties: {} } }
  • Input schema definition for get_calendars tool (no required parameters).
    inputSchema: { type: "object", properties: {} }

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/cqyefeng119/windows-outlook-mcp'

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