Skip to main content
Glama
getgapup

@gapup/mcp-knowledge

by getgapup

carbon_footprint_calculator

Read-onlyIdempotent

Calculate a company's GHG footprint under the GHG Protocol (Scope 1+2+3) with ±20% accuracy. Returns emissions breakdown, hotspots, reduction levers with capex and payback, SBTi trajectory, and CSRD reporting readiness.

Instructions

Calculate a company's greenhouse-gas footprint under the GHG Protocol (Scope 1 + 2 + 3, in tCO2eq, tier-2 accuracy ±20%). Returns the emissions breakdown, hotspot identification, 5-8 reduction levers each with capex and payback, an SBTi-aligned reduction trajectory over 5-25 years, the 15 Scope-3 categories in detail, and CSRD/ESRS reporting readiness. When to use this tool: the user needs a carbon assessment for CSRD compliance pre-audit, green-finance access, or supplier ESG scorecards. Inputs: the company profile and its activity data. Delivered by Émilie, the AI Sustainability lead of the Gapup portfolio.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyYes
perimeterYes
scope1SourcesNo
scope2SourcesYes
scope3ActivitiesNo
reductionTargetsNo
focusNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
executiveSummaryYesBoard-ready GHG assessment prose
totalEmissionsTco2eqYesTotal GHG footprint in tCO2eq (Scope 1+2+3 combined, ±20% tier-2 accuracy)
breakdownYesEmissions breakdown by scope
hotspotsYesTop emission sources ranked by contribution
reductionLeversYes5-8 actionable reduction levers with financial analysis
sbtiTrajectoryNoSBTi-aligned annual reduction trajectory
scope3CategoriesNoGHG Protocol 15 Scope-3 categories detail
csrdReadinessYesCSRD/ESRS reporting readiness assessment
kpisNo3-5 headline ESG KPI bubbles

Implementation Reference

  • The handler function that executes the carbon footprint calculator tool logic. It delegates to callGapupEndpoint with the slug 'carbon-footprint-calculator'.
    export async function handle(input: unknown, signal?: AbortSignal): Promise<unknown> {
      return callGapupEndpoint("carbon-footprint-calculator", input, signal);
    }
  • Full tool definition including name, description, inputSchema (company profile, perimeter, scope sources, reduction targets, focus) and outputSchema (executiveSummary, totalEmissionsTco2eq, breakdown, hotspots, reductionLevers, sbtiTrajectory, scope3Categories, csrdReadiness, kpis).
    import { callGapupEndpoint } from "../client.js";
    
    export const tool = {
      name: "carbon_footprint_calculator",
      description:
        "Calculate a company's greenhouse-gas footprint under the GHG Protocol (Scope 1 + 2 + 3, in tCO2eq, tier-2 accuracy ±20%). Returns the emissions breakdown, hotspot identification, 5-8 reduction levers each with capex and payback, an SBTi-aligned reduction trajectory over 5-25 years, the 15 Scope-3 categories in detail, and CSRD/ESRS reporting readiness. When to use this tool: the user needs a carbon assessment for CSRD compliance pre-audit, green-finance access, or supplier ESG scorecards. Inputs: the company profile and its activity data. Delivered by Émilie, the AI Sustainability lead of the Gapup portfolio.",
      inputSchema: {
        type: "object",
        properties: {
          company: {
            type: "object",
            properties: {
              name: { type: "string", minLength: 2, maxLength: 120 },
              sector: { type: "string", minLength: 2, maxLength: 120 },
              fte: { type: "integer", minimum: 1 },
              revenueEur: { type: "number", minimum: 0 },
              locations: { type: "integer", minimum: 1 },
              referenceYear: { type: "integer", minimum: 2018, maximum: 2030 },
            },
            required: ["name", "sector", "fte", "referenceYear"],
          },
          perimeter: {
            type: "object",
            properties: {
              organizational: {
                type: "string",
                enum: ["operational-control", "financial-control", "equity-share"],
              },
              geographic: {
                type: "array",
                items: { type: "string" },
                minItems: 1,
                maxItems: 20,
              },
              excludedActivities: { type: "string", maxLength: 400 },
            },
            required: ["organizational", "geographic"],
          },
          scope1Sources: {
            type: "array",
            items: {
              type: "object",
              properties: {
                source: { type: "string", minLength: 2, maxLength: 120 },
                fuelType: { type: "string", minLength: 2, maxLength: 80 },
                annualConsumption: { type: "number", minimum: 0 },
                unit: { type: "string", maxLength: 40 },
              },
              required: ["source", "fuelType", "annualConsumption", "unit"],
            },
            maxItems: 15,
          },
          scope2Sources: {
            type: "array",
            items: {
              type: "object",
              properties: {
                source: { type: "string", minLength: 2, maxLength: 120 },
                energyType: { type: "string", enum: ["electricity", "heat", "steam", "cooling"] },
                annualConsumptionKWh: { type: "number", minimum: 0 },
                location: { type: "string", minLength: 2, maxLength: 80 },
                isRenewableContract: { type: "boolean" },
              },
              required: ["source", "energyType", "annualConsumptionKWh", "location", "isRenewableContract"],
            },
            minItems: 1,
            maxItems: 20,
          },
          scope3Activities: {
            type: "array",
            items: {
              type: "object",
              properties: {
                category: {
                  type: "string",
                  description: "GHG Protocol Scope 3 category 1-15",
                },
                description: { type: "string", minLength: 10, maxLength: 300 },
                estimatedScale: { type: "string", minLength: 4, maxLength: 120 },
              },
              required: ["category", "description"],
            },
            maxItems: 15,
          },
          reductionTargets: {
            type: "object",
            properties: {
              sbtiAligned: { type: "boolean" },
              targetYear: { type: "integer", minimum: 2025, maximum: 2050 },
              targetReductionPct: { type: "number", minimum: 0, maximum: 100 },
            },
            required: ["sbtiAligned", "targetYear", "targetReductionPct"],
          },
          focus: { type: "string", maxLength: 400 },
        },
        required: ["company", "perimeter", "scope2Sources"],
      },
      outputSchema: {
        type: "object",
        properties: {
          executiveSummary: {
            type: "string",
            description: "Board-ready GHG assessment prose",
          },
          totalEmissionsTco2eq: {
            type: "number",
            description: "Total GHG footprint in tCO2eq (Scope 1+2+3 combined, ±20% tier-2 accuracy)",
          },
          breakdown: {
            type: "object",
            description: "Emissions breakdown by scope",
            properties: {
              scope1Tco2eq: { type: "number" },
              scope2Tco2eq: { type: "number" },
              scope3Tco2eq: { type: "number" },
            },
            required: ["scope1Tco2eq", "scope2Tco2eq", "scope3Tco2eq"],
          },
          hotspots: {
            type: "array",
            description: "Top emission sources ranked by contribution",
            items: {
              type: "object",
              properties: {
                source: { type: "string" },
                scope: { type: "string", enum: ["1", "2", "3"] },
                emissionsTco2eq: { type: "number" },
                shareOfTotal: { type: "number", description: "Percentage of total footprint" },
              },
              required: ["source", "scope", "emissionsTco2eq"],
            },
          },
          reductionLevers: {
            type: "array",
            description: "5-8 actionable reduction levers with financial analysis",
            items: {
              type: "object",
              properties: {
                lever: { type: "string" },
                reductionPotentialTco2eq: { type: "number" },
                capexEur: { type: "number" },
                paybackYears: { type: "number" },
                priority: { type: "string", enum: ["high", "medium", "low"] },
              },
              required: ["lever", "reductionPotentialTco2eq"],
            },
          },
          sbtiTrajectory: {
            type: "array",
            description: "SBTi-aligned annual reduction trajectory",
            items: {
              type: "object",
              properties: {
                year: { type: "integer" },
                targetEmissionsTco2eq: { type: "number" },
                reductionVsBaselinePct: { type: "number" },
              },
              required: ["year", "targetEmissionsTco2eq"],
            },
          },
          scope3Categories: {
            type: "array",
            description: "GHG Protocol 15 Scope-3 categories detail",
            items: {
              type: "object",
              properties: {
                category: { type: "string" },
                categoryNumber: { type: "integer", minimum: 1, maximum: 15 },
                emissionsTco2eq: { type: "number" },
                dataQuality: { type: "string", enum: ["measured", "estimated", "excluded"] },
              },
              required: ["category", "emissionsTco2eq"],
            },
          },
          csrdReadiness: {
            type: "object",
            description: "CSRD/ESRS reporting readiness assessment",
            properties: {
              overallScore: { type: "number", minimum: 0, maximum: 100 },
              gaps: { type: "array", items: { type: "string" } },
              nextSteps: { type: "array", items: { type: "string" } },
            },
            required: ["overallScore"],
          },
          kpis: {
            type: "array",
            description: "3-5 headline ESG KPI bubbles",
            items: {
              type: "object",
              properties: {
                label: { type: "string" },
                value: { type: "string" },
                trend: { type: "string", enum: ["up", "down", "stable"] },
              },
              required: ["label", "value"],
            },
          },
        },
        required: [
          "executiveSummary",
          "totalEmissionsTco2eq",
          "breakdown",
          "hotspots",
          "reductionLevers",
          "csrdReadiness",
        ],
      },
      annotations: {
        readOnlyHint: true,
        idempotentHint: true,
        destructiveHint: false,
        openWorldHint: false,
        title: "Carbon Footprint Calculator (GHG Protocol)",
      },
    } as const;
  • src/index.ts:25-41 (registration)
    Import and registration of the carbon footprint calculator tool in the main server. The tool and handler are imported and added to the TOOLS array used by the MCP server's ListToolsRequestSchema and CallToolRequestSchema handlers.
    import { tool as carbonTool, handle as carbonHandle } from "./tools/carbon-footprint-calculator.js";
    
    type ToolHandle = (input: unknown, signal?: AbortSignal) => Promise<unknown>;
    type ToolDef = {
      name: string;
      description: string;
      inputSchema: object;
      outputSchema?: object;
      annotations?: object;
    };
    
    const TOOLS: Array<{ def: ToolDef; handle: ToolHandle }> = [
      { def: competitorIntelTool, handle: competitorIntelHandle },
      { def: trendWatcherTool, handle: trendWatcherHandle },
      { def: partnershipTool, handle: partnershipHandle },
      { def: pitchDeckTool, handle: pitchDeckHandle },
      { def: carbonTool, handle: carbonHandle },
  • The callGapupEndpoint helper function that makes the HTTP POST request to the Gapup API hub. Handles auth, rate limiting, 402 payment required, and other error responses.
    export async function callGapupEndpoint(
      slug: string,
      input: unknown,
      signal?: AbortSignal
    ): Promise<unknown> {
      const apiKey = process.env.GAPUP_API_KEY;
      if (!apiKey) {
        throw new GapupAuthError(
          "GAPUP_API_KEY environment variable required. Get a free tier key (100 calls/mo) at https://hub.gapup.io/agents-api/onboard"
        );
      }
    
      const res = await fetch(`${HUB_BASE_URL}/api/agent/${slug}`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "X-Api-Key": apiKey,
          "Accept": "application/json",
          "User-Agent": "@gapup/mcp-knowledge/0.1.0",
        },
        body: JSON.stringify(input),
        signal,
      });
    
      if (res.status === 401) {
        throw new GapupAuthError(
          "Invalid or missing GAPUP_API_KEY. Verify your key at https://hub.gapup.io/agents-api/onboard"
        );
      }
    
      if (res.status === 402) {
        const body = await res.text().catch(() => "");
        throw new GapupAuthError(
          `Free tier quota exhausted or paid auth required. Upgrade at https://hub.gapup.io/agents-api (received 402: ${body.slice(0, 120)})`
        );
      }
    
      if (res.status === 404) {
        throw new GapupApiError(
          404,
          `Endpoint '${slug}' not found — check GAPUP_API_BASE_URL or update the package (npm update @gapup/mcp-knowledge)`
        );
      }
    
      if (res.status === 429) {
        const retryAfter = res.headers.get("Retry-After");
        const retryMsg = retryAfter ? ` Retry after ${retryAfter} seconds.` : "";
        const body = await res.text().catch(() => "");
        throw new GapupApiError(
          429,
          `Rate limit exceeded.${retryMsg} Upgrade your plan at https://hub.gapup.io/agents-api (received: ${body.slice(0, 100)})`
        );
      }
    
      if (!res.ok) {
        const body = await res.text().catch(() => "");
        throw new GapupApiError(res.status, body);
      }
    
      return res.json();
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false. Description adds accuracy (±20%), output details, and persona (Émilie). No contradiction, adds moderate extra context.

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?

Description is structured with core function first, usage guidance, inputs, persona. Front-loaded but could be more concise; still efficient.

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?

Output schema exists and description lists major outputs. But optional parameters (reductionTargets, focus) are not explained, and input requirements could be clearer for a complex tool.

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

Parameters2/5

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

Schema description coverage is 0%. Description only says 'company profile and activity data' without detailing any parameter meanings. With 7 complex parameters (nested), more explanation needed.

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?

Description clearly states 'calculate a company's greenhouse-gas footprint under the GHG Protocol' with specific output components (emissions breakdown, reduction levers, SBTi trajectory). Differentiates from unrelated siblings like competitor_intel.

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

Usage Guidelines4/5

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

Explicitly states when to use: 'CSRD compliance pre-audit, green-finance access, or supplier ESG scorecards.' Does not cover when not to use, but context with siblings makes it clear.

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/getgapup/gapup-mcp'

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