{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Paggered Agent Access","version":"agent-access.v1","description":"Bounded reads and explicitly consented batch proposals. Only the athlete can approve or undo in Paggered."},"servers":[{"url":"https://paggered.app"}],"paths":{"/v1/agent-access/context":{"get":{"operationId":"get_access_context","summary":"Get access context","description":"Read the active grant, granted scopes, record timezone, units, and hard read constraints.","parameters":[],"security":[{"agentAccessOAuth":[]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"get_access_context"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"null","const":null},"data":{"type":"object","properties":{"grant_id":{"type":"string","format":"uuid"},"scopes":{"type":"array","items":{"type":"string","enum":["training","recovery","nutrition","body_measurements"]},"minItems":1},"record":{"type":"object","properties":{"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false}},"required":["timezone","units"],"additionalProperties":false},"constraints":{"type":"object","properties":{"read_only":{"type":"boolean","const":true},"background_sync":{"type":"boolean","const":false},"maximum_page_size":{"type":"number","const":10},"maximum_range_days":{"type":"number","const":90}},"required":["read_only","background_sync","maximum_page_size","maximum_range_days"],"additionalProperties":false}},"required":["grant_id","scopes","record","constraints"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_access_context","x-agent-access-input-schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}},"/v1/agent-access/training/snapshot":{"get":{"operationId":"get_training_snapshot","summary":"Get training snapshot","description":"Read a bounded training overview with workout frequency, structured goals, and recent feedback.","parameters":[],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"get_training_snapshot"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"summary":{"type":"object","properties":{"workouts_this_week":{"type":"object","properties":{"value":{"type":"integer","minimum":0},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","minLength":1,"maxLength":64},"computed_at":{"type":"string","format":"date-time"},"window":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},"required":["from","to"],"additionalProperties":false},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","window","sample_count"],"additionalProperties":false}},"required":["value","metadata"],"additionalProperties":false},"workouts_last_30_days":{"type":"object","properties":{"value":{"type":"integer","minimum":0},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","minLength":1,"maxLength":64},"computed_at":{"type":"string","format":"date-time"},"window":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},"required":["from","to"],"additionalProperties":false},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","window","sample_count"],"additionalProperties":false}},"required":["value","metadata"],"additionalProperties":false},"consecutive_active_weeks":{"type":"object","properties":{"value":{"type":"integer","minimum":0},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","minLength":1,"maxLength":64},"computed_at":{"type":"string","format":"date-time"},"window":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},"required":["from","to"],"additionalProperties":false},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","window","sample_count"],"additionalProperties":false}},"required":["value","metadata"],"additionalProperties":false},"streak_is_current":{"type":"object","properties":{"value":{"type":"boolean"},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","minLength":1,"maxLength":64},"computed_at":{"type":"string","format":"date-time"},"window":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},"required":["from","to"],"additionalProperties":false},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","window","sample_count"],"additionalProperties":false}},"required":["value","metadata"],"additionalProperties":false}},"required":["workouts_this_week","workouts_last_30_days","consecutive_active_weeks","streak_is_current"],"additionalProperties":false},"exercise_frequency":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"name":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"completed_sessions":{"type":"integer","minimum":0},"achieved_sets":{"type":"integer","minimum":0},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","minLength":1,"maxLength":64},"computed_at":{"type":"string","format":"date-time"},"window":{"type":"object","properties":{"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]}},"required":["from","to"],"additionalProperties":false},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","window","sample_count"],"additionalProperties":false}},"required":["exercise_id","name","completed_sessions","achieved_sets","metadata"],"additionalProperties":false}},"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"goal_type":{"type":"string","enum":["target_1rm","target_bodyweight","weekly_session_count","weekly_volume","daily_calories","daily_protein"]},"status":{"type":"string","enum":["active","achieved","archived"]},"exercise_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"target_value":{"type":"number","exclusiveMinimum":0},"target_unit":{"type":"string","enum":["kg","lbs","sessions","kcal","g"]},"canonical_target_value":{"type":"number","exclusiveMinimum":0},"canonical_target_unit":{"type":"string","enum":["kg","sessions","kcal","g"]},"achieved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"prescribed"}},"required":["id","goal_type","status","exercise_id","target_value","target_unit","canonical_target_value","canonical_target_unit","achieved_at","created_at","updated_at","provenance"],"additionalProperties":false}},"recent_feedback":{"type":"array","items":{"type":"object","properties":{"workout_id":{"type":"string","format":"uuid"},"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]},"recorded_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"self_reported"}},"required":["workout_id","difficulty","next_time_intent","recorded_at","provenance"],"additionalProperties":false}}},"required":["summary","exercise_frequency","goals","recent_feedback"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_training_snapshot","x-agent-access-input-schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}},"/v1/agent-access/training/workouts":{"get":{"operationId":"list_completed_workouts","summary":"List completed workouts","description":"List the athlete's completed workouts in a bounded local-date window with cursor pagination.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"list_completed_workouts"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ended_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"revision":{"type":"integer","exclusiveMinimum":0},"duration":{"type":"object","properties":{"seconds":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"basis":{"type":"string","enum":["recorded_start","unknown"]},"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","const":"duration.v1"},"computed_at":{"type":"string","format":"date-time"},"baseline":{"type":"string","const":"recorded_start_to_end"},"sample_count":{"anyOf":[{"type":"number","const":0},{"type":"number","const":2}]}},"required":["seconds","basis","provenance","calculation_version","computed_at","baseline","sample_count"],"additionalProperties":false},"provenance":{"type":"string","const":"recorded"}},"required":["id","title","started_at","ended_at","created_at","updated_at","revision","duration","provenance"],"additionalProperties":false},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["window","items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"list_completed_workouts","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null}},"required":[],"additionalProperties":false,"dependentRequired":{"from":["to"],"to":["from"]},"x-paggered-max-range-days":90}}},"/v1/agent-access/training/workouts/{workout_id}":{"get":{"operationId":"get_completed_workout","summary":"Get completed workout","description":"Read one completed workout, including exercises, achieved sets, and recorded feedback.","parameters":[{"name":"workout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"get_completed_workout"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"workout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ended_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"revision":{"type":"integer","exclusiveMinimum":0},"duration":{"type":"object","properties":{"seconds":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"basis":{"type":"string","enum":["recorded_start","unknown"]},"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","const":"duration.v1"},"computed_at":{"type":"string","format":"date-time"},"baseline":{"type":"string","const":"recorded_start_to_end"},"sample_count":{"anyOf":[{"type":"number","const":0},{"type":"number","const":2}]}},"required":["seconds","basis","provenance","calculation_version","computed_at","baseline","sample_count"],"additionalProperties":false},"provenance":{"type":"string","const":"recorded"},"achieved_set_count":{"type":"integer","minimum":0,"maximum":200},"feedback":{"anyOf":[{"type":"object","properties":{"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]},"recorded_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"self_reported"}},"required":["difficulty","next_time_intent","recorded_at","provenance"],"additionalProperties":false},{"type":"null"}]},"exercises":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"name":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"tracking_type":{"type":"string","enum":["weight_reps","bodyweight","duration","distance","weight_distance"]},"exercise_order":{"type":"integer","minimum":0},"superset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"sets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"set_number":{"type":"integer","exclusiveMinimum":0},"set_type":{"type":"string","enum":["normal","warmup","failure","drop_set"]},"parent_position":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"structure_version":{"type":"integer","exclusiveMinimum":0},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer"},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number"},{"type":"null"}]},"target_rpe":{"anyOf":[{"type":"number"},{"type":"null"}]},"rpe_provenance":{"type":"string","const":"self_reported"},"target_rpe_provenance":{"type":"string","const":"prescribed"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number"},{"type":"null"}]},"historical_record_at_completion":{"type":"object","properties":{"indicators":{"type":"array","items":{"type":"string","enum":["weight","reps","set_volume","estimated_1rm"]}},"metadata":{"type":"object","properties":{"provenance":{"type":"string","const":"derived"},"calculation_version":{"type":"string","const":"historical-record-at-completion.v1"},"computed_at":{"type":"string","format":"date-time"},"baseline":{"type":"string","const":"eligible_prior_sets_before_workout_completion"},"sample_count":{"type":"integer","minimum":0}},"required":["provenance","calculation_version","computed_at","baseline","sample_count"],"additionalProperties":false}},"required":["indicators","metadata"],"additionalProperties":false},"provenance":{"type":"string","const":"recorded"}},"required":["position","set_number","set_type","parent_position","structure_version","weight_kg","reps","rpe","target_rpe","rpe_provenance","target_rpe_provenance","duration_seconds","distance_metres","incline_percent","historical_record_at_completion","provenance"],"additionalProperties":false},"maxItems":200}},"required":["exercise_id","name","muscle_group","tracking_type","exercise_order","superset_id","sets"],"additionalProperties":false}}},"required":["id","title","started_at","ended_at","created_at","updated_at","revision","duration","provenance","achieved_set_count","feedback","exercises"],"additionalProperties":false}},"required":["workout"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_completed_workout","x-agent-access-input-schema":{"type":"object","properties":{"workout_id":{"type":"string","format":"uuid"}},"required":["workout_id"],"additionalProperties":false}}},"/v1/agent-access/training/exercises/{exercise_id}/history":{"get":{"operationId":"get_exercise_history","summary":"Get exercise history","description":"Read bounded completed-workout history for one exercise with cursor pagination.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"exercise_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"get_exercise_history"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},"exercise":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false}},"required":["id","name"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"workout_id":{"type":"string","format":"uuid"},"ended_at":{"type":"string","format":"date-time"},"sets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"set_number":{"type":"integer","exclusiveMinimum":0},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer"},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number"},{"type":"null"}]},"rpe_provenance":{"type":"string","const":"self_reported"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number"},{"type":"null"}]},"provenance":{"type":"string","const":"recorded"}},"required":["position","set_number","weight_kg","reps","rpe","rpe_provenance","duration_seconds","distance_metres","incline_percent","provenance"],"additionalProperties":false}}},"required":["workout_id","ended_at","sets"],"additionalProperties":false},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["window","exercise","items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_exercise_history","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"exercise_id":{"type":"string","format":"uuid"},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null}},"required":["exercise_id"],"additionalProperties":false,"dependentRequired":{"from":["to"],"to":["from"]},"x-paggered-max-range-days":90}}},"/v1/agent-access/training/routines":{"get":{"operationId":"list_saved_routines","summary":"List saved routines","description":"List the athlete's saved workout routines with bounded cursor pagination.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"list_saved_routines"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"revision":{"type":"integer","exclusiveMinimum":0},"title":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"exercise_count":{"type":"integer","minimum":0},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"prescribed"}},"required":["id","revision","title","exercise_count","updated_at","provenance"],"additionalProperties":false},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"list_saved_routines","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null}},"required":[],"additionalProperties":false}}},"/v1/agent-access/training/routines/{routine_id}":{"get":{"operationId":"get_saved_routine","summary":"Get saved routine","description":"Read one saved workout routine and its prescribed exercise structure.","parameters":[{"name":"routine_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"security":[{"agentAccessOAuth":["training"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"get_saved_routine"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"training"},"data":{"type":"object","properties":{"routine":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"revision":{"type":"integer","exclusiveMinimum":0},"title":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"exercise_count":{"type":"integer","minimum":0},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"prescribed"},"exercises":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0},"exercise_id":{"type":"string","format":"uuid"},"name":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"tracking_type":{"anyOf":[{"type":"string","enum":["weight_reps","bodyweight","duration","distance","weight_distance"]},{"type":"null"}]},"sets":{"type":"integer","minimum":1,"maximum":20},"reps":{"type":"string","minLength":1,"maxLength":32},"target_rpe":{"anyOf":[{"type":"number"},{"type":"null"}]},"rest_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}]},"provenance":{"type":"string","const":"prescribed"}},"required":["position","exercise_id","name","muscle_group","tracking_type","sets","reps","target_rpe","rest_seconds","provenance"],"additionalProperties":false},"maxItems":50}},"required":["id","revision","title","exercise_count","updated_at","provenance","exercises"],"additionalProperties":false}},"required":["routine"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_saved_routine","x-agent-access-input-schema":{"type":"object","properties":{"routine_id":{"type":"string","format":"uuid"}},"required":["routine_id"],"additionalProperties":false}}},"/v1/agent-access/recovery/check-ins":{"get":{"operationId":"list_recovery_checkins","summary":"List recovery check-ins","description":"List the athlete's self-reported recovery check-ins in a bounded local-date window.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["recovery"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"list_recovery_checkins"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"recovery"},"data":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},"scale":{"type":"object","properties":{"minimum":{"type":"number","const":1},"maximum":{"type":"number","const":5},"higher_is_better":{"type":"boolean","const":true},"soreness_five_means":{"type":"string","const":"no_soreness"}},"required":["minimum","maximum","higher_is_better","soreness_five_means"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"sleep_quality":{"anyOf":[{"type":"integer"},{"type":"null"}]},"energy":{"anyOf":[{"type":"integer"},{"type":"null"}]},"soreness":{"anyOf":[{"type":"integer"},{"type":"null"}]},"stress":{"anyOf":[{"type":"integer"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"self_reported"}},"required":["date","sleep_quality","energy","soreness","stress","updated_at","provenance"],"additionalProperties":false},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["window","scale","items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"list_recovery_checkins","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null}},"required":[],"additionalProperties":false,"dependentRequired":{"from":["to"],"to":["from"]},"x-paggered-max-range-days":90}}},"/v1/agent-access/nutrition/records":{"get":{"operationId":"list_nutrition_records","summary":"List nutrition records","description":"List either daily nutrition totals or meal entries in a bounded local-date window.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"collection","in":"query","required":true,"schema":{"type":"string","enum":["daily_totals","meal_entries"]},"style":"form","explode":true},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["nutrition"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"list_nutrition_records"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"nutrition"},"data":{"type":"object","properties":{"collection":{"type":"string","enum":["daily_totals","meal_entries"]},"window":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"goal_type":{"type":"string","enum":["target_1rm","target_bodyweight","weekly_session_count","weekly_volume","daily_calories","daily_protein"]},"status":{"type":"string","enum":["active","achieved","archived"]},"exercise_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"target_value":{"type":"number","exclusiveMinimum":0},"target_unit":{"type":"string","enum":["kg","lbs","sessions","kcal","g"]},"canonical_target_value":{"type":"number","exclusiveMinimum":0},"canonical_target_unit":{"type":"string","enum":["kg","sessions","kcal","g"]},"achieved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"prescribed"}},"required":["id","goal_type","status","exercise_id","target_value","target_unit","canonical_target_value","canonical_target_unit","achieved_at","created_at","updated_at","provenance"],"additionalProperties":false}},"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"daily_total"},"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"source":{"type":"string","const":"user_entered"},"provenance":{"type":"string","const":"self_reported"}},"required":["kind","id","date","calories_kcal","protein_g","carbs_g","fat_g","created_at","updated_at","source","provenance"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"meal_entry"},"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"meal_name":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200},"handling":{"type":"string","const":"untrusted_record_text"}},"required":["value","handling"],"additionalProperties":false},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"self_reported"}},"required":["kind","id","date","meal_name","calories_kcal","protein_g","carbs_g","fat_g","created_at","provenance"],"additionalProperties":false}]},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["collection","window","goals","items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"list_nutrition_records","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"collection":{"type":"string","enum":["daily_totals","meal_entries"]},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null}},"required":["collection"],"additionalProperties":false,"dependentRequired":{"from":["to"],"to":["from"]},"x-paggered-max-range-days":90}}},"/v1/agent-access/body-measurements":{"get":{"operationId":"list_body_measurements","summary":"List body measurements","description":"List the athlete's body measurements and structured goals in a bounded local-date window.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":10,"default":5},"style":"form","explode":true},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"style":"form","explode":true}],"security":[{"agentAccessOAuth":["body_measurements"]}],"responses":{"200":{"description":"Bounded read completed.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"schema_version":{"type":"string","const":"agent-access.v1"},"request_id":{"type":"string","format":"uuid"},"operation":{"type":"string","const":"list_body_measurements"},"as_of":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"units":{"type":"object","properties":{"canonical":{"type":"object","properties":{"mass":{"type":"string","const":"kg"},"length":{"type":"string","const":"metres"},"duration":{"type":"string","const":"seconds"}},"required":["mass","length","duration"],"additionalProperties":false},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]}},"required":["canonical","unit_preference","height_unit_preference","bodyweight_unit_preference"],"additionalProperties":false},"scope":{"type":"string","const":"body_measurements"},"data":{"type":"object","properties":{"window":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},"profile_snapshot":{"type":"object","properties":{"height_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}]},"recorded_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"unknown"}},"required":["height_metres","weight_kg","recorded_at","provenance"],"additionalProperties":false},"goals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"goal_type":{"type":"string","enum":["target_1rm","target_bodyweight","weekly_session_count","weekly_volume","daily_calories","daily_protein"]},"status":{"type":"string","enum":["active","achieved","archived"]},"exercise_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"target_value":{"type":"number","exclusiveMinimum":0},"target_unit":{"type":"string","enum":["kg","lbs","sessions","kcal","g"]},"canonical_target_value":{"type":"number","exclusiveMinimum":0},"canonical_target_unit":{"type":"string","enum":["kg","sessions","kcal","g"]},"achieved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"prescribed"}},"required":["id","goal_type","status","exercise_id","target_value","target_unit","canonical_target_value","canonical_target_unit","achieved_at","created_at","updated_at","provenance"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}]},"body_fat_percent":{"anyOf":[{"type":"number"},{"type":"null"}]},"chest_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"waist_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"hips_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"neck_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"left_arm_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"right_arm_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"left_thigh_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"right_thigh_metres":{"anyOf":[{"type":"number"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"provenance":{"type":"string","const":"unknown"}},"required":["id","date","weight_kg","body_fat_percent","chest_metres","waist_metres","hips_metres","neck_metres","left_arm_metres","right_arm_metres","left_thigh_metres","right_thigh_metres","created_at","provenance"],"additionalProperties":false},"maxItems":10},"next_cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}]}},"required":["window","profile_snapshot","goals","items","next_cursor"],"additionalProperties":false}},"required":["schema_version","request_id","operation","as_of","timezone","units","scope","data"]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"list_body_measurements","x-agent-access-input-schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":10,"default":5},"cursor":{"anyOf":[{"type":"string","minLength":1,"maxLength":4096},{"type":"null"}],"default":null},"from":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null},"to":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"default":null}},"required":[],"additionalProperties":false,"dependentRequired":{"from":["to"],"to":["from"]},"x-paggered-max-range-days":90}}},"/v1/agent-access/writes/records":{"get":{"operationId":"get_write_record","summary":"Read a record for a proposed change","description":"Read an explicitly permitted record revision and bounded editable fields. Workout and routine content remains in their existing read tools; use this revision for writes. Equipment uses ten-item UUID pagination. Missing dated records have no revision; never invent one.","parameters":[{"name":"kind","in":"query","required":true,"schema":{"anyOf":[{"type":"string","const":"routine"},{"type":"string","const":"workout"},{"type":"string","const":"meal"},{"type":"string","const":"goal"},{"type":"string","const":"daily_totals"},{"type":"string","const":"recovery"},{"type":"string","const":"measurement"},{"type":"string","const":"schedule"},{"type":"string","const":"preferences"},{"type":"string","const":"equipment"}]},"style":"form","explode":true},{"name":"id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"style":"form","explode":true},{"name":"goal_type","in":"query","required":false,"schema":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]},"style":"form","explode":true},{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"style":"form","explode":true},{"name":"after_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"style":"form","explode":true}],"security":[{"agentAccessOAuth":[]}],"responses":{"200":{"description":"Bounded write workflow result; approval remains athlete-only.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"values":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":4000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"type":"string","maxLength":100},"maxItems":100}]}}},"required":["id","revision","values"],"additionalProperties":false},"maxItems":10},"next_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"request_id":{"type":"string","format":"uuid"},"version":{"type":"string","const":"agent-access-write.v1"}},"required":["items","next_id","request_id","version"],"additionalProperties":false}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_write_record","x-agent-access-input-schema":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"routine"},"id":{"type":"string","format":"uuid"}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"workout"},"id":{"type":"string","format":"uuid"}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"meal"},"id":{"type":"string","format":"uuid"}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"goal"},"id":{"type":"string","format":"uuid"},"goal_type":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]}},"required":["kind","id","goal_type"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"daily_totals"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["kind","date"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"recovery"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["kind","date"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"measurement"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["kind","date"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"schedule"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["kind","date"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preferences"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"equipment"},"after_id":{"type":"string","format":"uuid"}},"required":["kind"],"additionalProperties":false}]}}},"/v1/agent-access/writes/context":{"get":{"operationId":"get_write_context","summary":"Get write permissions","description":"Read this connection's explicit write permissions and limits. Does not expand consent.","parameters":[],"security":[{"agentAccessOAuth":[]}],"responses":{"200":{"description":"Bounded write workflow result; approval remains athlete-only.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"version":{"type":"string","const":"agent-access-write.v1"},"enabled":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"string","enum":["training","nutrition","recovery","body_measurements","schedule:read","preferences:read","routines:write","schedule:write","workouts:write","nutrition:write","recovery:write","body_measurements:write","training_goals:write","nutrition_goals:write","body_goals:write","preferences:write","records:delete"]},"maxItems":17},"timezone":{"type":"string","maxLength":100},"permissions_url":{"type":"string"},"maximum_changes":{"type":"number","const":50},"proposal_expiry_minutes":{"type":"number","const":30},"schedule_horizon_days":{"type":"number","const":90},"undo_days":{"type":"number","const":30},"approval":{"type":"string","const":"athlete_in_paggered"},"automatic_retry":{"type":"boolean","const":false}},"required":["request_id","version","enabled","permissions","timezone","permissions_url","maximum_changes","proposal_expiry_minutes","schedule_horizon_days","undo_days","approval","automatic_retry"],"additionalProperties":false}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_write_context","x-agent-access-input-schema":{"type":"object","properties":{},"required":[],"additionalProperties":false}}},"/v1/agent-access/writes/proposals":{"post":{"operationId":"prepare_write_proposal","summary":"Prepare a batch for athlete approval","description":"Prepare an immutable batch; no fitness changes occur until the athlete approves in Paggered. Open the returned approval URL. Never approve for the athlete or retry an uncertain outcome with a new command ID.","parameters":[],"security":[{"agentAccessOAuth":[]}],"responses":{"200":{"description":"Bounded write workflow result; approval remains athlete-only.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"version":{"type":"string","const":"agent-access-write.v1"},"proposal_id":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["pending","committed","rejected","expired","conflicted"]},"expires_at":{"type":"string","format":"date-time"},"receipt":{"anyOf":[{"type":"object","properties":{"proposal_id":{"type":"string","format":"uuid"},"committed_at":{"type":"string","format":"date-time"},"change_count":{"type":"integer","minimum":1,"maximum":50},"results":{"type":"array","items":{"type":"object","properties":{"action_id":{"type":"string","minLength":1,"maxLength":64},"record_id":{"type":"string","format":"uuid"}},"required":["action_id","record_id"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["proposal_id","committed_at","change_count","results"],"additionalProperties":false},{"type":"null"}]},"approval_url":{"type":"string"},"undone_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["request_id","version","proposal_id","state","expires_at","receipt","approval_url"],"additionalProperties":false}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"prepare_write_proposal","x-agent-access-input-schema":{"type":"object","properties":{"version":{"type":"string","const":"agent-access-write.v1"},"command_id":{"type":"string","format":"uuid"},"actions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"routine.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"exercises":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"exercise_name":{"type":"string","minLength":1,"maxLength":200},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sets":{"type":"integer","minimum":1,"maximum":20},"reps":{"type":"string","maxLength":32},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"rest_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":3600},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"equipment_requirements":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"maxItems":17},"equipment_requirements_complete":{"type":"boolean"}},"required":["exercise_id","exercise_name","sets","reps"],"additionalProperties":false},"maxItems":50},"progression_mode":{"type":"string","enum":["static","guided","adaptive"]}},"required":["title","description","exercises","progression_mode"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"routine.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"exercises":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"exercise_name":{"type":"string","minLength":1,"maxLength":200},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sets":{"type":"integer","minimum":1,"maximum":20},"reps":{"type":"string","maxLength":32},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"rest_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":3600},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"equipment_requirements":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"maxItems":17},"equipment_requirements_complete":{"type":"boolean"}},"required":["exercise_id","exercise_name","sets","reps"],"additionalProperties":false},"maxItems":50},"progression_mode":{"type":"string","enum":["static","guided","adaptive"]}},"required":["title","description","exercises","progression_mode"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"routine.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"schedule.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"routine":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"existing"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"created"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"}},"required":["kind","action_id"],"additionalProperties":false}]},"status":{"type":"string","enum":["planned","skipped"]}},"required":["type","action_id","date","expected_revision","routine","status"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"schedule.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","date","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"sets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"exercise_id":{"type":"string","format":"uuid"},"set_type":{"type":"string","enum":["normal","warmup","failure","drop_set"]},"parent_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"superset_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"set_number":{"type":"integer","minimum":1,"maximum":200},"weight_kg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number","minimum":-20,"maximum":50},{"type":"null"}]}},"required":["key","exercise_id","set_type","parent_key","superset_key","set_number","weight_kg","reps","rpe","target_rpe","duration_seconds","distance_metres","incline_percent"],"additionalProperties":false},"minItems":1,"maxItems":200},"exercise_notes":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"note":{"type":"string","maxLength":2000}},"required":["exercise_id","note"],"additionalProperties":false},"maxItems":50},"feedback":{"anyOf":[{"type":"object","properties":{"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]}},"required":["difficulty","next_time_intent"],"additionalProperties":false},{"type":"null"}]}},"required":["title","started_at","ended_at","notes","sets","exercise_notes","feedback"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"sets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"exercise_id":{"type":"string","format":"uuid"},"set_type":{"type":"string","enum":["normal","warmup","failure","drop_set"]},"parent_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"superset_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"set_number":{"type":"integer","minimum":1,"maximum":200},"weight_kg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number","minimum":-20,"maximum":50},{"type":"null"}]}},"required":["key","exercise_id","set_type","parent_key","superset_key","set_number","weight_kg","reps","rpe","target_rpe","duration_seconds","distance_metres","incline_percent"],"additionalProperties":false},"minItems":1,"maxItems":200},"exercise_notes":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"note":{"type":"string","maxLength":2000}},"required":["exercise_id","note"],"additionalProperties":false},"maxItems":50},"feedback":{"anyOf":[{"type":"object","properties":{"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]}},"required":["difficulty","next_time_intent"],"additionalProperties":false},{"type":"null"}]}},"required":["title","started_at","ended_at","notes","sets","exercise_notes","feedback"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"meal.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"object","properties":{"meal_name":{"type":"string","minLength":1,"maxLength":200},"calories_kcal":{"anyOf":[{"type":"number","minimum":0,"maximum":9999},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["meal_name","calories_kcal","protein_g","carbs_g","fat_g","notes"],"additionalProperties":false}},"required":["type","action_id","date","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"meal.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"daily_totals.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"calories_kcal":{"anyOf":[{"type":"number","minimum":0,"maximum":9999},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]}},"required":["calories_kcal","protein_g","carbs_g","fat_g"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"recovery.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"sleep_quality":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"energy":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"soreness":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"stress":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":280},{"type":"null"}]}},"required":["sleep_quality","energy","soreness","stress","note"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"recovery.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","date","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"measurement.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"weight_kg":{"anyOf":[{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":500},{"type":"null"}]},"body_fat_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"chest_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"waist_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"hips_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"neck_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"left_arm_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"right_arm_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"left_thigh_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"right_thigh_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["weight_kg","body_fat_pct","chest_cm","waist_cm","hips_cm","neck_cm","left_arm_cm","right_arm_cm","left_thigh_cm","right_thigh_cm","notes"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"anyOf":[{"type":"object","properties":{"goal_type":{"type":"string","const":"target_1rm"},"exercise_id":{"type":"string","format":"uuid"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","exercise_id","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_session_count"},"target_value":{"type":"integer","minimum":1,"maximum":14},"target_unit":{"type":"string","const":"sessions"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_volume"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":100000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_calories"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":10000},"target_unit":{"type":"string","const":"kcal"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_protein"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"g"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"target_bodyweight"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":500},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false}]}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"anyOf":[{"type":"object","properties":{"goal_type":{"type":"string","const":"target_1rm"},"exercise_id":{"type":"string","format":"uuid"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","exercise_id","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_session_count"},"target_value":{"type":"integer","minimum":1,"maximum":14},"target_unit":{"type":"string","const":"sessions"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_volume"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":100000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_calories"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":10000},"target_unit":{"type":"string","const":"kcal"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_protein"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"g"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"target_bodyweight"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":500},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false}]}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.status"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"goal_type":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]},"status":{"type":"string","enum":["active","archived"]}},"required":["type","action_id","id","expected_revision","goal_type","status"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"goal_type":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]}},"required":["type","action_id","id","expected_revision","goal_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"preferences.patch"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"experience_level":{"type":"string","enum":["beginner","intermediate","advanced"]},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]},"timezone":{"type":"string","maxLength":100},"rest_seconds":{"type":"integer","minimum":0,"maximum":600}},"required":[],"additionalProperties":false}},"required":["type","action_id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"equipment.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"presetKey":{"anyOf":[{"type":"string","enum":["bodyweight","home_basics","home_gym","full_gym"]},{"type":"null"}]},"items":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"minItems":1,"maxItems":17},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isDefault":{"type":"boolean"}},"required":["name","items"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"equipment.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"presetKey":{"anyOf":[{"type":"string","enum":["bodyweight","home_basics","home_gym","full_gym"]},{"type":"null"}]},"items":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"minItems":1,"maxItems":17},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isDefault":{"type":"boolean"}},"required":["name","items"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false}]},"minItems":1,"maxItems":50}},"required":["version","command_id","actions"],"additionalProperties":false},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","const":"agent-access-write.v1"},"command_id":{"type":"string","format":"uuid"},"actions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"routine.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"exercises":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"exercise_name":{"type":"string","minLength":1,"maxLength":200},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sets":{"type":"integer","minimum":1,"maximum":20},"reps":{"type":"string","maxLength":32},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"rest_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":3600},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"equipment_requirements":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"maxItems":17},"equipment_requirements_complete":{"type":"boolean"}},"required":["exercise_id","exercise_name","sets","reps"],"additionalProperties":false},"maxItems":50},"progression_mode":{"type":"string","enum":["static","guided","adaptive"]}},"required":["title","description","exercises","progression_mode"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"routine.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"exercises":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"exercise_name":{"type":"string","minLength":1,"maxLength":200},"muscle_group":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"sets":{"type":"integer","minimum":1,"maximum":20},"reps":{"type":"string","maxLength":32},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"rest_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":3600},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"equipment_requirements":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"maxItems":17},"equipment_requirements_complete":{"type":"boolean"}},"required":["exercise_id","exercise_name","sets","reps"],"additionalProperties":false},"maxItems":50},"progression_mode":{"type":"string","enum":["static","guided","adaptive"]}},"required":["title","description","exercises","progression_mode"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"routine.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"schedule.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"routine":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"existing"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["kind","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"created"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"}},"required":["kind","action_id"],"additionalProperties":false}]},"status":{"type":"string","enum":["planned","skipped"]}},"required":["type","action_id","date","expected_revision","routine","status"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"schedule.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","date","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"sets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"exercise_id":{"type":"string","format":"uuid"},"set_type":{"type":"string","enum":["normal","warmup","failure","drop_set"]},"parent_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"superset_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"set_number":{"type":"integer","minimum":1,"maximum":200},"weight_kg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number","minimum":-20,"maximum":50},{"type":"null"}]}},"required":["key","exercise_id","set_type","parent_key","superset_key","set_number","weight_kg","reps","rpe","target_rpe","duration_seconds","distance_metres","incline_percent"],"additionalProperties":false},"minItems":1,"maxItems":200},"exercise_notes":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"note":{"type":"string","maxLength":2000}},"required":["exercise_id","note"],"additionalProperties":false},"maxItems":50},"feedback":{"anyOf":[{"type":"object","properties":{"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]}},"required":["difficulty","next_time_intent"],"additionalProperties":false},{"type":"null"}]}},"required":["title","started_at","ended_at","notes","sets","exercise_notes","feedback"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"sets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"exercise_id":{"type":"string","format":"uuid"},"set_type":{"type":"string","enum":["normal","warmup","failure","drop_set"]},"parent_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"superset_key":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},{"type":"null"}]},"set_number":{"type":"integer","minimum":1,"maximum":200},"weight_kg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000},{"type":"null"}]},"reps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"target_rpe":{"anyOf":[{"type":"number","minimum":1,"maximum":10},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":86400},{"type":"null"}]},"distance_metres":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000},{"type":"null"}]},"incline_percent":{"anyOf":[{"type":"number","minimum":-20,"maximum":50},{"type":"null"}]}},"required":["key","exercise_id","set_type","parent_key","superset_key","set_number","weight_kg","reps","rpe","target_rpe","duration_seconds","distance_metres","incline_percent"],"additionalProperties":false},"minItems":1,"maxItems":200},"exercise_notes":{"type":"array","items":{"type":"object","properties":{"exercise_id":{"type":"string","format":"uuid"},"note":{"type":"string","maxLength":2000}},"required":["exercise_id","note"],"additionalProperties":false},"maxItems":50},"feedback":{"anyOf":[{"type":"object","properties":{"difficulty":{"type":"string","enum":["easier_than_expected","as_expected","harder_than_expected"]},"next_time_intent":{"type":"string","enum":["keep","review"]}},"required":["difficulty","next_time_intent"],"additionalProperties":false},{"type":"null"}]}},"required":["title","started_at","ended_at","notes","sets","exercise_notes","feedback"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"workout.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"meal.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"object","properties":{"meal_name":{"type":"string","minLength":1,"maxLength":200},"calories_kcal":{"anyOf":[{"type":"number","minimum":0,"maximum":9999},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["meal_name","calories_kcal","protein_g","carbs_g","fat_g","notes"],"additionalProperties":false}},"required":["type","action_id","date","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"meal.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","id","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"daily_totals.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"calories_kcal":{"anyOf":[{"type":"number","minimum":0,"maximum":9999},{"type":"null"}]},"protein_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"carbs_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]},"fat_g":{"anyOf":[{"type":"number","minimum":0,"maximum":999},{"type":"null"}]}},"required":["calories_kcal","protein_g","carbs_g","fat_g"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"recovery.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"sleep_quality":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"energy":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"soreness":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"stress":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":280},{"type":"null"}]}},"required":["sleep_quality","energy","soreness","stress","note"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"recovery.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}},"required":["type","action_id","date","expected_revision"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"measurement.put"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expected_revision":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}]},"value":{"type":"object","properties":{"weight_kg":{"anyOf":[{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":500},{"type":"null"}]},"body_fat_pct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"chest_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"waist_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"hips_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"neck_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"left_arm_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"right_arm_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"left_thigh_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"right_thigh_cm":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":500},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["weight_kg","body_fat_pct","chest_cm","waist_cm","hips_cm","neck_cm","left_arm_cm","right_arm_cm","left_thigh_cm","right_thigh_cm","notes"],"additionalProperties":false}},"required":["type","action_id","date","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"anyOf":[{"type":"object","properties":{"goal_type":{"type":"string","const":"target_1rm"},"exercise_id":{"type":"string","format":"uuid"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","exercise_id","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_session_count"},"target_value":{"type":"integer","minimum":1,"maximum":14},"target_unit":{"type":"string","const":"sessions"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_volume"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":100000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_calories"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":10000},"target_unit":{"type":"string","const":"kcal"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_protein"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"g"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"target_bodyweight"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":500},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false}]}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"anyOf":[{"type":"object","properties":{"goal_type":{"type":"string","const":"target_1rm"},"exercise_id":{"type":"string","format":"uuid"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","exercise_id","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_session_count"},"target_value":{"type":"integer","minimum":1,"maximum":14},"target_unit":{"type":"string","const":"sessions"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"weekly_volume"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":100000},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_calories"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":10000},"target_unit":{"type":"string","const":"kcal"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"daily_protein"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":1000},"target_unit":{"type":"string","const":"g"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false},{"type":"object","properties":{"goal_type":{"type":"string","const":"target_bodyweight"},"target_value":{"type":"number","exclusiveMinimum":0,"maximum":500},"target_unit":{"type":"string","const":"kg"}},"required":["goal_type","target_value","target_unit"],"additionalProperties":false}]}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.status"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"goal_type":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]},"status":{"type":"string","enum":["active","archived"]}},"required":["type","action_id","id","expected_revision","goal_type","status"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"goal.delete"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"goal_type":{"type":"string","enum":["target_1rm","weekly_session_count","weekly_volume","daily_calories","daily_protein","target_bodyweight"]}},"required":["type","action_id","id","expected_revision","goal_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"preferences.patch"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"experience_level":{"type":"string","enum":["beginner","intermediate","advanced"]},"unit_preference":{"type":"string","enum":["kg","lbs"]},"height_unit_preference":{"type":"string","enum":["cm","ft_in"]},"bodyweight_unit_preference":{"type":"string","enum":["kg","lbs","stone"]},"timezone":{"type":"string","maxLength":100},"rest_seconds":{"type":"integer","minimum":0,"maximum":600}},"required":[],"additionalProperties":false}},"required":["type","action_id","expected_revision","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"equipment.create"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"value":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"presetKey":{"anyOf":[{"type":"string","enum":["bodyweight","home_basics","home_gym","full_gym"]},{"type":"null"}]},"items":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"minItems":1,"maxItems":17},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isDefault":{"type":"boolean"}},"required":["name","items"],"additionalProperties":false}},"required":["type","action_id","value"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"equipment.replace"},"action_id":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$"},"id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"value":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"presetKey":{"anyOf":[{"type":"string","enum":["bodyweight","home_basics","home_gym","full_gym"]},{"type":"null"}]},"items":{"type":"array","items":{"type":"string","enum":["bodyweight","barbell","weight_plates","dumbbell","kettlebell","resistance_band","pull_up_bar","dip_station","cable_machine","weight_machine","bench","squat_rack","plyo_box","jump_rope","sled","outdoor_space","pool"]},"minItems":1,"maxItems":17},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isDefault":{"type":"boolean"}},"required":["name","items"],"additionalProperties":false}},"required":["type","action_id","id","expected_revision","value"],"additionalProperties":false}]},"minItems":1,"maxItems":50}},"required":["version","command_id","actions"],"additionalProperties":false}}}}},"get":{"operationId":"get_write_proposal","summary":"Get original batch status","description":"Retrieve this connection's original batch by command ID after preparation, approval or an uncertain response. Returns only minimal status and receipt, never unrelated records.","parameters":[{"name":"command_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"style":"form","explode":true}],"security":[{"agentAccessOAuth":[]}],"responses":{"200":{"description":"Bounded write workflow result; approval remains athlete-only.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"version":{"type":"string","const":"agent-access-write.v1"},"state":{"type":"string","const":"not_found"}},"required":["request_id","version","state"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"version":{"type":"string","const":"agent-access-write.v1"},"proposal_id":{"type":"string","format":"uuid"},"state":{"type":"string","enum":["pending","committed","rejected","expired","conflicted"]},"expires_at":{"type":"string","format":"date-time"},"receipt":{"anyOf":[{"type":"object","properties":{"proposal_id":{"type":"string","format":"uuid"},"committed_at":{"type":"string","format":"date-time"},"change_count":{"type":"integer","minimum":1,"maximum":50},"results":{"type":"array","items":{"type":"object","properties":{"action_id":{"type":"string","minLength":1,"maxLength":64},"record_id":{"type":"string","format":"uuid"}},"required":["action_id","record_id"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["proposal_id","committed_at","change_count","results"],"additionalProperties":false},{"type":"null"}]},"approval_url":{"type":"string"},"undone_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["request_id","version","proposal_id","state","expires_at","receipt","approval_url","undone_at"],"additionalProperties":false}]}}}},"400":{"description":"Agent Access request failed with HTTP 400.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"401":{"description":"Agent Access request failed with HTTP 401.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"403":{"description":"Agent Access request failed with HTTP 403.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"WWW-Authenticate":{"description":"OAuth bearer-token challenge for the protected resource.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"404":{"description":"Agent Access request failed with HTTP 404.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"413":{"description":"Agent Access request failed with HTTP 413.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"429":{"description":"Agent Access request failed with HTTP 429.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}},"503":{"description":"Agent Access request failed with HTTP 503.","headers":{"Cache-Control":{"description":"Agent Access responses are private and must not be stored.","schema":{"type":"string","const":"private, no-store"}},"Retry-After":{"description":"Seconds before the client should retry.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccessError"}}}}},"x-mcp-tool-name":"get_write_proposal","x-agent-access-input-schema":{"type":"object","properties":{"command_id":{"type":"string","format":"uuid"}},"required":["command_id"],"additionalProperties":false}}}},"components":{"securitySchemes":{"agentAccessOAuth":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://paggered.app/oauth/authorize","tokenUrl":"https://paggered.app/oauth/token","scopes":{"training":"Read the athlete's training record.","recovery":"Read the athlete's recovery check-ins.","nutrition":"Read the athlete's nutrition records.","body_measurements":"Read the athlete's body measurements."}}}}},"schemas":{"AgentAccessError":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","invalid_token","token_expired","grant_inactive","scope_required","pro_required","account_restricted","not_found","response_too_large","rate_limited","temporarily_unavailable"]},"message":{"type":"string","minLength":1,"maxLength":300},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["code","message","metadata"],"additionalProperties":false}},"required":["request_id","error"],"additionalProperties":false}}}}