Skip to main content
Glama
YuzeHao2023

Oura MCP Server

by YuzeHao2023

get_today_sleep_data

Retrieve today's sleep metrics from Oura Ring data 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 function for the 'get_today_sleep_data' tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function fetches sleep data for today using the oura_client, or returns an error if the client is not initialized.
    @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