Skip to main content
Glama

create_event_with_show_as

Schedule calendar events in Outlook with specific availability status like OutOfOffice for vacation or WorkingElsewhere to indicate your presence.

Instructions

Create a calendar event with specific Show As status (e.g., OutOfOffice for vacation)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectYesEvent subject/title
startYesStart date and time (ISO 8601 format)
endYesEnd date and time (ISO 8601 format)
locationNoEvent location
bodyNoEvent description/body
showAsNoShow As status (default: Busy)
reminderMinutesNoReminder time in minutes before the event

Implementation Reference

  • The core handler function that implements the tool logic by generating and executing PowerShell script to create Outlook calendar appointment with BusyStatus (Show As) using COM interop.
    async createEventWithShowAs(options: {
      subject: string;
      start: Date;
      end: Date;
      location?: string;
      body?: string;
      showAs?: 'Free' | 'Tentative' | 'Busy' | 'OutOfOffice' | 'WorkingElsewhere';
      reminderMinutes?: number;
    }): Promise<{ success: boolean; eventId: string; message: string }> {
      try {
        // Map ShowAs values to Outlook constants
        const showAsMap: Record<string, number> = {
          'Free': 0,
          'Tentative': 1,
          'Busy': 2,
          'OutOfOffice': 3,
          'WorkingElsewhere': 4
        };
    
        const busyStatus = showAsMap[options.showAs || 'Busy'];
        const cleanSubject = this.cleanText(options.subject);
        const cleanLocation = options.location ? this.cleanText(options.location) : '';
        const cleanBody = options.body ? this.cleanText(options.body) : '';
        
        const script = `
          try {
            Add-Type -AssemblyName "Microsoft.Office.Interop.Outlook" -ErrorAction Stop
            $outlook = New-Object -ComObject Outlook.Application -ErrorAction Stop
            $appointmentItem = $outlook.CreateItem(1)
            
            $appointmentItem.Subject = "${cleanSubject.replace(/"/g, '""')}"
            $appointmentItem.Start = [DateTime]"${options.start.toISOString()}"
            $appointmentItem.End = [DateTime]"${options.end.toISOString()}"
            
            ${options.location ? `$appointmentItem.Location = "${cleanLocation.replace(/"/g, '""')}"` : ''}
            ${options.body ? `$appointmentItem.Body = "${cleanBody.replace(/"/g, '""')}"` : ''}
            
            $appointmentItem.BusyStatus = ${busyStatus}
            
            ${options.reminderMinutes !== undefined ? `
            $appointmentItem.ReminderSet = $true
            $appointmentItem.ReminderMinutesBeforeStart = ${options.reminderMinutes}
            ` : ''}
            
            $appointmentItem.Save()
            
            Write-Output ([PSCustomObject]@{
              Success = $true
              EventId = $appointmentItem.EntryID
              Subject = $appointmentItem.Subject
              ShowAs = "${options.showAs || 'Busy'}"
            } | 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 create event');
        }
    
        return {
          success: true,
          eventId: data.EventId,
          message: `Event created: ${data.Subject} with Show As: ${data.ShowAs}`
        };
      } catch (error) {
        throw new Error(`Failed to create event with Show As: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • The input schema definition for the MCP tool, specifying parameters like subject, start/end dates, showAs enum, etc.
    name: "create_event_with_show_as",
    description: "Create a calendar event with specific Show As status (e.g., OutOfOffice for vacation)",
    inputSchema: {
      type: "object",
      properties: {
        subject: {
          type: "string",
          description: "Event subject/title"
        },
        start: {
          type: "string",
          description: "Start date and time (ISO 8601 format)"
        },
        end: {
          type: "string",
          description: "End date and time (ISO 8601 format)"
        },
        location: {
          type: "string",
          description: "Event location"
        },
        body: {
          type: "string",
          description: "Event description/body"
        },
        showAs: {
          type: "string",
          enum: ["Free", "Tentative", "Busy", "OutOfOffice", "WorkingElsewhere"],
          description: "Show As status (default: Busy)"
        },
        reminderMinutes: {
          type: "number",
          description: "Reminder time in minutes before the event"
        }
      },
      required: ["subject", "start", "end"]
    }
  • src/index.ts:703-721 (registration)
    The registration in the MCP request handler switch statement that parses arguments, calls the handler, and formats the response.
    case 'create_event_with_show_as': {
      const result = await outlookManager.createEventWithShowAs({
        subject: (args as any)?.subject,
        start: new Date((args as any)?.start),
        end: new Date((args as any)?.end),
        location: (args as any)?.location,
        body: (args as any)?.body,
        showAs: (args as any)?.showAs,
        reminderMinutes: (args as any)?.reminderMinutes
      });
      return {
        content: [
          {
            type: 'text',
            text: `${result.success ? '✅' : '❌'} **Calendar Event Created**\n\n${result.message}\n\n**Event ID:** ${result.eventId}`,
          },
        ],
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool creates events, implying a write/mutation operation, but doesn't mention authentication requirements, rate limits, whether events are immediately published to calendars, or what happens on failure. The example ('OutOfOffice for vacation') adds some context but doesn't cover critical behavioral aspects for a creation tool.

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 extremely concise - a single sentence with a parenthetical example. It's front-loaded with the core purpose and wastes no words. Every element (the main action and the example) earns its place without redundancy.

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?

For a creation tool with 7 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address what the tool returns (event ID? success status?), error conditions, or behavioral constraints. While the schema covers parameter details, the description lacks context about the operation's effects and outcomes that would help an agent use it correctly.

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 7 parameters thoroughly. The description adds minimal value beyond the schema: it emphasizes the 'showAs' parameter with an example ('OutOfOffice for vacation'), but doesn't provide additional semantic context about other parameters or their relationships. Baseline 3 is appropriate when schema does the heavy lifting.

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 tool's purpose: 'Create a calendar event with specific Show As status'. It specifies the verb ('Create') and resource ('calendar event') with a distinguishing feature ('specific Show As status'). However, it doesn't explicitly differentiate from sibling tools like 'create_draft' or 'update_event' beyond the Show As focus.

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 minimal usage guidance. It mentions 'e.g., OutOfOffice for vacation' as an example, but doesn't specify when to use this tool versus alternatives like 'set_show_as' (which might modify existing events) or 'create_draft' (which might create events without immediate Show As settings). No explicit when/when-not instructions or prerequisite context is provided.

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