Skip to main content
Glama
ESJavadex

REE MCP Server

by ESJavadex

get_generation_mix_timeline

Retrieve electricity generation breakdown by source over time to visualize energy transition patterns and analyze grid composition.

Instructions

Get generation mix over time for a full day or period.

Returns generation breakdown by source across multiple time points, useful for visualizing energy transition patterns.

Args: date: Date in YYYY-MM-DD format time_granularity: Time aggregation (hour or day, default: hour)

Returns: JSON string with generation mix timeline.

Examples: Get hourly generation mix for a day: >>> await get_generation_mix_timeline("2025-10-08", "hour")

Get daily generation mix for a month:
>>> await get_generation_mix_timeline("2025-10-01", "day")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
time_granularityNohour

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration and handler entrypoint for get_generation_mix_timeline. Decorated with @mcp.tool(), parses input, instantiates GenerationMixService, calls its method, and formats response.
    @mcp.tool()
  • Core handler logic in GenerationMixService.get_generation_mix_timeline. Fetches data for multiple generation sources using DataFetcher, aligns timestamps, computes totals per time point, and builds timeline response.
    async def get_generation_mix_timeline(
        self, start_date: str, end_date: str, time_granularity: str = "hour"
    ) -> dict[str, Any]:
        """Get generation mix over a period.
    
        Args:
            start_date: Start datetime in ISO format
            end_date: End datetime in ISO format
            time_granularity: Time aggregation level
    
        Returns:
            Timeline data with generation mix at each point
        """
        sources = IndicatorIDs.get_generation_mix_sources()
        raw_data = await self.data_fetcher.fetch_multiple_indicators(
            sources, start_date, end_date, time_granularity
        )
    
        result: dict[str, Any] = {
            "period": {
                "start": start_date,
                "end": end_date,
                "granularity": time_granularity,
            },
            "timeline": [],
        }
    
        # Build timeline by combining data points
        source_data: dict[str, list[dict[str, Any]]] = {}
        for source_name, response_data in raw_data.items():
            if "error" not in response_data:
                source_data[source_name] = response_data.get("values", [])
            else:
                source_data[source_name] = []
    
        if source_data:
            # Use first source to get timestamps
            first_source_values = next(iter(source_data.values()))
            for i, value_point in enumerate(first_source_values):
                timestamp = value_point["datetime"]
    
                generation_point: dict[str, Any] = {
                    "datetime": timestamp,
                    "sources": {},
                    "total_mw": 0.0,
                }
    
                for source_name, values in source_data.items():
                    if i < len(values):
                        mw_value = values[i]["value"]
                        generation_point["sources"][source_name] = mw_value
                        generation_point["total_mw"] += mw_value
                    else:
                        generation_point["sources"][source_name] = 0.0
    
                generation_point["total_mw"] = round(generation_point["total_mw"], 2)
                result["timeline"].append(generation_point)
    
        return result
Behavior3/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 discloses that the tool returns data 'over time' and as a 'JSON string', which adds behavioral context beyond the input schema. However, it lacks details on rate limits, error handling, authentication needs, or data freshness, which are important for a data-fetching tool.

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

Conciseness4/5

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

The description is well-structured with a clear purpose statement, usage note, parameter explanations, return value, and examples. Each sentence adds value, but it could be slightly more concise by integrating the examples more tightly or reducing redundancy in the parameter explanations.

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 the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is fairly complete. It covers purpose, parameters, return format, and provides examples. The output schema existence means it doesn't need to detail return values, but it could benefit from more behavioral context (e.g., data sources or limitations).

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 meaning by explaining 'date' as 'Date in YYYY-MM-DD format' and 'time_granularity' as 'Time aggregation (hour or day, default: hour)', which clarifies usage beyond the bare schema. Examples further illustrate parameter application, though it doesn't cover all edge cases (e.g., invalid dates).

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 generation mix over time for a full day or period' and 'Returns generation breakdown by source across multiple time points'. It specifies the verb ('get'), resource ('generation mix'), and scope ('over time'), but does not explicitly differentiate it from sibling tools like 'get_generation_mix' (which might be for a single time point).

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., 'useful for visualizing energy transition patterns') and shows how to call it for hourly or daily granularity. However, it does not explicitly state when to use this tool versus alternatives like 'get_generation_mix' or 'get_renewable_summary', nor does it provide exclusions or prerequisites.

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