# Morning Departure Prep

> A one-paste skill for your AI: your Tesla preconditions the cabin and finishes charging in time for your real departure, every morning.

<!-- Skill file. Tool names/params must match src/mcp/agent.ts exactly.
     If a tool is renamed or its parameters change, update this file. -->

**If you're an AI assistant reading this:** the user wants their Tesla ready
to drive at a set time each morning. Follow the steps below using the
mytesla.io MCP tools (`https://mcp.mytesla.io/mcp`).

## What this does

Tells the car when the user leaves in the morning so it preconditions the
cabin (and optionally finishes charging on off-peak rates) in time for
departure. One tool call configures the whole routine.

## Does this repeat on its own?

Yes. This writes Tesla's own Scheduled Departure setting, which lives on the
vehicle itself and repeats without any further AI involvement. Once set, you
do not need to run this skill again unless the user wants to change the time.

Verified on a real car (Model 3, software 2026.20.6.11): the setting applies,
it persists, and running the skill again replaces the existing schedule
rather than adding a second one.

One thing worth telling the user, because it surprises people: **a departure
schedule replaces a separate "start charging at X" schedule.** Tesla treats
those as two modes of one feature rather than independent settings, so if the
user already had a scheduled charge start, setting a departure switches it
off. Mention it before running this if they have one.

## Ask the user once, not every run

- What time do they usually leave in the morning?
- Should the cabin precondition before departure? (Default: yes.)
- Do they want charging restricted to off-peak hours? If yes, when does
  their off-peak window end? (Skip this if they don't know their rate plan.)

## Steps to run

1. Call `get_vehicles` to get the vehicle's VIN and confirm its state. If
   the car is `asleep`, call `wake_vehicle` first and follow its polling
   pattern until the car is online. If it is `offline`, tell the user the
   car is unreachable right now and stop.
2. Convert the departure time to minutes after local midnight. Example:
   7:30am is 450.
3. Call `set_scheduled_departure` with:
   - `vehicle_id`: the VIN from step 1
   - `enable`: true
   - `departure_minutes`: the converted time
   - `preconditioning`: true (unless the user said no)
   - `off_peak_charging`: true only if the user gave an off-peak window
   - `end_off_peak_minutes`: the end of their off-peak window, converted
     the same way (required when `off_peak_charging` is true)
4. Report back what was set, and ask the user to confirm the schedule shows
   up in their Tesla app the first time.

## Tools used

`get_vehicles`, `wake_vehicle` (only if asleep), `set_scheduled_departure`

## Don't have mytesla.io yet?

This skill needs a mytesla.io account with a connected Tesla. Setup takes
about three minutes: [get started](https://mcp.mytesla.io/signup?src=skill-departure).
