16
src/index.ts
16
src/index.ts
@@ -740,10 +740,24 @@ server.registerTool(
|
|||||||
},
|
},
|
||||||
async ({ account, title, startDateTime, durationMinutes, description, location }) => {
|
async ({ account, title, startDateTime, durationMinutes, description, location }) => {
|
||||||
try {
|
try {
|
||||||
|
const start = new Date(startDateTime);
|
||||||
|
|
||||||
|
if (start.getTime() < Date.now()) {
|
||||||
|
return {
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
type: "text" as const,
|
||||||
|
text:
|
||||||
|
`Skipped calendar event "${title}" — the proposed date ` +
|
||||||
|
`(${start.toISOString()}) is in the past.`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const calendar = getCalendarClient(account);
|
const calendar = getCalendarClient(account);
|
||||||
const calendarId = getCalendarId(account);
|
const calendarId = getCalendarId(account);
|
||||||
|
|
||||||
const start = new Date(startDateTime);
|
|
||||||
const end = new Date(start.getTime() + (durationMinutes ?? 60) * 60_000);
|
const end = new Date(start.getTime() + (durationMinutes ?? 60) * 60_000);
|
||||||
|
|
||||||
const event = await calendar.events.insert({
|
const event = await calendar.events.insert({
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ When an email indicates advancement beyond the recruiter screen to a company int
|
|||||||
|
|
||||||
STRICT CONSTRAINTS:
|
STRICT CONSTRAINTS:
|
||||||
- Do not make up phone numbers, links, dates, or anything at all. If it does not exist in text wihtin a verifiable email, IT DOES NOT EXIST.
|
- Do not make up phone numbers, links, dates, or anything at all. If it does not exist in text wihtin a verifiable email, IT DOES NOT EXIST.
|
||||||
|
- PAST-DATE CHECK: Before creating a calendar event, compare the proposed meeting date/time against today's date. If the meeting date has already passed, do NOT create a calendar event for it. Still log it to the spreadsheet, but skip the calendar step. The tool will also enforce this server-side.
|
||||||
- As described in more detail below, each new date/time value in a scheduling column = one new calendar event. Never skip this.
|
- As described in more detail below, each new date/time value in a scheduling column = one new calendar event. Never skip this.
|
||||||
- Always use the same account for calendar events as was used for email fetching.
|
- Always use the same account for calendar events as was used for email fetching.
|
||||||
- Do not create duplicate calendar events for the same meeting.
|
- Do not create duplicate calendar events for the same meeting.
|
||||||
|
|||||||
Reference in New Issue
Block a user