Skip to main content
Glama
robobobby
by robobobby

dk_co2_emissions

Check real-time CO2 emissions from Danish electricity production to schedule energy-intensive tasks during low-carbon periods. Provides emission intensity data for specific areas with historical tracking.

Instructions

Get real-time CO2 emission intensity of Danish electricity production (g CO2/kWh). Updated every 5 minutes. Useful for timing energy-intensive tasks to low-carbon periods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
areaNoPrice area: DK1 or DK2, or a city/region name. Default: both areas.
hoursNoHours of history to return (default: 1, max: 24)

Implementation Reference

  • The 'dk_co2_emissions' tool handler is registered using 'server.tool'. It fetches CO2 emission data from the Energi Data Service API and formats it into a summary report.
    server.tool(
      "dk_co2_emissions",
      "Get real-time CO2 emission intensity of Danish electricity production (g CO2/kWh). Updated every 5 minutes. Useful for timing energy-intensive tasks to low-carbon periods.",
      {
        area: z.string().optional().describe("Price area: DK1 or DK2, or a city/region name. Default: both areas."),
        hours: z.number().optional().describe("Hours of history to return (default: 1, max: 24)"),
      },
      async ({ area, hours = 1 }) => {
        const priceArea = area ? resolvePriceArea(area) : null;
        const filter = priceArea ? JSON.stringify({ PriceArea: priceArea }) : undefined;
        const limit = Math.min(hours * 12, 288) * (priceArea ? 1 : 2); // 12 readings/hour (5min intervals)
    
        const data = await fetchDataset("CO2Emis", {
          limit,
          sort: "Minutes5DK desc",
          filter,
        });
    
        if (!data.records?.length) {
          return { content: [{ type: "text", text: "No CO2 emission data available." }] };
        }
    
        const byArea = {};
        for (const r of data.records) {
          if (!byArea[r.PriceArea]) byArea[r.PriceArea] = [];
          byArea[r.PriceArea].push(r);
        }
    
        let output = "# Danish CO2 Emission Intensity\n\n";
        for (const [areaCode, records] of Object.entries(byArea)) {
          const latest = records[0];
          const values = records.map(r => r.CO2Emission).filter(v => v != null);
          const avg = values.length ? values.reduce((a, b) => a + b, 0) / values.length : null;
    
          output += `## ${areaCode} — ${PRICE_AREAS[areaCode] || areaCode}\n\n`;
          output += `**Current:** ${latest.CO2Emission} g CO2/kWh (${latest.Minutes5DK?.replace("T", " ").slice(0, 16)})\n`;
          if (avg != null) output += `**Average (last ${hours}h):** ${avg.toFixed(0)} g CO2/kWh\n`;
    
          // Classify
          const co2 = latest.CO2Emission;
          let label = "🟢 Very clean";
          if (co2 > 300) label = "🔴 High emissions";
          else if (co2 > 200) label = "🟡 Moderate";
          else if (co2 > 100) label = "🟢 Clean";
          output += `**Status:** ${label}\n\n`;
        }
    
        output += "*Source: Energi Data Service (Energinet). Real-time 5-minute resolution.*\n";
        return { content: [{ type: "text", text: output }] };
      }
    );
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 'Get'), provides real-time data updated every 5 minutes, and has a temporal scope (history up to 24 hours). It doesn't mention rate limits or authentication needs, but covers the essential 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?

Two sentences with zero waste: the first states purpose and key attributes (real-time, update frequency, unit), the second provides usage guidance. Every element earns its place, and it's front-loaded with the core functionality.

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 tool with 2 parameters, 100% schema coverage, and no output schema, the description is nearly complete. It covers purpose, behavior, and usage context well. The main gap is lack of output format details (what the return data looks like), but otherwise it provides sufficient context for effective use.

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%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (like explaining 'area' options beyond DK1/DK2 or 'hours' constraints). Baseline 3 is appropriate when the schema does the heavy lifting.

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 real-time CO2 emission intensity'), resource ('Danish electricity production'), and unit ('g CO2/kWh'), distinguishing it from sibling tools like dk_electricity_prices or dk_energy_mix by focusing on carbon intensity rather than prices or energy sources.

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?

It explicitly states when to use this tool ('Useful for timing energy-intensive tasks to low-carbon periods'), providing clear context for its application. While it doesn't name specific alternatives, the purpose differentiates it from siblings like dk_cheapest_hours (which might focus on cost rather than emissions).

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