# Droplet.ai phone reference

Exactly what the phone shares, what it doesn't, every phone action with its result, and the permission errors.

---

## Reading the phone

MCP `droplet_get_phone_context`; HTTP `get_context` (or `get_phone_context`):

```bash
curl -s -X POST "https://ujtuxanqlzmhnrzijfoo.supabase.co/functions/v1/agent-api" \
  -H "Authorization: Bearer $DROPLET_TOKEN" -H "Content-Type: application/json" -H "x-region: us-east-1" \
  -d '{"action":"get_context"}'
```

Sharing off: `{"shared": false, "hint": "..."}`. Sharing on: the fields sit at the top level, next to `"shared": true`, `"updated_at"` and `"age_seconds"`:

```
{
  "shared": true,
  "timezone": "Asia/Riyadh",
  "local_time": "2026-10-28T14:35:22+03:00",
  "can": ["alarms", "reminders", "calendar", "notifications"],
  "place": "work",
  "places": ["home", "work", "gym"],
  "battery": 64, "charging": false, "low_power": false, "network": "wifi", "appearance": "dark",
  "city": "Riyadh, Saudi Arabia",
  "calendar": [ { "title": "Design review", "start": "2026-10-28T15:00:00+03:00", "end": "2026-10-28T16:00:00+03:00", "calendar": "Work" } ],
  "reminders": [ { "title": "Call Khalid", "list": "Personal", "due": "2026-10-28T17:00:00+03:00" } ],
  "health": { "steps_today": 7420, "active_kcal_today": 410, "exercise_min_today": 22, "sleep_hours_last_night": 6.8, "resting_heart_rate": 58 },
  "motion": { "activity": "walking", "confidence": "high", "since": "2026-10-28T14:20:01+03:00" },
  "alarms": [ { "alarm_id": "6F1C...", "label": "Gym", "time": "06:30", "repeat": ["mon", "wed", "fri"] } ],
  "updated_at": "2026-10-28T11:35:22.512Z",
  "age_seconds": 40
}
```

Every field except `timezone`, `local_time` and `can` appears only when the user turned its switch on (Droplet.ai, Settings, Phone access), and only if they didn't turn it off for you on your page under Agents. Fields turned off for you are listed in `not_shared_with_you` (by switch name: `place`, `city`, `location`, `battery`, `calendar`, `reminders`, `health`, `motion`). A missing field means "not shared" or "no data", never zero.

### Fields

| Field | Switch | What it is |
|---|---|---|
| `timezone` | always | IANA zone, like `"Asia/Riyadh"` |
| `local_time` | always | ISO time with the phone's offset. Take your offsets from here |
| `can` | always | Phone actions you may take: `alarms`, `reminders`, `calendar`, `notifications` |
| `alarms` | needs `alarms` in `can` | Alarms and timers Droplet.ai set and that are still active: `alarm_id`, `label`, and `at` (one-off, ISO) or `time` (+ `repeat`) |
| `place` | Place | A saved place's name, `"away"` (not at any saved place) or `"unknown"`. Lowercase. Home and work win when places overlap |
| `places` | Place | The saved place names (lowercase). Use them in `variants` `when.place` |
| `city` | City | `"Riyadh, Saudi Arabia"` |
| `location` | Location | `{"lat", "lon"}` (4 decimals), `"accuracy_m"`, `"at"`. Show it as a `map` block (with the place's name from `place` or `city` as its `label`), never as coordinates in text |
| `battery`, `charging`, `low_power`, `network`, `appearance` | Battery | 0 to 100; booleans; `wifi`, `cellular`, `wired`, `other`, `offline`; `light` or `dark` |
| `calendar` | Calendar | Events from 30 minutes ago through the end of tomorrow, up to 20: `title`, `start`, `end`, `calendar`, plus `all_day` and `location` when set. No notes, links or attendees |
| `reminders` | Reminders | Unfinished reminders due by the end of today, overdue ones included, up to 15: `title`, `list`, `due` (when set) |
| `health` | Health | `steps_today`, `active_kcal_today`, `exercise_min_today`, `sleep_hours_last_night`, `resting_heart_rate` (the latest reading). Each only when Health has data |
| `motion` | Motion | The latest activity in the last 15 minutes: `activity` (`still`, `walking`, `running`, `cycling`, `driving`, `unknown`), `confidence` (`low`, `medium`, `high`), `since` |

### How fresh it is

The phone reports when Droplet.ai opens or comes to the front, when it moves between saved places, on significant moves (if the user allowed location Always), after a phone action, and when you ask with `fresh: true`. `age_seconds` says how old the report is.

`{"fresh": true}` wakes the phone with a silent push and waits up to 20 s for a new report. If the phone doesn't answer (asleep, offline, Low Power), you get the last report and a `note` saying so.

### What the phone does not share

Screen time and app usage, weight, food and calories eaten, live heart rate, workouts, messages, email, contacts, photos, what's playing, the Wi-Fi name, notifications from other apps, alarms set outside Droplet.ai, calendar event notes and links, other people's devices.

When you need one of these: say you can't see it, then ask the user (`droplet_ask` with kind `input`, or buttons to log it on the widget), or read it from a service they connect you to. Never guess a number.

---

## Phone actions

`droplet_phone_action` (HTTP `phone_action`) makes the phone do something. First check `can`.

```json
{ "kind": "reminder", "params": { "title": "Call Khalid back", "due": "2026-10-29T16:00:00+03:00", "notes": "Q4 budget" }, "wait_seconds": 25 }
```

- MCP needs the fields inside `params`. Over HTTP you may also send them at the top level: `{"action":"phone_action","kind":"timer","seconds":1500,"label":"Focus"}`.
- `wait_seconds` (0 to 50, default 25) is how long Droplet.ai waits for the phone before answering.
- **Times:** `at`, `due`, `start` and `end` are ISO date-times. Always include the offset (`+03:00`); a time without one is read as UTC. An alarm's `time` (`"07:30"`) is the phone's local time.

### The result

```
{ "action_id": "...", "kind": "alarm", "status": "done", "summary": "Gym: alarm 06:30 every mon, wed, fri",
  "result": { "alarm_id": "6F1C...", "label": "Gym" }, "created_at": "...", "done_at": "..." }
```

| `status` | Meaning |
|---|---|
| `done` | The phone did it. `result` says what it made |
| `failed` | `error` says why (switch off on the phone, iOS permission missing, not an alarm Droplet.ai set...) |
| `pending` | The phone didn't answer within `wait_seconds` (asleep or offline). It runs the moment Droplet.ai wakes up or opens. After 20 s Droplet.ai shows the user one "Tap to finish in Droplet.ai" notification. A `hint` says to check later |

Check later with `droplet_phone_action_status` and `action_id` (plus `wait_seconds` to wait), or call it with no `action_id` for your 20 most recent actions.

### Kinds

| kind | params | `result` when done |
|---|---|---|
| `alarm` | `time` (`"07:30"`, next occurrence) or `at` (ISO, must be in the future); `label` (40, default "Alarm"); `repeat` (`["mon","wed"]`, only with `time`) | `alarm_id`, `label`, `rings_at` (not for repeating alarms) |
| `timer` | `seconds` (5 to 86400); `label` (40) | `alarm_id`, `label`, `rings_at` |
| `cancel_alarm` | `alarm_id` or `all: true` | `cancelled`: how many. Works for alarms and timers Droplet.ai set, not the user's own |
| `cancel_event` | `event_id` (from the event action's result) | `removed`. Only events an agent added through Droplet.ai, never the user's own. Needs Droplet.ai build 32 or later; older builds answer that they can't do it. |
| `cancel_reminder` | `reminder_id` (from the reminder action's result) | `removed`. Only reminders an agent added through Droplet.ai. Needs Droplet.ai build 32 or later; older builds answer that they can't do it. |
| `reminder` | `title` (120); `due` (ISO), `notes` (500), `list` (60) | `reminder_id`, `list` |
| `event` | `title` (120), `start` (ISO); `end` (ISO, default +1 hour, or +1 day with `all_day`), `all_day`, `location` (120), `notes` (500), `alert_minutes` (0 to 10080) | `event_id`, `calendar` |
| `notify` | `title` (60); `body` (200); `at` (ISO, for later) | now: `delivered_to` (devices reached); later: `shows_at` |

Alarms and timers are real system alarms (they ring in Silent mode). The `alarm_id` of a timer cancels it too.

A `notify` for now goes straight from Droplet.ai as a push and doesn't need the phone to wake. One with `at` is scheduled on the phone.

### The notification limit

At most **4 `notify` actions per agent per hour**, counted when you create them, including ones scheduled for later; failed ones don't count. The 5th gets 429. Notifications are for what the user asked for or what can't wait. Updates belong on a widget.

### Things phone actions can't do

- Repeat a reminder or a notification, or trigger on a place. Use a repeating alarm, or a reminder per occurrence, or a version that shows it at that place.
- Edit anything. Cancel the alarm or timer and set a new one.
- Delete reminders or events, or cancel a scheduled notification.

---

## Permission errors

| You see | Meaning | Do |
|---|---|---|
| `{"shared": false}` | Phone sharing is off | Ask the user to turn on what you need in Droplet.ai, Settings, Phone access, if it's needed |
| `not_shared_with_you: [...]` | The user turned these off for you | Work without them. Only they can change it, on your page under Agents |
| 403 "The user hasn't let agents ... on this phone" | That switch is off in Phone access | Tell the user which switch (alarms and timers, reminders, calendar, notifications) |
| 403 "The user turned this off for you" | Allowed for other agents, not you | Tell the user; don't retry |
| `failed` with an error | iOS permission missing, or the phone refused | Pass the error on in plain words |
| 429 | Notification limit | Put it on a widget instead |

---

## Good habits

- Read the context before acting: `can`, the time zone, and the calendar (to avoid double-booking).
- Tell the user exactly what you set: "Reminder 'Call Khalid back' for tomorrow at 4 pm."
- Prefer a real alarm over a notification for anything they must not miss; prefer a widget for anything they should see at a glance.
- Don't call `fresh: true` in a tight loop; it wakes the phone. For regular checks, a few times an hour is plenty.
- Use `place` in `variants` to change what shows at a place without polling.
