From 2bcad7aa54f0719ca35e543d6a5a9bbe283dc03c Mon Sep 17 00:00:00 2001 From: Dev Randalpura Date: Tue, 19 May 2026 11:40:37 -0400 Subject: [PATCH 1/2] Added date field for all-day events --- evals/calendar-all-day.eval.ts | 33 +++++++++++++++++++ .../assets/test-servers/google-workspace.json | 28 +++++++++++----- 2 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 evals/calendar-all-day.eval.ts diff --git a/evals/calendar-all-day.eval.ts b/evals/calendar-all-day.eval.ts new file mode 100644 index 00000000000..662c9421fe5 --- /dev/null +++ b/evals/calendar-all-day.eval.ts @@ -0,0 +1,33 @@ +import { evalTest } from './test-helper.js'; +import { expect } from 'vitest'; + +evalTest('USUALLY_PASSES', { + suiteName: 'default', + suiteType: 'behavioral', + name: 'should create an all-day event using the optional date field', + prompt: + 'Create an all-day event for 2026-05-20 titled "Company Retreat". Do not use a specific time.', + setup: async (rig) => { + rig.addTestMcpServer('workspace-server', 'google-workspace'); + }, + assert: async (rig) => { + const toolLogs = rig.readToolLogs(); + console.log('TOOL LOGS:', JSON.stringify(toolLogs, null, 2)); + + const createEventCall = toolLogs.find( + (log) => + log.toolRequest.name === 'mcp_workspace-server_calendar.createEvent', + ); + + expect(createEventCall).toBeDefined(); + + const args = JSON.parse(createEventCall?.toolRequest.args); + + expect(args?.start).toHaveProperty('date'); + expect(args?.start).not.toHaveProperty('dateTime'); + expect(args?.start?.date).toBe('2026-05-20'); + + expect(args?.end).toHaveProperty('date'); + expect(args?.end).not.toHaveProperty('dateTime'); + }, +}); diff --git a/packages/test-utils/assets/test-servers/google-workspace.json b/packages/test-utils/assets/test-servers/google-workspace.json index ceb46c0671a..e90049ac72c 100644 --- a/packages/test-utils/assets/test-servers/google-workspace.json +++ b/packages/test-utils/assets/test-servers/google-workspace.json @@ -684,9 +684,12 @@ "dateTime": { "type": "string", "description": "The start time in strict ISO 8601 format with seconds and timezone (e.g., 2024-01-15T10:30:00Z or 2024-01-15T10:30:00-05:00)." + }, + "date": { + "type": "string", + "description": "The date, in the format \"yyyy-mm-dd\", for an all-day event." } - }, - "required": ["dateTime"] + } }, "end": { "type": "object", @@ -694,9 +697,12 @@ "dateTime": { "type": "string", "description": "The end time in strict ISO 8601 format with seconds and timezone (e.g., 2024-01-15T11:30:00Z or 2024-01-15T11:30:00-05:00)." + }, + "date": { + "type": "string", + "description": "The date, in the format \"yyyy-mm-dd\", for an all-day event." } - }, - "required": ["dateTime"] + } }, "attendees": { "description": "The email addresses of the attendees.", @@ -881,9 +887,12 @@ "dateTime": { "type": "string", "description": "The new start time in strict ISO 8601 format with seconds and timezone (e.g., 2024-01-15T10:30:00Z or 2024-01-15T10:30:00-05:00)." + }, + "date": { + "type": "string", + "description": "The new date, in the format \"yyyy-mm-dd\", for an all-day event." } - }, - "required": ["dateTime"] + } }, "end": { "type": "object", @@ -891,9 +900,12 @@ "dateTime": { "type": "string", "description": "The new end time in strict ISO 8601 format with seconds and timezone (e.g., 2024-01-15T11:30:00Z or 2024-01-15T11:30:00-05:00)." + }, + "date": { + "type": "string", + "description": "The new date, in the format \"yyyy-mm-dd\", for an all-day event." } - }, - "required": ["dateTime"] + } }, "attendees": { "description": "The new list of attendees for the event.", From 70ef3dd29ecdcd380e7516c5b8bbdeadeab95a76 Mon Sep 17 00:00:00 2001 From: Dev Randalpura Date: Tue, 19 May 2026 14:04:10 -0400 Subject: [PATCH 2/2] fix(test-utils): support all-day events in google calendar mock Makes `dateTime` optional and adds a `date` field in `calendar.createEvent` and `calendar.updateEvent` to align with the underlying API and allow testing all-day events. Added a behavioral test to ensure the LLM correctly supplies `date` instead of `dateTime` when requested to create an all-day event. --- evals/calendar-all-day.eval.ts | 2 +- packages/test-utils/assets/test-servers/google-workspace.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/evals/calendar-all-day.eval.ts b/evals/calendar-all-day.eval.ts index 662c9421fe5..e29a779391c 100644 --- a/evals/calendar-all-day.eval.ts +++ b/evals/calendar-all-day.eval.ts @@ -21,7 +21,7 @@ evalTest('USUALLY_PASSES', { expect(createEventCall).toBeDefined(); - const args = JSON.parse(createEventCall?.toolRequest.args); + const args = JSON.parse(createEventCall!.toolRequest.args); expect(args?.start).toHaveProperty('date'); expect(args?.start).not.toHaveProperty('dateTime'); diff --git a/packages/test-utils/assets/test-servers/google-workspace.json b/packages/test-utils/assets/test-servers/google-workspace.json index e90049ac72c..106be5ecca1 100644 --- a/packages/test-utils/assets/test-servers/google-workspace.json +++ b/packages/test-utils/assets/test-servers/google-workspace.json @@ -905,7 +905,8 @@ "type": "string", "description": "The new date, in the format \"yyyy-mm-dd\", for an all-day event." } - } + }, + "anyOf": [{ "required": ["dateTime"] }, { "required": ["date"] }] }, "attendees": { "description": "The new list of attendees for the event.",