Skip to main content
Glama
ESJavadex

REE MCP Server

by ESJavadex

get_demand_summary

Retrieve electricity demand data for a specific date, including real demand, forecast, and maximum/minimum values from Spain's electrical grid.

Instructions

Get a summary of electricity demand for a specific date.

Convenience tool that fetches key demand indicators (real demand, forecast, max/min) for a given date.

Args: date: Date in YYYY-MM-DD format (default: 2025-10-08)

Returns: JSON string with demand summary.

Examples: Get today's demand summary: >>> await get_demand_summary("2025-10-11")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo2025-10-08

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the get_demand_summary MCP tool. It is decorated with @mcp.tool() which registers it automatically with the FastMCP server. The function fetches real demand data for the specified date using the REE indicator API and returns a JSON summary including statistics and unit information.
    @mcp.tool()
    async def get_demand_summary(date: str = "2025-10-08") -> str:
        """Get a summary of electricity demand for a specific date.
    
        Convenience tool that fetches key demand indicators (real demand, forecast,
        max/min) for a given date.
    
        Args:
            date: Date in YYYY-MM-DD format (default: 2025-10-08)
    
        Returns:
            JSON string with demand summary.
    
        Examples:
            Get today's demand summary:
            >>> await get_demand_summary("2025-10-11")
        """
        try:
            start_date, end_date = DateTimeHelper.build_day_range(date)
    
            # Fetch demand data directly
            async with ToolExecutor() as executor:
                use_case = executor.create_get_indicator_data_use_case()
                request = GetIndicatorDataRequest(
                    indicator_id=IndicatorIDs.REAL_DEMAND_PENINSULAR.id,
                    start_date=start_date,
                    end_date=end_date,
                    time_granularity="hour",
                )
                response = await use_case.execute(request)
                demand_data = response.model_dump()
    
            result = {
                "date": date,
                "real_demand": {
                    "statistics": demand_data.get("statistics"),
                    "unit": demand_data["indicator"]["unit"],
                    "values_count": len(demand_data.get("values", [])),
                },
            }
            return ResponseFormatter.success(result)
    
        except Exception as e:
            return ResponseFormatter.unexpected_error(e, context="Error getting demand summary")
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral information. It mentions it 'fetches' data (implies read-only) and returns JSON, but doesn't cover important aspects like rate limits, authentication requirements, error conditions, or whether it's a real-time or cached source. The description doesn't contradict annotations (none exist), but fails to adequately compensate for their absence.

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 appropriately sized: purpose statement first, then context, followed by Args/Returns/Examples sections. Every sentence adds value with no redundancy. The formatting with clear section headers enhances readability without unnecessary verbosity.

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 has an output schema (which handles return value documentation) and only one parameter with good description coverage, the description is reasonably complete. It covers purpose, parameter semantics, and includes examples. The main gap is lack of behavioral context (rate limits, errors, etc.) which would be more important for a production tool.

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?

With 0% schema description coverage (schema only shows type and default), the description adds significant value by explaining the 'date' parameter format (YYYY-MM-DD) and providing a default example. It also includes a practical usage example showing parameter invocation. However, it doesn't explain what happens with invalid dates or edge cases.

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 a summary of electricity demand for a specific date' and specifies key indicators (real demand, forecast, max/min). It distinguishes from siblings by focusing on demand summary rather than volatility, statistics, or other metrics. However, it doesn't explicitly differentiate from 'get_daily_demand_statistics' which might be a close alternative.

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 by calling it a 'Convenience tool' and specifying it's for 'a specific date', but doesn't explicitly state when to use this versus alternatives like 'get_daily_demand_statistics' or 'analyze_demand_volatility'. The examples show basic usage but lack comparative guidance with sibling tools.

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