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: {}
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'List available calendars' implies a read-only operation but doesn't specify permissions needed, pagination behavior, rate limits, or what 'available' means (e.g., user-accessible vs. all system calendars). This leaves significant gaps for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it immediately understandable without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and no output schema, the description is minimally adequate but incomplete. It lacks details on what 'available calendars' includes (e.g., personal vs. shared), return format, or error conditions, which are important for a read operation with no annotations to provide context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score since it doesn't need to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List available calendars' clearly states the verb ('List') and resource ('available calendars'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_events' or 'find_free_slots' that also involve calendar-related operations, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_events' and 'find_free_slots' that operate on calendars, there's no indication whether this tool is for metadata listing, event enumeration, or other purposes, leaving usage context ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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