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: {}
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.0

TDQS

B3.1/5.0
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. 'List available calendars' implies a read operation but doesn't disclose behavioral traits like whether it lists all calendars or only accessible ones, pagination, rate limits, or authentication requirements. This leaves significant gaps for a tool with no 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 'List available calendars' is a single, efficient sentence that front-loads the core purpose with zero wasted words. It's appropriately sized for a simple tool with no parameters.

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

Completeness2/5

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

Given no annotations, no output schema, and multiple sibling tools, the description is incomplete. It doesn't explain what 'available' means (e.g., user-accessible vs. all), return format, or differentiation from similar tools, leaving the agent with insufficient context for optimal use.

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 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter details, and it appropriately doesn't mention any, earning a baseline score of 4 for this scenario.

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 'get_attendee_status', which prevents 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' (for events within calendars) and 'find_free_slots' (for availability), there's clear need for differentiation, but the description offers none.

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