Skip to main content
Glama

Edit a draft workout

edit_draft_workout
DestructiveIdempotent

Edit one calendar day's session in the cached plan draft: change workout_sub_type, target_distance_km, target_pace_seconds_per_km, or coach_note; pass make_rest=true to clear the day to a rest day; editing an empty day creates a session. Draft-only: changes the cached preview and nothing the athlete sees. Returns the refreshed plan; content_preview holds whole weeks from the first changed week and next_cursor continues in get_plan_draft. Only the account that created the draft can edit it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "athlete_id": "<athlete_id>",
      "draft_id": "<draft_id>",
      "week": "<week>",
      "day": "<day>"
    },
    "name": "edit_draft_workout"
  }
}

Input Schema

NameRequiredDescriptionDefault
dayYesDay of the week; abbreviations such as 'Sat' and 1-7 (Monday=1) work.
weekYesPlan week number, starting at 1.
draft_idYesdraft_id from create_training_plan or a draft edit by this account (single-use, expires 24 hours after drafting).
make_restNoClear the day to a rest day.
athlete_idYesThe draft's owner: the athlete for an individual draft; for a group draft, the coach's own id from get_current_user.
coach_noteNoA note shown with the session.
workout_sub_typeNoSession type, for example easy_run, tempo_run, long_run or interval_run.
target_distance_kmNoSession distance in km.
target_pace_seconds_per_kmNoTarget pace in seconds per km (300 = 5:00/km).

Output Schema

NameRequiredDescriptionDefault
goalNo
draftNo
errorNo
levelNo
weeksNo
statusNo
messageNo
privacyNoPresent when the athlete's settings withhold data.
draft_idNo
group_idNo
retry_atNoEpoch milliseconds; an uncharged allowance-limited job resumes on a poll at or after this instant.
warningsNo
next_stepNoWhat can be done next, for example after a failure.
operationNo
plan_nameNo
athlete_idNo
expires_atNo
group_nameNo
next_stepsNo
assumptionsNo
athlete_pbsNo
goal_sourceNo
next_cursorNoReads the next page; null on the last page.
reason_codeNo
total_weeksNo
member_countNo
retry_at_isoNoThe epoch field beside it as a UTC instant; the local day can differ.
subject_kindNo
user_contentNoFields in this result that people wrote.
changed_cellsNo
phase_outlineNo
expires_at_isoNoThe epoch field beside it as a UTC instant; the local day can differ.
missing_inputsNo
weeks_returnedNo
content_previewNo
generation_stateNoqueued, generating, ready, failed or access_revoked; only ready content is editable/saveable.
truncated_fieldsNoLists cut to fit one response: rows returned and total.
allowance_chargedNoAudit of the stable Redis reservation; retries of this job do not charge again.
duration_in_weeksNo
generated_contentNoFields in this result that NexRex's AI wrote.
weekly_mileage_kmNo
workout_preferenceNo
preferences_appliedNo
session_definitionsNoSessions that several rows of this result share by session_ref.
content_block_fieldsNoColumn names of every content_blocks row, nested blocks rows included.
recommended_start_dateNo
training_principle_org_idNo
training_principle_sourceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / $defs / Activity / properties / content_blocks / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "items": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "boolean"
      -          },
      -          {
      -            "items": {
      -              "anyOf": [
      -                {
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "integer"
      -                },
      -                {
      -                  "type": "number"
      -                },
      -                {
      -                  "type": "boolean"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "type": "array"
      -          },
      -          {
      -            "$ref": "#/$defs/LocalizedText"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "type": "array"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "items": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "items": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "integer"
      +                },
      +                {
      +                  "type": "number"
      +                },
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "$ref": "#/$defs/LocalizedText"
      +          },
      +          {
      +            "items": {
      +              "type": "array"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "type": "array"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / $defs / Activity / properties / content_blocks / description
      Previous value: -"Interval rows; each row's values follow content_block_fields."New value: +"Workout steps as rows whose values follow content_block_fields; an interval's blocks value is its nested steps as rows in the same columns."
    • changedOutput schema / properties / content_block_fields / description
      Previous value: -"Column names of every content_blocks row."New value: +"Column names of every content_blocks row, nested blocks rows included."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations it discloses what actually gets destroyed (make_rest=true clears the day to rest), the create-on-empty upsert behavior, the draft-only blast radius ('nothing the athlete sees'), and an authorization constraint ('only the account that created the draft can edit it'). These are exactly the mutation facts the annotations alone (destructiveHint/idempotentHint) cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and dense with information; nearly every clause earns its place. The closing sentence on content_preview and next_cursor partially duplicates the output schema and makes the single paragraph over-packed rather than cleanly sectioned.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter, destructive, draft-scoped mutation with an output schema and full annotation coverage, the description supplies the remaining essentials: permission scope, draft-only effect, rest-clearing semantics, and pagination continuation. Nothing needed to invoke it correctly appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning the schema does not: make_rest interaction with an empty day, and the fact that the four listed fields are the entire editable surface. It does not restate units or formats, which the schema already covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Edit one calendar day's session in the cached plan draft') and enumerates exactly which fields can change, so the agent knows this is a per-day field edit rather than a move, add, or week rescale. The clause 'editing an empty day creates a session' further pins down scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Draft-only: changes the cached preview and nothing the athlete sees' gives a clear usage context/exclusion, and 'next_cursor continues in get_plan_draft' routes the agent forward. It never explicitly contrasts with move_draft_workout or add_draft_test_race, so the agent must infer the boundary from the sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources