Skip to main content
Glama

get_today_sleep_data

Retrieve today's sleep metrics from your Oura Ring to analyze sleep quality, duration, and patterns for health monitoring.

Instructions

Get sleep data for today. Returns: Dictionary containing sleep data for today

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler and registration for the 'get_today_sleep_data' tool. This function is decorated with @mcp.tool() to register it with the MCP server and implements the core logic: checks if Oura client is initialized, gets today's date, and fetches sleep data via the client.
    @mcp.tool() def get_today_sleep_data() -> dict[str, Any]: """ Get sleep data for today. Returns: Dictionary containing sleep data for today """ if oura_client is None: return {"error": "Oura client not initialized. Please provide an access token."} try: today = date.today() return oura_client.get_sleep_data(today, today) except Exception as e: return {"error": str(e)}

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/YuzeHao2023/MCP-oura'

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