Skip to main content
Glama

set_show_as

Update calendar event availability status in Outlook to indicate Free, Busy, Tentative, Out of Office, or Working Elsewhere status for scheduling clarity.

Instructions

Set Show As (Free/Busy status) for a calendar event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdNoEvent ID to update
subjectNoSubject of the event to find
startDateNoStart date of the event to find (ISO 8601 format)
showAsYesShow As status to set

Implementation Reference

  • Main handler function in OutlookManager class that finds the calendar event by ID/subject/date and sets its BusyStatus (Show As) via PowerShell script execution.
    async setShowAs(options: {
      eventId?: string;
      subject?: string;
      startDate?: Date;
      showAs: 'Free' | 'Tentative' | 'Busy' | 'OutOfOffice' | 'WorkingElsewhere';
    }): Promise<{ success: boolean; message: string }> {
      try {
        // Map ShowAs values to Outlook constants
        const showAsMap: Record<string, number> = {
          'Free': 0,           // olFree
          'Tentative': 1,      // olTentative
          'Busy': 2,           // olBusy
          'OutOfOffice': 3,    // olOutOfOffice
          'WorkingElsewhere': 4 // olWorkingElsewhere
        };
    
        const busyStatus = showAsMap[options.showAs];
        const eventId = options.eventId ? `"${options.eventId.replace(/"/g, '""')}"` : 'null';
        const subject = options.subject ? `"${options.subject.replace(/"/g, '""')}"` : 'null';
        const startDate = options.startDate ? `"${options.startDate.toISOString()}"` : 'null';
    
        const script = `
          try {
            Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook" -ErrorAction Stop
            $outlook = New-Object -ComObject Outlook.Application -ErrorAction Stop
            $namespace = $outlook.GetNamespace("MAPI")
            $calendar = $namespace.GetDefaultFolder(9)
            
            $appointmentItem = $null
            
            # Find by ID if provided
            if (${eventId} -ne $null) {
              try {
                $appointmentItem = $namespace.GetItemFromID(${eventId})
              } catch { }
            }
            
            # Search by subject or date if not found
            if (-not $appointmentItem) {
              $items = $calendar.Items
              $items.Sort("[Start]")
              
              foreach ($item in $items) {
                $matchSubject = (${subject} -eq $null) -or ($item.Subject -like "*$(${subject})*")
                $matchDate = (${startDate} -eq $null) -or ([Math]::Abs(([DateTime]$item.Start - [DateTime]${startDate}).TotalMinutes) -lt 1)
                
                if ($matchSubject -and $matchDate) {
                  $appointmentItem = $item
                  break
                }
              }
            }
            
            if (-not $appointmentItem) {
              throw "Appointment not found. Please provide eventId, subject, or startDate."
            }
            
            $appointmentItem.BusyStatus = ${busyStatus}
            $appointmentItem.Save()
            
            Write-Output ([PSCustomObject]@{
              Success = $true
              Subject = $appointmentItem.Subject
              ShowAs = "${options.showAs}"
            } | ConvertTo-Json -Compress)
            
          } catch {
            Write-Output ([PSCustomObject]@{
              Success = $false
              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.Success) {
          throw new Error(data.Error || 'Failed to set Show As');
        }
    
        return {
          success: true,
          message: `Show As set to ${options.showAs} for: ${data.Subject}`
        };
      } catch (error) {
        throw new Error(`Failed to set Show As: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/index.ts:685-701 (registration)
    Dispatcher case in CallToolRequest handler that extracts parameters and calls the setShowAs method on OutlookManager.
    case 'set_show_as': {
      const options = {
        eventId: (args as any)?.eventId,
        subject: (args as any)?.subject,
        startDate: (args as any)?.startDate ? new Date((args as any).startDate) : undefined,
        showAs: (args as any)?.showAs
      };
      const result = await outlookManager.setShowAs(options);
      return {
        content: [
          {
            type: 'text',
            text: `${result.success ? '✅' : '❌'} **Show As Updated**\n\n${result.message}`,
          },
        ],
      };
    }
  • src/index.ts:245-270 (registration)
    Tool registration in ListToolsRequest handler, including name, description, and input schema definition.
      name: "set_show_as",
      description: "Set Show As (Free/Busy status) for a calendar event",
      inputSchema: {
        type: "object",
        properties: {
          eventId: {
            type: "string",
            description: "Event ID to update"
          },
          subject: {
            type: "string",
            description: "Subject of the event to find"
          },
          startDate: {
            type: "string",
            description: "Start date of the event to find (ISO 8601 format)"
          },
          showAs: {
            type: "string",
            enum: ["Free", "Tentative", "Busy", "OutOfOffice", "WorkingElsewhere"],
            description: "Show As status to set"
          }
        },
        required: ["showAs"]
      }
    },
  • Input schema definition for the set_show_as tool, specifying parameters and validation.
    inputSchema: {
      type: "object",
      properties: {
        eventId: {
          type: "string",
          description: "Event ID to update"
        },
        subject: {
          type: "string",
          description: "Subject of the event to find"
        },
        startDate: {
          type: "string",
          description: "Start date of the event to find (ISO 8601 format)"
        },
        showAs: {
          type: "string",
          enum: ["Free", "Tentative", "Busy", "OutOfOffice", "WorkingElsewhere"],
          description: "Show As status to set"
        }
      },
      required: ["showAs"]
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is a mutation tool ('Set'), implying it modifies data, but doesn't disclose behavioral traits like required permissions, whether changes are reversible, error handling, or rate limits. This is a significant gap for a tool that updates calendar events.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the complexity of updating calendar events, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral aspects, error cases, or return values, which are crucial for an agent to use this tool effectively in a real-world context.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema, such as explaining parameter interactions or constraints. The baseline score of 3 reflects adequate but minimal value added by the description.

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 clearly states the verb ('Set') and resource ('Show As status for a calendar event'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'update_event' or 'create_event_with_show_as', which might have overlapping functionality.

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 like 'update_event' or 'create_event_with_show_as'. It doesn't mention prerequisites, exclusions, or specific contexts, leaving the agent to infer usage from the tool name alone.

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