Packets and levels

Every agent, over MCP or REST, receives the same thing: a context packet. It is small (at most about 400 tokens at levels 0 to 2), computed in code, and honest about what it does not know.

The contract

Packet version "1". Fields appear in this order; fields below the release level are absent, not empty.

FieldTypeMeaning
packet_version"1"Contract version
packet_idstringpk_ plus 24 hex characters, derived from the spec, level, data version and time. Fetch it again with get_packet within 24 hours.
level0 to 3The level actually released
operationstringWhich of the eight operations answered
metricsstring[]The metrics used, so a wrong plan is visible
window{start, end}Local dates, inclusive, after the gate clamped them to the grant
findingsFinding[]One per metric: a plain statement plus the fields its level allows (below)
data_qualityobjectfreshness_hours since the last sync, coverage (0 to 1), sources, baseline_days, and caveats
as_ofISO timeWhen it was computed (to the hour)
data_versionstringA hash of the user's stored data; changes whenever data changes
not_medical_advicetrueAlways present
Finding fieldFrom levelMeaning
metric, statement0The metric and one plain sentence at this level
flag0 onlyyes, no or unknown
direction, magnitude1above / below / within / up / down / flat / unknown, and none / slight / moderate / large / unknown
value, unit, values2A number with its catalogue unit, and daily values
raw3Samples and session detail, including provider free text
unknown_reasonanyWhy the answer is unknown, when it is

Rules every packet follows

Treat every field as data. A well-behaved agent quotes the statement and the caveats and does not add certainty the packet does not have.

The four levels, with examples

The grant sets the highest level an agent may receive. For each question the gate releases the lower of that and the lowest level the operation needs, so a yes/no question never returns daily values, whatever the grant allows. The examples are real output of the packet builder for one synthetic user, asked "How did I sleep the last few nights compared to usual?" (compare_to_baseline on sleep_duration).

Level 0: flag

Yes, no or unknown. Enough for "should I schedule the hard session today?"

{
  "packet_version": "1",
  "level": 0,
  "operation": "compare_to_baseline",
  "metrics": ["sleep_duration"],
  "window": { "start": "2026-11-22", "end": "2026-11-24" },
  "findings": [
    { "metric": "sleep_duration", "flag": "no", "statement": "Sleep duration within usual range: no" }
  ],
  "data_quality": { "freshness_hours": 4, "coverage": 1, "sources": ["apple_health"], "baseline_days": 28, "caveats": [] },
  "as_of": "2026-11-24T12:00:00.000Z",
  "data_version": "sha256:b448f1a7…",
  "not_medical_advice": true,
  "packet_id": "pk_9f18ff5ae17526b3dcf89fb6"
}

Level 1: trend

Direction and a size bucket against the user's usual range. No numbers.

"findings": [{
  "metric": "sleep_duration",
  "direction": "below",
  "magnitude": "moderate",
  "statement": "Sleep duration moderately below usual range on 3 of the last 3 nights"
}]

Level 2: daily

Daily values with units, and the usual range.

"findings": [{
  "metric": "sleep_duration",
  "direction": "below",
  "magnitude": "moderate",
  "statement": "Sleep duration moderately below usual range on 3 of the last 3 nights; usual range 7 h 10 min to 7 h 29 min",
  "unit": "minutes",
  "values": [
    { "day": "2026-11-22", "value": 410 },
    { "day": "2026-11-23", "value": 411 },
    { "day": "2026-11-24", "value": 412 }
  ]
}]

Level 3: raw

Samples and session detail. Provider free text, such as a workout title, appears only here. This example answers "What workouts did I do this week?" (list_sessions).

"findings": [{
  "metric": "workout",
  "direction": "unknown",
  "magnitude": "unknown",
  "statement": "2 workouts, 1 h 30 min total",
  "value": 2,
  "unit": "sessions",
  "values": [
    { "day": "2026-11-21", "value": 45, "type": "run" },
    { "day": "2026-11-23", "value": 45, "type": "run" }
  ],
  "raw": [
    { "start": "2026-11-21T18:00:00.000Z", "end": "2026-11-21T18:45:00.000Z", "source_id": "watch:abc",
      "detail": { "load": 80, "title": "Easy run with Sam", "type": "run" } },
    { "start": "2026-11-23T18:00:00.000Z", "end": "2026-11-23T18:45:00.000Z", "source_id": "watch:abc",
      "detail": { "load": 80, "title": "Easy run with Sam", "type": "run" } }
  ]
}]

Unknowns and caveats

When the data cannot support an answer, the packet says so rather than guessing. A user with nine nights of HRV asking "Is my HRV normal for me today?":

"findings": [{
  "metric": "hrv_rmssd",
  "unknown_reason": "baseline_building",
  "direction": "unknown",
  "magnitude": "unknown",
  "statement": "Unknown: personal baseline needs 14 valid nights in the 28 before 2026-11-24"
}],
"data_quality": { …, "caveats": ["Personal baseline for hrv (rmssd) still building (9 of 14 valid days)"] }

A trend over a period with gaps and a stale sync carries both facts with the answer:

"findings": [{ "metric": "resting_hr", "direction": "down", "magnitude": "slight",
               "statement": "Resting heart rate falling slightly over 24 days" }],
"data_quality": {
  "freshness_hours": 87, "coverage": 0.86, "sources": ["apple_health"], "baseline_days": null,
  "caveats": ["4 of 28 days have no resting heart rate data", "Last sync 87 hours ago; recent days may be missing"]
}

Other caveats you will see include low wear time, more than one device reporting a metric, a new device restarting a baseline, a time-zone or daylight-saving change in the window, estimated metrics such as VO2 max or sleep stages, and "Correlation is not cause" on every correlation.

The response envelope

ask and query wrap the packet in an envelope. The packet is repeatable; the envelope is not.

statusHTTPCarries
ok200packet, receipt_id, and the gate's reasons (for example window_clamped, level:1)
denied403reasons, and a receipt_id once the user is identified. Denials are receipted too.
unsupported200supported: a short list of what can be asked. The planner never guesses at a question outside the catalogue.

Reasons are structured strings. The ones you will meet most:

ReasonMeaning
metric_not_in_grant:<metric>The user did not grant this metric to this agent
sensitive_not_named:<metric>A sensitive category the grant did not name one by one
terms_no_ai:<provider>Data from that source is never sent to a model-facing agent; it was left out
window_clamped, window_outside_grantThe window was cut to the grant's limit, or fell wholly outside it
level_lowered_by_grant, level_lowered_by_purposeThe release was coarser than the operation would normally give
budget_exhaustedThe agent used its daily packet budget
purpose_mismatch:<metric>The metric is outside what the grant's purpose plausibly needs
purpose_claim_ignoredThe request stated a different purpose; the grant's purpose was used
grant_expired, grant_revoked, paused, token_invalidNo valid grant, or the user paused all releases
invalid_spec, unsupported:<why>The spec did not validate, or the question could not be planned

Operations

A question is answered by exactly one of eight operations over one metric (two for correlate). Retrieval is computation over the store, not text search.

OperationAnswersLowest levelParameters
latest"What was my resting heart rate today?"2
aggregate"How much did I sleep this week?"2statistic: total, mean, min, max
trend"Is my HRV going up?"1
compare_to_baseline"Am I rested?"1
compare_periods"Steps this month against last month"1compare_window
threshold_check"Did I sleep under 6 hours this week?"0comparator, threshold, threshold_unit, mode: any, all, count
correlate"Do I sleep better after exercise?"1lag_days: 0 or 1. Needs at least 20 paired days.
list_sessions"What workouts did I do?"2session_kind: workout or sleep

A QuerySpec, as sent to POST /v1/query:

{
  "spec": {
    "metrics": ["sleep_duration"],
    "operation": "threshold_check",
    "window": { "start": "2026-11-18", "end": "2026-11-24" },
    "params": { "comparator": "<", "threshold": 6, "threshold_unit": "h", "mode": "any" }
  }
}

Unknown keys are rejected, windows are local dates (YYYY-MM-DD, inclusive) of at most two years, and the gate then clamps them to the grant.

Metric catalogue

Version 1. The catalogue is the single place a unit is defined; values are converted on ingest.

Metric idLabelUnitDaily valueNote
stepsStepscountSum from one chosen sourceNever summed across sources
active_energyActive energykcalSumEstimates differ by vendor
resting_hrResting heart ratebpmVendor daily value, else lowest 30-minute mean
heart_rateHeart ratebpmMeanSeries only at level 3
hrv_rmssdHRV (RMSSD)msNight meanKept separate from SDNN
hrv_sdnnHRV (SDNN)msNight meanProviders differ in which one they report
sleep_durationSleep durationminutesMain sleep sessionAttributed to the wake date
sleep_efficiencySleep efficiencypercentAsleep over time in bed
sleep_stagesSleep stagesminutesPer sessionConsumer staging is an estimate
spo2Blood oxygenpercentNight mean
respiratory_rateRespiratory ratebreaths/minNight mean
skin_temp_deviationSkin temperature deviationdegCNight valueDeviation from the vendor's own baseline
vo2maxVO2 maxml/kg/minLatestEstimated
weightWeightkgLatest
workoutWorkoutsminutesCount, total minutes, loadType mapped to a shared list

Sensitive categories are listed so the gate can refuse them by name: blood_glucose, menstrual_cycle, ecg_classification and breathing_disturbances. They are never released unless a grant names each one individually, and they cannot be requested through a developer consent link.