Skip to content

@uriva/p2b-scheduling

2.0.5
Skill

Description

Create, query, and manage calendar events and meeting availability across Calendly, Google Calendar, and Microsoft 365 Calendar (Outlook) using safescript. Covers event creation, searching events, free/busy availability, and booking.

Triggered by

calendareventmeetingscheduleschedulingavailability
Pending
tank install -g @uriva/p2b-scheduling

Scheduling Skill

Tools for checking availability and scheduling meetings through Calendly, Google Calendar, and Microsoft 365 Calendar.

Calendly Functions

getCalendlyEventTypes(calendlyToken)

Returns { success, result, error } where result contains available event types.

getCalendlyAvailableSlots(calendlyToken, startTime, endTime)

Returns { success, result, error } where result contains available slots. startTime and endTime are ISO timestamps.

Google Calendar Functions

searchCalendarEvents(googleToken, calendarId, query, timeMin, timeMax)

Search events in a calendar and return { success, result, error }. timeMin/timeMax are ISO timestamps.

createCalendarEvent(googleToken, calendarId, summary, desc, start, endTime, location)

Create a new calendar event and return { success, result, error }.

updateCalendarEvent(googleToken, calendarId, eventId, summary?, desc?, location?, start?, endTime?)

Update or reschedule an existing event in place and return { success, result, error }. Only non-empty fields are patched (leave unchanged fields omitted or ""), so rescheduling an event uses a single updateCalendarEvent call with start and endTime rather than deleting and recreating the event.

deleteCalendarEvent(googleToken, calendarId, eventId)

Delete an event from the calendar.

Microsoft 365 Calendar Functions

All Microsoft functions operate on the signed-in user's default calendar (/me/... in Microsoft Graph). The OAuth token must have been issued with the Calendars.ReadWrite scope (alias: calendar) for write operations, or Calendars.Read (alias: calendar_readonly) for read-only operations. All times are interpreted as UTC.

searchMicrosoftCalendarEvents(microsoftToken, query, timeMin, timeMax)

Search events in the user's calendar within a time window. timeMin/timeMax are ISO timestamps. Returns { success, result, error } where result is an array of events with id, subject, start, end, webLink.

createMicrosoftCalendarEvent(microsoftToken, subject, body, start, endTime, location)

Create a new event. start and endTime are ISO timestamps. Returns { success, result, error } where result has id and webLink.

updateMicrosoftCalendarEvent(microsoftToken, eventId, subject?, body_?, location?, start?, endTime?)

Update or reschedule an existing event in place. Only non-empty fields are patched (leave unchanged fields omitted or ""), so rescheduling uses a single updateMicrosoftCalendarEvent call rather than deleting and recreating the event.

deleteMicrosoftCalendarEvent(microsoftToken, eventId)

Delete an event from the user's calendar.

Usage

All functions require a token parameter mapped to a bot secret (secretMapping or "SECRET:<name>"). When the secret name is already known from the conversation or memory, use it directly without re-listing secrets. Only when the secret name is not yet known:

  1. Call secrets_and_variables/list_env_variables
  2. Pick the secret whose hosts match the service you need:
    • Google Calendar / Google Sheets: look for a secret with host www.googleapis.com
    • Calendly: look for a secret with host api.calendly.com
    • Microsoft 365: look for a secret with host graph.microsoft.com
  3. Pass that secret name in secretMapping (e.g. { "googleToken": "GOOGLE_WORKSPACE_TOKEN" })

Do not guess unknown secret names.

Example:

# 1. Discover secrets
secrets_and_variables/list_env_variables

# 2. Use the discovered Google Calendar secret (example: "GOOGLE_WORKSPACE_TOKEN")
searchCalendarEvents("GOOGLE_WORKSPACE_TOKEN", "primary", "meeting", "2026-04-19T00:00:00Z", "2026-04-20T00:00:00Z")

Meeting Attendees And Multi-Participant Scheduling

  • Always include attendees when scheduling with others: When creating a calendar event with a participant (e.g. "meeting with John"), do not create a solo event. Add their email to attendees so they receive a calendar invitation. If the email is unknown, ask the user or explicitly inform them that the event was created without inviting the participant.
  • Update events when contact details arrive: If the attendee's email is provided after event creation, update the event to add them.
  • Concise confirmations & account clarity: When creating a new event or when multiple calendar services/accounts are connected (e.g., both Google Calendar and Outlook), mention which calendar was used so the user knows where to look. For routine edits or reschedules on an existing event in a single known calendar, confirm concisely (event title + new day/time) without repeating raw account emails, IANA timezone IDs, or calendar URLs unless asked.

Scheduling Constraints

  • Never use setTimeout or setInterval in a Deno isolate: Deno isolates on prompt2bot are short-lived, ephemeral, and stateless. Using setTimeout or setInterval to schedule actions or trigger delayed logic will not fire reliably, as the isolate can spin down immediately after the main handler returns. For scheduled, delayed, or recurring tasks, always use platform-level scheduling (such as the prompt2bot create-remote-task API or appropriate task queues) instead of in-memory timers.

Command Palette

Search packages, docs, and navigate Tank