Skip to main content
Glama

get_demand_summary

Retrieve electricity demand summary for specific dates including real demand, forecasts, and maximum/minimum values from Spain's grid operator data.

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

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the get_demand_summary tool. It fetches real demand data for the given date using the underlying get_indicator_data use case and formats a summary JSON response.
    @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")
  • The @mcp.tool() decorator registers the get_demand_summary function as an MCP tool.
    @mcp.tool()

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