Skip to main content
Glama

Import training history

import_document

Bulk-import full workout documents containing exercises, sessions, body metrics, programs. Validates active programs before saving; violations block import until fixed.

Instructions

Bulk-import a full workout document (exercises, sessions, body metrics, programs). Programs must be designed via get_coaching_context(task='new_program') and explicitly approved by the user before importing. Any active program in the document is validated server-side (the same checklist as review_program_draft) before anything is saved; a response with ok=false and a violations list means nothing was written — fix each one and call import_document again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.2.2
    • addedInput schema / properties / document / properties / body_metrics / items / properties / athlete_id / description
      Added value: +"Ignored when recording: every entry belongs to the signed-in user."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / body_fat_pct / description
      Added value: +"Body-fat percentage, 0 to 100."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / bodyweight_kg / description
      Added value: +"Body weight in kilograms. Convert pounds first (1 lb = 0.4536 kg)."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / custom_fields / description
      Added value: +"Anything worth keeping that has no field above, such as `resting_hr`. Stored and exported, not displayed."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / date / description
      Added value: +"Day the measurement was taken, YYYY-MM-DD in the user's own calendar. Without an id there is one entry per day: recording the same date again adds to that day's entry, overwriting only the fields and keys you send."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / id / description
      Added value: +"Leave empty when recording a measurement the user gives you: the entry is then keyed by its date. An id marks an entry copied from a source document (an export, a spreadsheet); import_document manages those, and recording the same id twice fails."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / measurements / description
      Added value: +"Circumferences in centimetres, keyed `<site>_cm`. The app shows `chest_cm`, `arm_cm`, `waist_cm` and `thigh_cm`; any other site is stored but not displayed."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / notes / description
      Added value: +"Context the user gave with the number (fasted, evening, after travel)."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / source / description
      Added value: +"Where the number came from, free text: `scale`, `tape`, `dexa`, `smart_scale`"
  2. First observedv1.2.1

TDQS

A4/5.0
Behavior4/5

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

Annotations only state readOnlyHint=false and destructiveHint=false, giving minimal behavioral information. The description adds crucial details: active programs are validated server-side before anything is saved, and a response with ok=false and a violations list means nothing was written. This atomicity disclosure is valuable and goes beyond what annotations provide.

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

Conciseness5/5

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

The description is three sentences long, with the purpose front-loaded in the first sentence, prerequisites in the second, and failure behavior in the third. Every sentence provides necessary information without repetition or filler, making it dense yet efficiently organized.

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

Completeness3/5

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

For a complex tool with a large nested schema, the description covers the most critical preconditions (program approval, validation) and failure atomicity, but it omits practical details like how ids are handled (existing vs new records), whether the import merges or replaces data, and what a successful response implies. Since an output schema exists, return values are covered, but the missing upsert semantics and id behavior leave an agent somewhat uncertain about side effects.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for the single 'document' parameter. It lists only four of the seven top-level sections (exercises, sessions, body metrics, programs) and omits 'schema_version' (a required field), 'athletes', 'day_templates', and 'metadata'. This incomplete mapping leaves agents to infer the full document structure from the schema alone, with little guidance on key prerequisites like schema_version.

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?

The description opens with 'Bulk-import a full workout document (exercises, sessions, body metrics, programs)', stating a specific verb, resource, and scope. This clearly differentiates it from sibling tools like log_session and log_body_metric, which handle single entities. The word 'full' signals the tool's bulk nature.

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?

The description gives a concrete prerequisite: programs must be designed via get_coaching_context(task='new_program') and explicitly approved by the user before importing. It also names review_program_draft as the validation reference, providing context on when this is appropriate. It implies the bulk-vs-single distinction through its opening phrase, though it doesn't explicitly enumerate when to use alternatives.

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