add_or_update_event
Create or update a training event on Intervals.icu by providing workout type, name, date, and structured steps—use event_id to modify an existing event.
Instructions
Post event for an athlete to Intervals.icu this follows the event api from intervals.icu If event_id is provided, the event will be updated instead of created.
Many arguments are required as this MCP tool function maps directly to the Intervals.icu API parameters.
Args: athlete_id: The Intervals.icu athlete ID (optional, will use ATHLETE_ID from .env if not provided) api_key: The Intervals.icu API key (optional, will use API_KEY from .env if not provided) event_id: The Intervals.icu event ID (optional, will use event_id from .env if not provided) start_date: Start date in YYYY-MM-DD format (optional, defaults to today) name: Name of the activity workout_doc: steps as a list of Step objects (optional, but necessary to define workout steps) workout_type: Workout type (e.g. Ride, Run, Swim, Walk, Row) moving_time: Total expected moving time of the workout in seconds (optional) distance: Total expected distance of the workout in meters (optional)
Example: "workout_doc": { "description": "High-intensity workout for increasing VO2 max", "steps": [ {"power": {"value": 80, "units": "%ftp"}, "duration": 900, "warmup": true}, {"reps": 2, "text": "High-intensity intervals", "steps": [ {"power": {"value": 110, "units": "%ftp"}, "distance": 500, "text": "High-intensity"}, {"power": {"value": 80, "units": "%ftp"}, "duration": 90, "text": "Recovery"} ]}, {"power": {"value": 80, "units": "%ftp"}, "duration": 600, "cooldown": true}, {"text": ""} ] }
Step properties: distance: Distance of step in meters {"distance": 5000} duration: Duration of step in seconds {"duration": 1800} power/hr/pace/cadence: Define step intensity Percentage of FTP: {"power": {"value": 80, "units": "%ftp"}} Absolute power: {"power": {"value": 200, "units": "w"}} Heart rate: {"hr": {"value": 75, "units": "%hr"}} Heart rate (LTHR): {"hr": {"value": 85, "units": "%lthr"}} Cadence: {"cadence": {"value": 90, "units": "cadence"}} Pace by ftp: {"pace": {"value": 80, "units": "%pace"}} Pace by zone: {"pace": {"value": 2, "units": "pace_zone"}} Zone by power: {"power": {"value": 2, "units": "power_zone"}} Zone by heart rate: {"hr": {"value": 2, "units": "hr_zone"}} Ranges: Specify ranges for power, heart rate, or cadence: {"power": {"start": 80, "end": 90, "units": "%ftp"}} Ramps: Instead of a range, indicate a gradual change in intensity (useful for ERG workouts): {"ramp": true, "power": {"start": 80, "end": 90, "units": "%ftp"}} Repeats: include the reps property and add nested steps {"reps": 3, "steps": [ {"power": {"value": 110, "units": "%ftp"}, "distance": 500, "text": "High-intensity"}, {"power": {"value": 80, "units": "%ftp"}, "duration": 90, "text": "Recovery"} ]} Free Ride: Include freeride to indicate a segment without ERG control, optionally with a suggested power range: {"freeride": true, "power": {"value": 80, "units": "%ftp"}} Comments and Labels: Add descriptive text to label steps: {"text": "Warmup"}
How to use steps:
Set distance or duration as appropriate for step
Use "reps" with nested steps to define repeat intervals (as in example above)
Define one of "power", "hr" or "pace" to define step intensity
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| api_key | No | ||
| distance | No | ||
| event_id | No | ||
| athlete_id | No | ||
| start_date | No | ||
| moving_time | No | ||
| workout_doc | No | ||
| workout_type | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |