Skip to main content
Glama
Schimmilab

Withings MCP Server

by Schimmilab

get_sleep_details

Retrieve detailed sleep data including all sleep phases for a specified date range from your Withings device.

Instructions

Get detailed sleep data with all sleep phases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startdateNoStart date (YYYY-MM-DD) or Unix timestamp
enddateNoEnd date (YYYY-MM-DD) or Unix timestamp

Implementation Reference

  • The handler method _get_sleep_details that executes the 'get_sleep_details' tool logic. It calls the Withings API endpoint /v2/sleep with action=get to retrieve detailed sleep data including all sleep phases.
    async def _get_sleep_details(self, args: dict) -> dict:
        """Get detailed sleep data."""
        params = {"action": "get"}
    
        if "startdate" in args:
            params["startdate"] = self._parse_date(args["startdate"])
        if "enddate" in args:
            params["enddate"] = self._parse_date(args["enddate"], end_of_day=True)
    
        return await self._make_request("/v2/sleep", params)
  • Input schema definition for the 'get_sleep_details' tool. It defines two optional parameters: startdate and enddate (both strings, YYYY-MM-DD or Unix timestamp).
    Tool(
        name="get_sleep_details",
        description="Get detailed sleep data with all sleep phases",
        inputSchema={
            "type": "object",
            "properties": {
                "startdate": {
                    "type": "string",
                    "description": "Start date (YYYY-MM-DD) or Unix timestamp",
                },
                "enddate": {
                    "type": "string",
                    "description": "End date (YYYY-MM-DD) or Unix timestamp",
                },
            },
        },
    ),
  • Registration/dispatch of the tool name 'get_sleep_details' in the call_tool handler. When name matches 'get_sleep_details', it calls self._get_sleep_details(arguments).
    elif name == "get_sleep_details":
        result = await self._get_sleep_details(arguments)
Behavior2/5

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

No annotations are provided, so the description bears the full burden of disclosing behavior. It only mentions that sleep phases are included but does not specify return format, pagination, date range limits, or other behavioral traits.

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

Conciseness4/5

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

The description is a single sentence of 8 words with no extraneous content. It is concise but could potentially include more useful information without being verbose.

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

Completeness2/5

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

There is no output schema, so the description should compensate by hinting at the return format. It only says 'detailed sleep data with all sleep phases', which is vague. Considering the complexity of sleep phases, more detail would be beneficial.

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

Parameters3/5

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

Schema coverage of parameters is 100%, both with descriptions in the schema. The description adds no additional meaning beyond what the schema already provides, so baseline score of 3 is appropriate.

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 clearly states the verb 'Get' and the resource 'detailed sleep data', and specifies 'with all sleep phases', which distinguishes it from the sibling tool 'get_sleep_summary' that likely provides summary data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_sleep_summary'. There is no explicit mention of context or exclusions.

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

Install Server

Other Tools

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/Schimmilab/withings-mcp-server'

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