w
This commit is contained in:
+47
-13
@@ -8,22 +8,30 @@ export function registerAvailabilityTools(server: McpServer): void {
|
||||
{
|
||||
description: "Find free time slots in your own calendar."
|
||||
+ " Queries your free/busy status and returns available slots"
|
||||
+ " within working hours that meet the minimum duration."
|
||||
+ " Returns {freeSlots: {date: [{start, end, durationMinutes}]}}."
|
||||
+ " Defaults: durationMinutes=30, startHour=9, endHour=18.",
|
||||
+ " within working hours that meet the minimum duration.",
|
||||
inputSchema: z.object({
|
||||
startDate: z.string().describe("Start date in YYYY-MM-DD format"),
|
||||
endDate: z.string().optional().describe(
|
||||
"End date in YYYY-MM-DD format. Defaults to startDate",
|
||||
"End date in YYYY-MM-DD format",
|
||||
),
|
||||
durationMinutes: z.number().default(30).describe(
|
||||
"Minimum slot duration in minutes. Default: 30",
|
||||
"Minimum slot duration in minutes",
|
||||
),
|
||||
startHour: z.number().default(9).describe(
|
||||
"Working day start hour (0-23). Default: 9",
|
||||
"Working day start hour (0-23)",
|
||||
),
|
||||
endHour: z.number().default(18).describe(
|
||||
"Working day end hour (0-23). Default: 18",
|
||||
"Working day end hour (0-23)",
|
||||
),
|
||||
}),
|
||||
outputSchema: z.object({
|
||||
freeSlots: z.record(
|
||||
z.string(),
|
||||
z.array(z.object({
|
||||
start: z.string(),
|
||||
end: z.string(),
|
||||
durationMinutes: z.number(),
|
||||
})),
|
||||
),
|
||||
}),
|
||||
},
|
||||
@@ -83,6 +91,7 @@ export function registerAvailabilityTools(server: McpServer): void {
|
||||
type: "text" as const,
|
||||
text: JSON.stringify({ freeSlots }),
|
||||
}],
|
||||
structuredContent: { freeSlots },
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
@@ -98,24 +107,44 @@ export function registerAvailabilityTools(server: McpServer): void {
|
||||
server.registerTool(
|
||||
"find_meeting_time",
|
||||
{
|
||||
description:
|
||||
"Find common free time for multiple attendees. Queries free/busy for all attendees and returns slots where everyone is available. Returns {period, attendees, freeSlots}. Defaults: durationMinutes=30, startHour=9, endHour=18.",
|
||||
description: "Find common free time for multiple attendees."
|
||||
+ " Queries free/busy for all attendees and returns slots where everyone is available.",
|
||||
inputSchema: z.object({
|
||||
emails: z.string().describe(
|
||||
"Comma-separated email addresses of attendees",
|
||||
),
|
||||
startDate: z.string().describe("Start date in YYYY-MM-DD format"),
|
||||
endDate: z.string().optional().describe(
|
||||
"End date in YYYY-MM-DD format. Defaults to startDate",
|
||||
"End date in YYYY-MM-DD format",
|
||||
),
|
||||
durationMinutes: z.number().default(30).describe(
|
||||
"Minimum slot duration in minutes. Default: 30",
|
||||
"Minimum slot duration in minutes",
|
||||
),
|
||||
startHour: z.number().default(9).describe(
|
||||
"Working day start hour (0-23). Default: 9",
|
||||
"Working day start hour (0-23)",
|
||||
),
|
||||
endHour: z.number().default(18).describe(
|
||||
"Working day end hour (0-23). Default: 18",
|
||||
"Working day end hour (0-23)",
|
||||
),
|
||||
}),
|
||||
outputSchema: z.object({
|
||||
period: z.object({
|
||||
start: z.string(),
|
||||
end: z.string(),
|
||||
}),
|
||||
attendees: z.array(z.object({
|
||||
email: z.string(),
|
||||
busySlots: z.number().optional(),
|
||||
freeSlots: z.number().optional(),
|
||||
calendarEvents: z.number().optional(),
|
||||
})),
|
||||
freeSlots: z.record(
|
||||
z.string(),
|
||||
z.array(z.object({
|
||||
start: z.string(),
|
||||
end: z.string(),
|
||||
durationMinutes: z.number(),
|
||||
})),
|
||||
),
|
||||
}),
|
||||
},
|
||||
@@ -197,6 +226,11 @@ export function registerAvailabilityTools(server: McpServer): void {
|
||||
freeSlots: freeByDate,
|
||||
}),
|
||||
}],
|
||||
structuredContent: {
|
||||
period: { start: startDate, end: ed },
|
||||
attendees: attendeeInfo,
|
||||
freeSlots: freeByDate,
|
||||
},
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user