Skip to content

Commit e440e02

Browse files
authored
fix(core): Added date field for the GCal MCP (google-gemini#27251)
1 parent c854b60 commit e440e02

2 files changed

Lines changed: 53 additions & 7 deletions

File tree

evals/calendar-all-day.eval.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { evalTest } from './test-helper.js';
2+
import { expect } from 'vitest';
3+
4+
evalTest('USUALLY_PASSES', {
5+
suiteName: 'default',
6+
suiteType: 'behavioral',
7+
name: 'should create an all-day event using the optional date field',
8+
prompt:
9+
'Create an all-day event for 2026-05-20 titled "Company Retreat". Do not use a specific time.',
10+
setup: async (rig) => {
11+
rig.addTestMcpServer('workspace-server', 'google-workspace');
12+
},
13+
assert: async (rig) => {
14+
const toolLogs = rig.readToolLogs();
15+
console.log('TOOL LOGS:', JSON.stringify(toolLogs, null, 2));
16+
17+
const createEventCall = toolLogs.find(
18+
(log) =>
19+
log.toolRequest.name === 'mcp_workspace-server_calendar.createEvent',
20+
);
21+
22+
expect(createEventCall).toBeDefined();
23+
24+
const args = JSON.parse(createEventCall!.toolRequest.args);
25+
26+
expect(args?.start).toHaveProperty('date');
27+
expect(args?.start).not.toHaveProperty('dateTime');
28+
expect(args?.start?.date).toBe('2026-05-20');
29+
30+
expect(args?.end).toHaveProperty('date');
31+
expect(args?.end).not.toHaveProperty('dateTime');
32+
},
33+
});

packages/test-utils/assets/test-servers/google-workspace.json

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,19 +684,25 @@
684684
"dateTime": {
685685
"type": "string",
686686
"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)."
687+
},
688+
"date": {
689+
"type": "string",
690+
"description": "The date, in the format \"yyyy-mm-dd\", for an all-day event."
687691
}
688-
},
689-
"required": ["dateTime"]
692+
}
690693
},
691694
"end": {
692695
"type": "object",
693696
"properties": {
694697
"dateTime": {
695698
"type": "string",
696699
"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)."
700+
},
701+
"date": {
702+
"type": "string",
703+
"description": "The date, in the format \"yyyy-mm-dd\", for an all-day event."
697704
}
698-
},
699-
"required": ["dateTime"]
705+
}
700706
},
701707
"attendees": {
702708
"description": "The email addresses of the attendees.",
@@ -881,19 +887,26 @@
881887
"dateTime": {
882888
"type": "string",
883889
"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)."
890+
},
891+
"date": {
892+
"type": "string",
893+
"description": "The new date, in the format \"yyyy-mm-dd\", for an all-day event."
884894
}
885-
},
886-
"required": ["dateTime"]
895+
}
887896
},
888897
"end": {
889898
"type": "object",
890899
"properties": {
891900
"dateTime": {
892901
"type": "string",
893902
"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)."
903+
},
904+
"date": {
905+
"type": "string",
906+
"description": "The new date, in the format \"yyyy-mm-dd\", for an all-day event."
894907
}
895908
},
896-
"required": ["dateTime"]
909+
"anyOf": [{ "required": ["dateTime"] }, { "required": ["date"] }]
897910
},
898911
"attendees": {
899912
"description": "The new list of attendees for the event.",

0 commit comments

Comments
 (0)