Skip to content

🐛 Bug: updateEvent operation fails with 'Cannot read properties of undefined (reading 'start')' #31

@AojdevStudio

Description

@AojdevStudio

Bug Description

The updateEvent operation in the calendar module fails with the error:

MCP error -32603: Cannot read properties of undefined (reading 'start')

This occurs regardless of how the start/end times are formatted in the parameters.

Steps to Reproduce

  1. Create a calendar event using quickAdd:
{
  "operation": "quickAdd",
  "params": {
    "text": "Meeting January 10 2pm-3pm"
  }
}
  1. Attempt to update the event to add attendees:
{
  "operation": "updateEvent",
  "params": {
    "eventId": "<event-id>",
    "summary": "Updated Title",
    "description": "Meeting description",
    "start": "2026-01-10T14:00:00-06:00",
    "end": "2026-01-10T15:00:00-06:00",
    "attendees": ["user@example.com"],
    "sendUpdates": "all"
  }
}

Expected Behavior

The event should be updated with the new title, description, and attendees. Invites should be sent to the specified attendees.

Actual Behavior

The operation fails with:

MCP error -32603: Cannot read properties of undefined (reading 'start')

Variations Attempted

All of these parameter formats failed with the same error:

Format 1: ISO string

{
  "start": "2026-01-10T14:00:00-06:00",
  "end": "2026-01-10T15:00:00-06:00"
}

Format 2: Object with dateTime

{
  "start": {"dateTime": "2026-01-10T14:00:00-06:00", "timeZone": "America/Chicago"},
  "end": {"dateTime": "2026-01-10T15:00:00-06:00", "timeZone": "America/Chicago"}
}

Format 3: startTime/endTime

{
  "startTime": "2026-01-10T14:00:00-06:00",
  "endTime": "2026-01-10T15:00:00-06:00"
}

Root Cause Hypothesis

The updateEvent handler likely expects a specific parameter structure but is receiving undefined when accessing params.start or a nested property. The validation/parsing logic may not be handling the input correctly.

Acceptance Criteria

  • updateEvent operation successfully updates calendar events
  • Attendees can be added to existing events
  • sendUpdates parameter sends invites to attendees
  • Support both ISO string and object formats for start/end times
  • Add input validation with clear error messages for malformed parameters

Technical Notes

File to investigate: src/tools/calendar.ts (or similar)

Related operations that work:

  • quickAdd - works correctly
  • createEvent - also has issues (different error)
  • deleteEvent - works correctly
  • getEvent - works correctly

Priority

P2 - Medium (workaround exists: send email invites separately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions