Skip to main content
Glama
ESJavadex

REE MCP Server

by ESJavadex

get_storage_operations

Retrieve daily pumped storage operations data to analyze energy storage patterns, identify arbitrage opportunities, and calculate storage efficiency metrics for Spain's electrical grid.

Instructions

Get pumped storage operations for a day.

Shows pumping consumption (storing energy) and turbining (releasing energy) to identify arbitrage opportunities and storage efficiency.

Args: date: Date in YYYY-MM-DD format

Returns: JSON string with storage operations and efficiency metrics.

Examples: Get storage operations for Oct 8: >>> await get_storage_operations("2025-10-08")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'get_storage_operations' MCP tool. It fetches pumped hydro storage data (pumping and turbining) for a given date using REE indicators, processes hourly operations, calculates totals, net balance, and round-trip efficiency, and returns formatted JSON.
    @mcp.tool()
    async def get_storage_operations(date: str) -> str:
        """Get pumped storage operations for a day.
    
        Shows pumping consumption (storing energy) and turbining (releasing energy)
        to identify arbitrage opportunities and storage efficiency.
    
        Args:
            date: Date in YYYY-MM-DD format
    
        Returns:
            JSON string with storage operations and efficiency metrics.
    
        Examples:
            Get storage operations for Oct 8:
            >>> await get_storage_operations("2025-10-08")
        """
        try:
            start_date, end_date = DateTimeHelper.build_day_range(date)
    
            async with ToolExecutor() as executor:
                use_case = executor.create_get_indicator_data_use_case()
    
                # Get pumping consumption
                pumping_request = GetIndicatorDataRequest(
                    indicator_id=IndicatorIDs.PUMPING_CONSUMPTION.id,
                    start_date=start_date,
                    end_date=end_date,
                    time_granularity="hour",
                )
                pumping_response = await use_case.execute(pumping_request)
                pumping_data = pumping_response.model_dump()
    
                # Get turbining
                turbining_request = GetIndicatorDataRequest(
                    indicator_id=IndicatorIDs.PUMPED_TURBINING.id,
                    start_date=start_date,
                    end_date=end_date,
                    time_granularity="hour",
                )
                turbining_response = await use_case.execute(turbining_request)
                turbining_data = turbining_response.model_dump()
    
            # Combine data
            pumping_values = pumping_data.get("values", [])
            turbining_values = turbining_data.get("values", [])
    
            operations = []
            total_pumping_mwh = 0.0
            total_turbining_mwh = 0.0
    
            for pumping, turbining in zip(pumping_values, turbining_values, strict=False):
                pump_mw = pumping["value"]
                turb_mw = turbining["value"]
                net_mw = turb_mw - pump_mw
    
                operations.append(
                    {
                        "datetime": pumping["datetime"],
                        "pumping_mw": pump_mw,
                        "turbining_mw": turb_mw,
                        "net_storage_mw": round(net_mw, 2),
                        "operation": (
                            "storing"
                            if pump_mw > turb_mw
                            else "releasing"
                            if turb_mw > pump_mw
                            else "idle"
                        ),
                    }
                )
    
                total_pumping_mwh += pump_mw
                total_turbining_mwh += turb_mw
    
            # Calculate efficiency (typical pumped storage is 70-85%)
            efficiency_pct = (
                (total_turbining_mwh / total_pumping_mwh * 100) if total_pumping_mwh > 0 else 0
            )
    
            result = {
                "date": date,
                "operations": operations,
                "summary": {
                    "total_energy_stored_mwh": round(total_pumping_mwh, 2),
                    "total_energy_released_mwh": round(total_turbining_mwh, 2),
                    "net_energy_balance_mwh": round(total_turbining_mwh - total_pumping_mwh, 2),
                    "efficiency_percentage": round(efficiency_pct, 2),
                    "efficiency_assessment": ("normal" if 70 <= efficiency_pct <= 85 else "check_data"),
                },
            }
    
            return ResponseFormatter.success(result)
    
        except Exception as e:
            return ResponseFormatter.unexpected_error(e, context="Error getting storage operations")
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns 'storage operations and efficiency metrics' in JSON format, which adds useful context beyond basic retrieval. However, it doesn't cover behavioral aspects like rate limits, error handling, or data freshness, leaving gaps for a tool with no annotation support.

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

Conciseness5/5

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

The description is well-structured and front-loaded with the core purpose, followed by details on args, returns, and an example. Every sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given one parameter with low schema coverage and an output schema present, the description provides adequate context: it explains the parameter format, return format, and includes an example. However, for a tool with no annotations, it could benefit from more behavioral details like data sources or update frequency to be fully complete.

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 schema has 0% description coverage, but the description compensates by specifying the 'date' parameter format as 'YYYY-MM-DD' and providing an example. This adds meaningful semantics beyond the bare schema, though it doesn't detail constraints like valid date ranges or timezone handling.

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 tool retrieves 'pumped storage operations for a day' and specifies the data includes 'pumping consumption' and 'turbining', which distinguishes it from general energy data tools. However, it doesn't explicitly differentiate from sibling tools like 'get_demand_summary' or 'get_generation_mix', which might also involve energy metrics.

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

Usage Guidelines3/5

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

The description implies usage for 'identify[ing] arbitrage opportunities and storage efficiency', suggesting context for energy market analysis. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_price_analysis' or 'get_demand_summary', and no exclusions or prerequisites are mentioned.

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/ESJavadex/ree-mcp'

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