Skip to main content
Glama
robobobby
by robobobby

dk_electricity_prices

Retrieve Danish electricity spot prices for today and tomorrow, including hourly rates for DK1 and DK2 areas to help manage energy costs.

Instructions

Get current and upcoming Danish electricity spot prices (Elspot). Returns hourly prices for today and tomorrow (when available). Prices include the raw spot price, not taxes/tariffs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
areaNoPrice area: DK1 (western Denmark) or DK2 (eastern Denmark), or a city/region name. Default: both areas.
hoursNoNumber of hours to return (default: 24, max: 168 for a full week)

Implementation Reference

  • The handler function for the 'dk_electricity_prices' tool, which fetches data from the Energi Data Service API and formats it into a text report.
    async ({ area, hours = 24 }) => {
      const priceArea = area ? resolvePriceArea(area) : null;
      const filter = priceArea ? JSON.stringify({ PriceArea: priceArea }) : undefined;
      const limit = priceArea ? hours : hours * 2; // Both areas = 2x rows
    
      const data = await fetchDataset("Elspotprices", {
        limit,
        sort: "HourDK desc",
        filter,
        start: "now-P1D",
      });
    
      if (!data.records?.length) {
        return { content: [{ type: "text", text: "No price data available for the requested period." }] };
      }
    
      // Group by area
      const byArea = {};
      for (const r of data.records) {
        if (!byArea[r.PriceArea]) byArea[r.PriceArea] = [];
        byArea[r.PriceArea].push(r);
      }
    
      let output = "# Danish Electricity Spot Prices\n\n";
      for (const [areaCode, records] of Object.entries(byArea)) {
        output += `## ${areaCode} — ${PRICE_AREAS[areaCode] || areaCode}\n\n`;
    
        // Stats
        const prices = records.map(r => r.SpotPriceDKK).filter(p => p != null);
        if (prices.length) {
          const avg = prices.reduce((a, b) => a + b, 0) / prices.length;
          const min = Math.min(...prices);
          const max = Math.max(...prices);
          output += `**Average:** ${formatPrice(avg)}\n`;
          output += `**Range:** ${formatPrice(min)} — ${formatPrice(max)}\n\n`;
        }
    
        output += "| Time (DK) | Price |\n|---|---|\n";
        for (const r of records.slice(0, 48)) {
          const time = r.HourDK?.replace("T", " ").slice(0, 16) || "?";
          output += `| ${time} | ${formatPrice(r.SpotPriceDKK)} |\n`;
        }
        output += "\n";
      }
    
      output += "*Source: Energi Data Service (Energinet). Prices are spot prices excl. taxes, tariffs, and VAT.*\n";
    
      return { content: [{ type: "text", text: output }] };
    }
  • Registration of the 'dk_electricity_prices' tool within the server instance.
    server.tool(
      "dk_electricity_prices",
      "Get current and upcoming Danish electricity spot prices (Elspot). Returns hourly prices for today and tomorrow (when available). Prices include the raw spot price, not taxes/tariffs.",
      {
        area: z.string().optional().describe("Price area: DK1 (western Denmark) or DK2 (eastern Denmark), or a city/region name. Default: both areas."),
        hours: z.number().optional().describe("Number of hours to return (default: 24, max: 168 for a full week)"),
      },
      async ({ area, hours = 24 }) => {
        const priceArea = area ? resolvePriceArea(area) : null;
        const filter = priceArea ? JSON.stringify({ PriceArea: priceArea }) : undefined;
        const limit = priceArea ? hours : hours * 2; // Both areas = 2x rows
    
        const data = await fetchDataset("Elspotprices", {
          limit,
          sort: "HourDK desc",
          filter,
          start: "now-P1D",
        });
    
        if (!data.records?.length) {
          return { content: [{ type: "text", text: "No price data available for the requested period." }] };
        }
    
        // Group by area
        const byArea = {};
        for (const r of data.records) {
          if (!byArea[r.PriceArea]) byArea[r.PriceArea] = [];
          byArea[r.PriceArea].push(r);
        }
    
        let output = "# Danish Electricity Spot Prices\n\n";
        for (const [areaCode, records] of Object.entries(byArea)) {
          output += `## ${areaCode} — ${PRICE_AREAS[areaCode] || areaCode}\n\n`;
    
          // Stats
          const prices = records.map(r => r.SpotPriceDKK).filter(p => p != null);
          if (prices.length) {
            const avg = prices.reduce((a, b) => a + b, 0) / prices.length;
            const min = Math.min(...prices);
            const max = Math.max(...prices);
            output += `**Average:** ${formatPrice(avg)}\n`;
            output += `**Range:** ${formatPrice(min)} — ${formatPrice(max)}\n\n`;
          }
    
          output += "| Time (DK) | Price |\n|---|---|\n";
          for (const r of records.slice(0, 48)) {
            const time = r.HourDK?.replace("T", " ").slice(0, 16) || "?";
            output += `| ${time} | ${formatPrice(r.SpotPriceDKK)} |\n`;
          }
          output += "\n";
        }
    
        output += "*Source: Energi Data Service (Energinet). Prices are spot prices excl. taxes, tariffs, and VAT.*\n";
    
        return { content: [{ type: "text", text: output }] };
      }
    );
  • Input schema definition for the 'dk_electricity_prices' tool using Zod.
    {
      area: z.string().optional().describe("Price area: DK1 (western Denmark) or DK2 (eastern Denmark), or a city/region name. Default: both areas."),
      hours: z.number().optional().describe("Number of hours to return (default: 24, max: 168 for a full week)"),
    },
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 of behavioral disclosure. It effectively describes key behavioral traits: the tool returns data (not modifies), specifies temporal scope ('today and tomorrow when available'), clarifies content ('raw spot price, not taxes/tariffs'), and mentions availability constraints ('when available'). It doesn't address rate limits, authentication needs, or error conditions, but provides substantial operational context.

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 efficiently structured in two sentences that front-load the core purpose and progressively add important qualifications. Every phrase adds value: the first sentence establishes what the tool does, the second clarifies temporal scope and content limitations. There's no wasted text or redundancy.

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?

For a read-only data retrieval tool with no output schema, the description provides good contextual completeness. It covers what data is returned (electricity spot prices), temporal scope (today/tomorrow hourly), content specifics (raw prices only), and availability conditions. It doesn't describe the return format structure, but given the tool's relative simplicity and the absence of an output schema, this is a minor gap.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing complete parameter documentation. The description doesn't add any parameter-specific information beyond what's in the schema (area and hours parameters are fully described there). According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even without parameter details in the description.

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 ('Get current and upcoming Danish electricity spot prices'), identifies the resource ('Elspot'), and distinguishes it from siblings by focusing on electricity prices rather than weather, address, or company data. It specifies the scope ('hourly prices for today and tomorrow') and clarifies what's included ('raw spot price, not taxes/tariffs').

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 mentioning 'current and upcoming' prices and 'today and tomorrow', but doesn't explicitly state when to use this tool versus alternatives like 'dk_cheapest_hours' or 'dk_energy_mix'. No explicit exclusions or prerequisites are provided, leaving usage guidance at an implied level.

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/robobobby/mcp-nordic'

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