Skip to main content
Glama
robobobby
by robobobby

dk_energy_mix

Retrieve real-time Danish electricity production data including wind, solar, conventional sources, and cross-border exchange. Updated every 5 minutes for DK1, DK2, or specific regions.

Instructions

Get the real-time Danish electricity production mix: wind (offshore/onshore), solar, conventional, and cross-border exchange. Updated every 5 minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
areaNoPrice area: DK1 or DK2, or a city/region name. Default: both areas.

Implementation Reference

  • The implementation of the `dk_energy_mix` MCP tool, which fetches real-time Danish electricity production mix data from the Energi Data Service API.
    server.tool(
      "dk_energy_mix",
      "Get the real-time Danish electricity production mix: wind (offshore/onshore), solar, conventional, and cross-border exchange. Updated every 5 minutes.",
      {
        area: z.string().optional().describe("Price area: DK1 or DK2, or a city/region name. Default: both areas."),
      },
      async ({ area }) => {
        const priceArea = area ? resolvePriceArea(area) : null;
        const filter = priceArea ? JSON.stringify({ PriceArea: priceArea }) : undefined;
    
        const data = await fetchDataset("ElectricityProdex5MinRealtime", {
          limit: priceArea ? 1 : 2,
          sort: "Minutes5DK desc",
          filter,
        });
    
        if (!data.records?.length) {
          return { content: [{ type: "text", text: "No production data available." }] };
        }
    
        let output = "# Danish Electricity Production Mix\n\n";
    
        for (const r of data.records) {
          const offshore = r.OffshoreWindPower || 0;
          const onshore = r.OnshoreWindPower || 0;
          const solar = r.SolarPower || 0;
          const smallPlants = r.ProductionLt100MW || 0;
          const largePlants = r.ProductionGe100MW || 0;
          const totalProduction = smallPlants + largePlants;
          const totalRenewable = offshore + onshore + solar;
          const renewableShare = totalProduction > 0 ? (totalRenewable / totalProduction * 100) : 0;
    
          output += `## ${r.PriceArea} β€” ${PRICE_AREAS[r.PriceArea] || r.PriceArea}\n`;
          output += `*${r.Minutes5DK?.replace("T", " ").slice(0, 16)}*\n\n`;
    
          output += `### Production\n`;
          output += `| Source | MW |\n|---|---|\n`;
          output += `| ⚑ Offshore wind | ${offshore.toFixed(1)} |\n`;
          output += `| 🌬️ Onshore wind | ${onshore.toFixed(1)} |\n`;
          output += `| β˜€οΈ Solar | ${solar.toFixed(1)} |\n`;
          output += `| 🏭 Large plants (β‰₯100MW) | ${largePlants.toFixed(1)} |\n`;
          output += `| πŸ”§ Small plants (<100MW) | ${smallPlants.toFixed(1)} |\n`;
          output += `| **Total** | **${totalProduction.toFixed(1)}** |\n`;
          output += `| **Renewable share** | **${renewableShare.toFixed(1)}%** |\n\n`;
    
          // Cross-border exchanges (positive = import, negative = export)
          const exchanges = [
            ["πŸ‡©πŸ‡ͺ Germany", r.ExchangeGermany],
            ["πŸ‡³πŸ‡± Netherlands", r.ExchangeNetherlands],
            ["πŸ‡¬πŸ‡§ Great Britain", r.ExchangeGreatBritain],
            ["πŸ‡³πŸ‡΄ Norway", r.ExchangeNorway],
            ["πŸ‡ΈπŸ‡ͺ Sweden", r.ExchangeSweden],
            ["πŸŒ‰ Great Belt", r.ExchangeGreatBelt],
          ].filter(([, v]) => v != null);
    
          if (exchanges.length) {
            output += `### Cross-border Exchange (MW)\n`;
            output += `| Connection | MW | Direction |\n|---|---|---|\n`;
            for (const [name, mw] of exchanges) {
              const dir = mw > 0 ? "β†’ Import" : mw < 0 ? "← Export" : "β€”";
              output += `| ${name} | ${Math.abs(mw).toFixed(1)} | ${dir} |\n`;
            }
            output += "\n";
          }
        }
    
        output += "*Source: Energi Data Service (Energinet). Real-time 5-minute resolution.*\n";
        return { content: [{ type: "text", text: output }] };
      }
    );

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