Skip to main content
Glama

get_consumption_data

Retrieve hourly energy consumption data for the past 30 days, including time periods, total costs, base energy costs, and consumed kWh.

Instructions

Get the hourly consumption data for the last 30 days, such as time period, total cost, base energy cost, and consumpted kwh.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:49-72 (handler)
    The main handler function for the 'get_consumption_data' tool. It connects to the Tibber API, fetches homes, retrieves consumption data, and returns it as a string. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def get_consumption_data() -> str:
        """Get the hourly consumption data for the last 30 days, such as time period, total cost, base energy cost, and consumpted kwh.
        """
        try:
            tibber_connection = tibber.Tibber(tibber_api_token, user_agent="tibber-mcp")
            await tibber_connection.update_info()
            
            homes = tibber_connection.get_homes()
            if not homes:
                logger.error("No homes found for this Tibber account")
                return "No homes found"
            
            home = homes[0]
            await home.fetch_consumption_data()
    
            await tibber_connection.close_connection()
    
            result = home.hourly_consumption_data
            return str(result)
        
        except Exception as e:
            logger.error(f"Error retrieving price info: {e}")
            return f"Error: {str(e)}"
Behavior2/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 of behavioral disclosure. It describes what data is retrieved (hourly consumption for 30 days, including time period, total cost, base energy cost, and consumed kWh) but lacks details on permissions, rate limits, error handling, or data freshness. For a tool with zero annotation coverage, this is insufficient, warranting a score of 2.

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 a single, efficient sentence that front-loads the core purpose ('Get the hourly consumption data for the last 30 days') and adds specific data points ('such as time period, total cost, base energy cost, and consumpted kwh'). There is no wasted verbiage, though the misspelling 'consumpted' slightly detracts from clarity.

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

Completeness3/5

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

Given the tool's complexity (simple data retrieval), no annotations, no output schema, and 0 parameters, the description is minimally adequate. It explains what data is fetched but lacks details on output format, error cases, or dependencies. Without an output schema, it should ideally describe return values more thoroughly, resulting in a score of 3.

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?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description appropriately does not discuss parameters, focusing instead on the data returned. This aligns with the baseline of 4 for tools with no parameters, as it avoids unnecessary detail.

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 the hourly consumption data for the last 30 days' specifies the verb (Get), resource (consumption data), and temporal scope (last 30 days). It distinguishes from the sibling tool 'get_price_and_home_info' by focusing on consumption metrics rather than pricing or home information. However, it doesn't explicitly contrast with the sibling, keeping it at 4 instead of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions the sibling tool 'get_price_and_home_info' in the context signals, but the description itself does not explain when to choose consumption data over price/home info or any other considerations. This lack of explicit usage context results in a score of 2.

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/punkpeye/tibber-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server