Skip to main content
Glama
trippborstel-hub

northwood-carbon MCP server

gap_to_target

Compute the emissions gap between a portfolio's current trajectory and its SBTi-aligned reduction target, returning a verdict on whether it is on track.

Instructions

Compute gap between current trajectory and SBTi-aligned reduction target.

Uses latest forecasted annual total and compares against the pro-rated linear pathway from base year to target year.

Args: portco: Portco slug or name. target_year: Year to evaluate against (default 2030).

Returns: Dict with: current_tco2e, target_tco2e, gap_tco2e, gap_pct, on_track (bool), verdict (short string).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portcoYes
target_yearNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the gap_to_target tool. Computes gap between current trajectory and SBTi-aligned reduction target for a portfolio company.
    @mcp.tool()
    def gap_to_target(portco: str, target_year: int = 2030) -> dict[str, Any]:
        """
        Compute gap between current trajectory and SBTi-aligned reduction target.
    
        Uses latest forecasted annual total and compares against the pro-rated linear
        pathway from base year to target year.
    
        Args:
            portco:      Portco slug or name.
            target_year: Year to evaluate against (default 2030).
    
        Returns:
            Dict with: current_tco2e, target_tco2e, gap_tco2e, gap_pct, on_track (bool),
            verdict (short string).
        """
        slug = _resolve_portco(portco)
        traj = TRAJECTORY[slug]
        p = PORTCOS[slug]
    
        # Latest full year of data (actual + forecast)
        totals = _year_totals(slug)
        latest_year = max(int(y) for y in totals)
        current = totals[str(latest_year)]["total"]
    
        base_total = traj["baseYearTotal"]
        target = traj["target2030"]
        gap = current - target
        gap_pct = (gap / target) * 100 if target else 0
    
        on_track = current <= base_total * (
            1 - (p["targetReduction"] / 100)
            * (latest_year - p["baseYear"]) / (p["targetYear"] - p["baseYear"])
        )
    
        if on_track:
            verdict = f"On pace. Latest-year emissions ({current:,.0f} tCO2e) are within the linear pathway."
        elif gap_pct < 15:
            verdict = f"Close — {gap_pct:.1f}% above target. Achievable with planned initiatives."
        else:
            verdict = f"Materially off-track — {gap_pct:.1f}% above {target_year} target. Needs additional levers."
    
        return {
            "portco": p["name"],
            "base_year": p["baseYear"],
            "base_year_total_tco2e": base_total,
            "latest_year": latest_year,
            "current_tco2e": round(current, 1),
            "target_year": target_year,
            "target_tco2e": target,
            "gap_tco2e": round(gap, 1),
            "gap_pct": round(gap_pct, 1),
            "on_track": bool(on_track),
            "verdict": verdict,
        }
  • server.py:138-138 (registration)
    The tool is registered via the @mcp.tool() decorator on line 138, which makes it available as an MCP tool named 'gap_to_target'.
    @mcp.tool()
  • Input schema: portco (str) and target_year (int, default 2030). Return type dict[str, Any] with documented fields.
    def gap_to_target(portco: str, target_year: int = 2030) -> dict[str, Any]:
        """
        Compute gap between current trajectory and SBTi-aligned reduction target.
    
        Uses latest forecasted annual total and compares against the pro-rated linear
        pathway from base year to target year.
    
        Args:
            portco:      Portco slug or name.
            target_year: Year to evaluate against (default 2030).
    
        Returns:
            Dict with: current_tco2e, target_tco2e, gap_tco2e, gap_pct, on_track (bool),
            verdict (short string).
        """
  • Helper function _year_totals used by gap_to_target to sum quarterly emissions by year.
    def _year_totals(slug: str, year: int | None = None) -> dict[str, float]:
        """Sum quarterly emissions for a portco. If year is None, returns all years."""
        traj = TRAJECTORY[slug]["quarters"]
        result: dict[str, dict[str, float]] = {}
        for q in traj:
            y = int(q["q"].split("-")[1])
            if year is not None and y != year:
                continue
            key = str(y)
            result.setdefault(key, {"scope1": 0.0, "scope2": 0.0, "total": 0.0})
            result[key]["scope1"] += q["scope1"]
            result[key]["scope2"] += q["scope2"]
            result[key]["total"] += q["scope1"] + q["scope2"]
        return result
Behavior4/5

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

No annotations exist, so the description fully carries behavioral transparency. It clearly describes the computation, inputs, and return structure, indicating a read-only behavior. However, it does not mention dependencies like forecast data availability.

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 efficient, using three sentences plus an args/returns block. It is front-loaded with the purpose. Could be slightly more structured but remains clear and without redundancy.

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

Completeness5/5

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

Given the tool's simplicity (2 parameters, simple computation), the description covers all necessary aspects: purpose, inputs, and return values. The presence of an output schema complements the description, making it highly complete.

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

Parameters5/5

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

With 0% schema description coverage, the description adds significant meaning: it explains that 'portco' is a slug or name and 'target_year' defaults to 2030, plus lists all return fields. This fully compensates for the schema's lack of descriptions.

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 precisely states the tool computes the gap between the current trajectory and an SBTi-aligned target, specifying the method and inputs. This distinguishes it from siblings like get_portco_emissions or simulate_reduction.

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 explains how the gap is computed but does not explicitly guide when to use this tool over alternatives. Usage context is implied but no exclusion criteria or prerequisites are mentioned.

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/trippborstel-hub/northwood-carbon-mcp'

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