Skip to main content
Glama
schimmmi

Withings MCP Server

by schimmmi

get_workouts

Retrieve workout and training session data from Withings Health API within specified date ranges to track fitness progress and analyze exercise patterns.

Instructions

Get workout/training sessions data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startdateymdNoStart date in YYYY-MM-DD format
enddateymdNoEnd date in YYYY-MM-DD format

Implementation Reference

  • The core handler function for the 'get_workouts' tool. It constructs the API parameters from input arguments and calls the Withings '/v2/measure' endpoint with action='getworkouts' to retrieve workout data.
    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)
  • Defines the tool schema including name, description, and input schema for 'get_workouts' with optional date range parameters.
    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",
                },
            },
        },
    ),
  • Registers the tool handler by dispatching 'get_workouts' calls to the _get_workouts method within the main call_tool function.
    elif name == "get_workouts":
        result = await self._get_workouts(arguments)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/schimmmi/withings-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server