Skip to content

get_workout, download_workout, get_fitness_age, get_training_effect all call methods that don't exist on the client #20

Description

@MAT-GRC

Found while wiring this package into a remote MCP server. Version 1.0.1, using the garminconnect client as installed (didn't check what version pins to what).

Bugs in tools/workouts.py

manage_workouts(action="get") calls client.safe_call("get_workout", workout_id). The underlying garminconnect.Garmin client has no get_workout method, only get_workout_by_id. Every get call fails with "Method 'get_workout' not found on Garmin client".

manage_workouts(action="download") calls download_workout(), which returns raw bytes (a FIT file). That gets passed straight into the JSON response builder and crashes on serialization since bytes isn't JSON-serializable.

Bugs in tools/training.py

get_performance_metrics() calls client.safe_call("get_fitness_age", query_date). Same issue, the real method is get_fitnessage_data.

get_training_effect() calls client.safe_call("get_training_effect", activity_id), which doesn't exist on the client at all. Training effect isn't its own endpoint, it comes back nested in get_activity(activity_id)'s response under summaryDTO (trainingEffect, anaerobicTrainingEffect, trainingEffectLabel, aerobicTrainingEffectMessage, anaerobicTrainingEffectMessage, activityTrainingLoad).

Missing feature, not a bug

garminconnect.Garmin already has schedule_workout(workout_id, date_str), unschedule_workout(scheduled_workout_id) and get_scheduled_workouts(year, month), but manage_workouts never exposes them. Would be a useful addition since creating a workout without being able to put it on the calendar is a pretty common half-step.

Checked, genuinely not fixable as-is

tools/activities.py's get_activity_social() calls client.safe_call("get_activity_social", activity_id), no such method exists. Went looking for equivalent data (likes/kudos/comments) inside get_activity() and get_activity_details() recursively, found nothing. Might need a new method added to the garminconnect dependency itself, not something fixable from this repo alone.

Happy to open a PR for the workouts.py/training.py fixes and the schedule/unschedule addition if useful, they're small and I already have them working. Let me know.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions