get_activity_weather
Retrieve weather conditions for a specific Garmin activity by providing its activity ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The actual tool handler function for 'get_activity_weather'. It takes an activity_id, formats the Garmin weather endpoint URL, and calls _connectapi to fetch the data.
@mcp.tool def get_activity_weather(activity_id: str) -> dict: endpoint = GET_ACTIVITY_WEATHER_ENDPOINT.format(activity_id=activity_id) return _connectapi(endpoint) - The endpoint constant used by get_activity_weather to construct the Garmin API URL for activity weather data.
GET_ACTIVITY_WEATHER_ENDPOINT = "/activity-service/activity/{activity_id}/weather" - src/garmin_workouts_mcp/server.py:157-157 (registration)The @mcp.tool decorator registers 'get_activity_weather' as an MCP tool on the FastMCP server instance named 'GarminWorkoutsMCP'.
@mcp.tool - The helper function _connectapi used by get_activity_weather to make authenticated API calls to Garmin.
def _connectapi(endpoint: str, method: str = "GET", **kwargs) -> dict: _ensure_authenticated() return garth.connectapi(endpoint, method=method, **kwargs)