Skip to main content
Glama
ESJavadex

REE MCP Server

by ESJavadex

get_renewable_summary

Retrieve renewable energy generation data for a specific date and hour, including breakdowns of wind, solar, and hydro sources with percentage calculations.

Instructions

Get renewable energy generation summary at a specific time.

Aggregates wind, solar PV, solar thermal, and hydro generation with renewable percentage calculations.

Args: date: Date in YYYY-MM-DD format hour: Hour in HH format (00-23, default: 12)

Returns: JSON string with renewable generation breakdown and percentages.

Examples: Get renewable summary at noon: >>> await get_renewable_summary("2025-10-08", "12")

Get overnight renewable summary:
>>> await get_renewable_summary("2025-10-08", "02")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
hourNo12

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation of get_renewable_summary in RenewableAnalysisService. Fetches data for multiple renewable indicators using DataFetcher, aggregates generation values distinguishing variable and synchronous renewables, calculates percentages relative to total demand, and returns structured summary.
    async def get_renewable_summary(self, start_date: str, end_date: str) -> dict[str, Any]:
        """Get renewable generation summary.
    
        Args:
            start_date: Start datetime in ISO format
            end_date: End datetime in ISO format
    
        Returns:
            Renewable summary with breakdowns and percentages
        """
        renewable_sources = IndicatorIDs.get_renewable_sources()
        raw_data = await self.data_fetcher.fetch_multiple_indicators(
            renewable_sources, start_date, end_date, "hour"
        )
    
        result: dict[str, Any] = {
            "datetime": start_date,
            "renewable_sources": {},
            "summary": {},
        }
    
        total_renewable_mw = 0.0
        variable_renewable_mw = 0.0
    
        # Process renewable sources
        for source_name, response_data in raw_data.items():
            if "error" in response_data:
                result["renewable_sources"][source_name] = response_data
            else:
                values = response_data.get("values", [])
                if values:
                    value_mw = values[0]["value"]
                    is_variable = source_name in [
                        "wind_national",
                        "solar_pv_national",
                        "solar_thermal_national",
                    ]
    
                    result["renewable_sources"][source_name] = {
                        "value_mw": value_mw,
                        "type": "variable" if is_variable else "synchronous",
                    }
    
                    total_renewable_mw += value_mw
                    if is_variable:
                        variable_renewable_mw += value_mw
                else:
                    result["renewable_sources"][source_name] = {"error": "No data available"}
    
        # Get total demand for percentage calculation
        demand_mw = await self.data_fetcher.fetch_value_at_time(
            IndicatorIDs.REAL_DEMAND_NATIONAL, start_date, end_date, "hour"
        )
    
        if demand_mw and demand_mw > 0:
            renewable_pct = (total_renewable_mw / demand_mw) * 100
            variable_pct = (variable_renewable_mw / demand_mw) * 100
    
            result["summary"] = {
                "total_renewable_mw": round(total_renewable_mw, 2),
                "variable_renewable_mw": round(variable_renewable_mw, 2),
                "synchronous_renewable_mw": round(total_renewable_mw - variable_renewable_mw, 2),
                "total_demand_mw": round(demand_mw, 2),
                "renewable_percentage": round(renewable_pct, 2),
                "variable_renewable_percentage": round(variable_pct, 2),
            }
        else:
            result["summary"] = {"error": "Could not calculate percentages: No demand data"}
    
        return result
  • MCP tool registration using @mcp.tool() decorator. Provides user-friendly interface with date and hour parameters, constructs datetime range using DateTimeHelper, instantiates RenewableAnalysisService via ToolExecutor, calls the core handler, and formats response as JSON string.
    @mcp.tool()
    async def get_renewable_summary(date: str, hour: str = "12") -> str:
        """Get renewable energy generation summary at a specific time.
    
        Aggregates wind, solar PV, solar thermal, and hydro generation with
        renewable percentage calculations.
    
        Args:
            date: Date in YYYY-MM-DD format
            hour: Hour in HH format (00-23, default: 12)
    
        Returns:
            JSON string with renewable generation breakdown and percentages.
    
        Examples:
            Get renewable summary at noon:
            >>> await get_renewable_summary("2025-10-08", "12")
    
            Get overnight renewable summary:
            >>> await get_renewable_summary("2025-10-08", "02")
        """
        try:
            start_datetime, end_datetime = DateTimeHelper.build_datetime_range(date, hour)
    
            async with ToolExecutor() as executor:
                use_case = executor.create_get_indicator_data_use_case()
                data_fetcher = DataFetcher(use_case)
                service = RenewableAnalysisService(data_fetcher)
    
                result = await service.get_renewable_summary(start_datetime, end_datetime)
    
            return ResponseFormatter.success(result)
    
        except Exception as e:
            return ResponseFormatter.unexpected_error(e, context="Error getting renewable summary")
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool aggregates data and calculates percentages, but lacks details on data sources, update frequency, error handling, or rate limits. The examples show basic usage but don't cover edge cases or behavioral traits beyond core functionality.

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 purpose, followed by args, returns, and examples. Every sentence adds value: the first defines purpose, the second details aggregation, and the rest provide practical usage information without redundancy.

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 2 parameters with 0% schema coverage and an output schema exists, the description compensates well with parameter semantics and return format explanation. It covers core functionality adequately but lacks details on data freshness, error conditions, or integration with sibling tools, leaving some contextual gaps.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics: 'date' is explained as 'Date in YYYY-MM-DD format' and 'hour' as 'Hour in HH format (00-23, default: 12)', including format details and default value not in the schema. However, it doesn't explain validation rules 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's purpose: 'Get renewable energy generation summary at a specific time' with specific resources (wind, solar PV, solar thermal, hydro) and calculations (renewable percentage). It distinguishes from siblings like 'get_generation_mix' by focusing specifically on renewable sources and percentages, though not explicitly contrasting them.

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 context through examples (e.g., 'at noon', 'overnight') but does not explicitly state when to use this tool versus alternatives like 'get_generation_mix' or 'get_daily_demand_statistics'. No guidance on prerequisites or exclusions is provided.

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