Skip to main content
Glama
ESJavadex

REE MCP Server

by ESJavadex

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it's a read-only operation (implied by 'List'), returns metadata (not actual data), supports pagination via limit/offset, and mentions the total count ('1,967+ available indicators'). It doesn't cover rate limits or authentication needs, but given the context, this is sufficient for a read operation.

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 appropriately sized and front-loaded: the first sentence states the purpose, followed by key details (metadata, parameters, returns, examples). Every sentence earns its place by providing necessary information without redundancy, and the structure (purpose → details → examples) is logical and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple list operation), no annotations, and the presence of an output schema (implied by 'Returns: JSON string'), the description is complete. It covers purpose, parameters, behavior, and examples, leaving output details to the schema. No gaps exist for this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 fully. It does so by clearly explaining both parameters: 'limit' as 'Maximum number of indicators to return (default: all)' and 'offset' as 'Number of indicators to skip for pagination (default: 0)'. This adds essential meaning beyond the bare schema, including defaults and usage context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('List all available electricity indicators from REE') and resource ('electricity indicators'), distinguishing it from siblings like 'get_indicator_data' (which fetches data for a specific indicator) and 'search_indicators' (which filters indicators). It explicitly mentions the scope ('all 1,967+ available indicators') and what metadata is returned.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('List all available electricity indicators') and implies alternatives through sibling tools (e.g., use 'search_indicators' for filtering or 'get_indicator_data' for specific indicator data). The examples further clarify usage for pagination vs. retrieving all indicators.

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