Skip to main content
Glama

list_indicators

Retrieve metadata for all available electricity indicators from Spain's grid operator, including IDs, names, units, frequencies, and geographic scopes.

Instructions

List all available electricity indicators from REE.

Returns metadata for all 1,967+ available indicators including their IDs, names, units, frequencies, and geographic scopes.

Args: limit: Maximum number of indicators to return (default: all) offset: Number of indicators to skip for pagination (default: 0)

Returns: JSON string with list of indicator metadata.

Examples: Get first 50 indicators: >>> await list_indicators(limit=50, offset=0)

Get all indicators: >>> await list_indicators()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • MCP tool handler for 'list_indicators'. Registers the tool via @mcp.tool() decorator, executes ListIndicatorsUseCase, and formats the JSON response.
    @mcp.tool() async def list_indicators(limit: int | None = None, offset: int = 0) -> str: """List all available electricity indicators from REE. Returns metadata for all 1,967+ available indicators including their IDs, names, units, frequencies, and geographic scopes. Args: limit: Maximum number of indicators to return (default: all) offset: Number of indicators to skip for pagination (default: 0) Returns: JSON string with list of indicator metadata. Examples: Get first 50 indicators: >>> await list_indicators(limit=50, offset=0) Get all indicators: >>> await list_indicators() """ try: async with ToolExecutor() as executor: use_case = executor.create_list_indicators_use_case() indicators = await use_case.execute(limit=limit, offset=offset) result = { "count": len(indicators), "indicators": [ind.model_dump() for ind in indicators], } return ResponseFormatter.success(result, ensure_ascii=False) except Exception as e: return ResponseFormatter.unexpected_error(e, context="Error listing indicators")
  • Core implementation logic in ListIndicatorsUseCase. Fetches indicators from repository and maps to DTOs.
    class ListIndicatorsUseCase: """Use case for listing all available indicators. Attributes: repository: Indicator repository implementation """ def __init__(self, repository: IndicatorRepository) -> None: """Initialize use case. Args: repository: Indicator repository """ self.repository = repository async def execute( self, limit: int | None = None, offset: int = 0 ) -> list[IndicatorMetadataResponse]: """Execute the use case. Args: limit: Maximum number of indicators to return offset: Number of indicators to skip Returns: List of indicator metadata. """ indicators = await self.repository.list_all_indicators(limit=limit, offset=offset) return [ IndicatorMetadataResponse( id=int(ind.id), name=ind.name, short_name=ind.short_name, description=ind.description, unit=ind.unit.value, frequency=ind.frequency, geo_scope=ind.geo_scope.value, ) for ind in indicators ]
  • Factory method in ToolExecutor to create the ListIndicatorsUseCase instance with injected repository.
    def create_list_indicators_use_case(self) -> ListIndicatorsUseCase: """Create a ListIndicatorsUseCase instance. Returns: Configured use case instance """ return ListIndicatorsUseCase(self.repository)
  • Tool registration decorator @mcp.tool() that registers 'list_indicators' with FastMCP server.
    @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