Connect Wearables (MCP)
List, link, disconnect, and pull from connected health devices.
Step 1 — see what's connected
listConnectedDevices() — only returns active connections. Disconnected providers are excluded.
Step 2 — see what can be added
listAvailableIntegrations() — returns providers the user can still connect.
Available providers: APPLE_HEALTH_KIT, GARMIN, OURA, PELOTON, WAHOO, EIGHT_SLEEP, WITHINGS.
Step 3 — connect
Apple Health only path:
generateAppleHealthCode()— returns a one-time code for the Junction app and a deep linkbetti://settings/wearables?autoConnect=APPLE_HEALTH_KITthat opens the Betterness iOS app and starts the connection automatically- Present both options to the user and let them pick
All other providers (Garmin, Oura, Withings, etc.):
generateLinkToken(integrationKey, redirectUrl)— returnslinkWebUrl- Show the URL — the user opens it to authorize on the provider's side
- The agent must pass a real
redirectUrlin the host application — typically the session origin or a configured page
Step 4 — disconnect
disconnectIntegration(integrationKey) — removes the connection.
Common pitfalls
- Don't pass
APPLE_HEALTH_KITtogenerateLinkToken— it errors out. UsegenerateAppleHealthCodeinstead. - Already connected?
generateLinkTokenerrors if the user is already linked to that provider — check withlistConnectedDevicesfirst. - Empty data after connection — wearables backfill in waves; expect data within minutes to a few hours.
Querying data
See the data tools for each category:
- Health Data tools — activity, sleep, vitals, body composition

