Skip to content

Example: Add to Calendar

You:

add Team Meeting to the calendar on Oct 15th at 10

The event "Team Meeting" has been added to the calendar for October 15, 2025 at 10:00 AM.

Sidekick:

I've scheduled the Team Meeting for October 15th at 10:00 am. Can I help with anything else?

php
/**
 * Adds an event to the calendar.
 * 
 * Write detailed instructions for the AI to learn
 * how to add an event to the calendar.
 *
 * @param string $event Description of the event.
 * @param string $datetime Datetime of the event.
 * @return SkillResponse
 */
public static function addCalendarEvent(string $event, string $datetime): SkillResponse
{
    /**
     * Write your custom implementation for adding an event to the calendar.
     * 
     * For example, create a new entry in the 'events' section
     * with the provided details.
     */
       
    // If validation fails
    if (!$valid) {
        // Return error message
        return new SkillResponse([
            'success' => false,
            'message' => "Unable to add {$event} at {$datetime}."
        ]);
    }

    // Return success message
    return new SkillResponse([
        'success' => true,
        'message' => "Successfully added {$event} at {$datetime}.",
//        'response' => '(any data you want to send back to the API for further processing)'
    ]);
}

How to Add Skills

The snippet above is just an example (obviously). See the AddSkillsEvent for more detailed instructions.