Skip to main content
Glama

get_today_resilience_data

Retrieve today's resilience metrics from Oura Ring data to analyze personal recovery capacity and stress management levels for health monitoring.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_today_resilience_data' tool, decorated with @mcp.tool() for registration and execution. It fetches today's resilience data using the OuraClient or returns an error if not initialized.
    @mcp.tool() def get_today_resilience_data() -> dict[str, Any]: """ Get resilience data for today. Returns: Dictionary containing resilience 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_resilience_data(today, today) except Exception as e: return {"error": str(e)}
  • Helper method in OuraClient class that queries the Oura API's daily_resilience endpoint for the specified date range and transforms the response by removing 'id' fields.
    def get_resilience_data( self, start_date: date, end_date: Optional[date] = None ) -> dict[str, Any]: """ Get resilience data for a specific date range. Args: start_date: Start date for the query end_date: End date for the query (optional, defaults to start_date) Returns: Dictionary containing resilience data """ if end_date is None: end_date = start_date params = { "start_date": start_date.isoformat(), "end_date": end_date.isoformat(), } url = f"{self.BASE_URL}/daily_resilience" response = self.client.get(url, headers=self.headers, params=params) if response.status_code != 200: error_msg = f"Error {response.status_code}: {response.text}" raise Exception(error_msg) # Get the raw response raw_data = response.json() # Transform the data - just return the data array directly transformed_data = [] for item in raw_data.get("data", []): # Create transformed item without the id field transformed_item = {k: v for k, v in item.items() if k != "id"} transformed_data.append(transformed_item) # Return with the original structure but with transformed data return {"data": transformed_data}

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