Skip to main content
Glama
tomekkorbak

Oura MCP Server

by tomekkorbak

get_today_resilience_data

Retrieve today's resilience metrics from Oura API to monitor stress recovery and overall well-being through the MCP server.

Instructions

Get resilience data for today.

Returns:
    Dictionary containing resilience data for today

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'get_today_resilience_data' MCP tool. It checks if the Oura client is initialized, computes today's date, calls the client's get_resilience_data method for today, and handles exceptions by returning an error dictionary.
    @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)}
  • The OuraClient helper method get_resilience_data that performs the actual API call to fetch resilience data from Oura API for a date range, transforms the response by removing 'id' fields, and returns the data dictionary. This is called by the tool handler.
    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}
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool returns a dictionary but lacks details on behavioral traits such as data freshness, error handling, authentication needs, or rate limits. For a read operation with zero annotation coverage, this is inadequate.

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

Conciseness3/5

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

The description is brief and front-loaded with the main purpose, but the 'Returns:' section is redundant as it restates the purpose without adding value. It could be more concise by omitting the second sentence or integrating it better.

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?

Given no annotations and no output schema, the description is incomplete. It lacks details on the return format (e.g., structure of the dictionary), error conditions, or dependencies. For a tool with siblings and no structured support, more context is needed to be fully helpful.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so no parameter information is needed. The description doesn't add param semantics beyond the schema, but since there are no parameters, a baseline of 4 is appropriate as it doesn't need to compensate for gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 resource ('resilience data for today'), making the purpose understandable. It distinguishes from the sibling 'get_resilience_data' by specifying 'today', but doesn't explicitly differentiate from 'get_today_readiness_data' or 'get_today_sleep_data' beyond the resource type.

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_resilience_data' (which might fetch broader date ranges) or other 'today' tools for different data types. The description implies usage for today's resilience data but offers no explicit 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/tomekkorbak/oura-mcp-server'

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