Draft a training plan
create_training_planDraft a goal-based training plan from recent status and a race goal. Use it when no catalog plan fits (recommend_training_plans reports no_good_match) or a coach wants a custom plan. The caller's own athlete_id comes from get_current_user; the caller need not be in a coach roster. Draft-only: writes a cached draft, never the athlete's calendar, and uses one of the caller's daily draft allowances when generation starts. Returns promptly with queued/generating status; get_plan_draft polls progress and ready content. An uncharged allowance_limited result gives retry_at for the same handle. Identical inputs on this connection reuse an active/ready job until consumed or expired; terminal failure permits a new job and a new charge. Returns a draft_id for draft edits and save_training_plan (single-use, expires in 24h, usable only by this account); content_preview holds the first weeks and next_cursor continues in get_plan_draft. Pass exactly one of athlete_id or group_id; group_id drafts a Group Plan Template (saved with save_training_plan save_mode='template_only') from distance, weeks and target_time; race_id and race_date are ignored for groups. workout_preference reflects the coach's choice: 'ai_generate' (default) creates workouts, 'prefer_existing' reuses the org's workout library where it can, 'strict_existing' uses only library workouts and returns status no_existing_workouts when none match.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_training_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| weeks | No | ||
| race_id | No | ||
| distance | No | ||
| group_id | No | ||
| race_date | No | ||
| athlete_id | No | ||
| start_date | No | ||
| preferences | No | ||
| target_time | No | ||
| workout_preference | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | No | ||
| draft | No | ||
| error | No | ||
| level | No | ||
| weeks | No | ||
| status | No | ||
| message | No | ||
| privacy | No | Present when the athlete's settings withhold data. | |
| draft_id | No | ||
| group_id | No | ||
| retry_at | No | Epoch milliseconds; an uncharged allowance-limited job resumes on a poll at or after this instant. | |
| warnings | No | ||
| next_step | No | What can be done next, for example after a failure. | |
| operation | No | ||
| plan_name | No | ||
| athlete_id | No | ||
| expires_at | No | ||
| group_name | No | ||
| next_steps | No | ||
| assumptions | No | ||
| athlete_pbs | No | ||
| goal_source | No | ||
| next_cursor | No | Reads the next page; null on the last page. | |
| reason_code | No | ||
| total_weeks | No | ||
| member_count | No | ||
| retry_at_iso | No | The epoch field beside it as a UTC instant; the local day can differ. | |
| subject_kind | No | ||
| user_content | No | Fields in this result that people wrote. | |
| changed_cells | No | ||
| phase_outline | No | ||
| expires_at_iso | No | The epoch field beside it as a UTC instant; the local day can differ. | |
| missing_inputs | No | ||
| weeks_returned | No | ||
| content_preview | No | ||
| generation_state | No | queued, generating, ready, failed or access_revoked; only ready content is editable/saveable. | |
| truncated_fields | No | Lists cut to fit one response: rows returned and total. | |
| allowance_charged | No | Audit of the stable Redis reservation; retries of this job do not charge again. | |
| duration_in_weeks | No | ||
| generated_content | No | Fields in this result that NexRex's AI wrote. | |
| weekly_mileage_km | No | ||
| workout_preference | No | ||
| preferences_applied | No | ||
| session_definitions | No | Sessions that several rows of this result share by session_ref. | |
| content_block_fields | No | Column names of every content_blocks row, nested blocks rows included. | |
| recommended_start_date | No | ||
| training_principle_org_id | No | ||
| training_principle_source | No |