get_workouts
Get workout session data from Withings by providing start and end dates. Use this tool to analyze your training history.
Instructions
Get workout/training sessions data
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startdateymd | No | Start date in YYYY-MM-DD format | |
| enddateymd | No | End date in YYYY-MM-DD format |
Implementation Reference
- The `_get_workouts` async method executes the tool logic: builds params with action='getworkouts', passes optional startdateymd/enddateymd arguments, and makes a request to the Withings API endpoint '/v2/measure'. This is the core handler for the get_workouts tool.
async def _get_workouts(self, args: dict) -> dict: """Get workout data.""" params = {"action": "getworkouts"} if "startdateymd" in args: params["startdateymd"] = args["startdateymd"] if "enddateymd" in args: params["enddateymd"] = args["enddateymd"] return await self._make_request("/v2/measure", params) - The Tool definition for 'get_workouts', including its description and inputSchema (accepts optional startdateymd and enddateymd as strings). Registered in the list_tools() return list.
Tool( name="get_workouts", description="Get workout/training sessions data", inputSchema={ "type": "object", "properties": { "startdateymd": { "type": "string", "description": "Start date in YYYY-MM-DD format", }, "enddateymd": { "type": "string", "description": "End date in YYYY-MM-DD format", }, }, }, ), - src/withings_mcp_server/server.py:218-219 (registration)The call_tool handler dispatches the 'get_workouts' name to the `_get_workouts` method at line 219.
elif name == "get_workouts": result = await self._get_workouts(arguments)