Skip to main content
Glama
trippborstel-hub

northwood-carbon MCP server

get_portco_emissions

Retrieve Scope 1 and Scope 2 carbon emissions for a portfolio company by slug or name. Optionally filter by year or scope to get specific emission totals in tCO2e.

Instructions

Get Scope 1 and Scope 2 emissions for a specific portfolio company.

Args: portco: Portco slug (e.g. 'meridian') or name substring (e.g. 'Meridian'). year: Optional. Restrict to a single year (e.g. 2024). If omitted, returns totals for every available year. scope: Optional. 1 or 2 to filter to a single scope. If omitted, returns both.

Returns: Dict with portco metadata and an 'emissions' map of {year: {scope1, scope2, total}} in tCO2e. Values are tonnes CO2-equivalent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portcoYes
yearNo
scopeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `get_portco_emissions` function is a FastMCP tool that retrieves Scope 1 and Scope 2 emissions for a specific portfolio company. It accepts `portco` (slug or name), optional `year`, and optional `scope` (1 or 2) parameters. It resolves the portco slug via `_resolve_portco`, computes yearly emissions via `_year_totals` (summing quarterly data), optionally filters by scope, and returns a dict with portco metadata, base year/target totals, and the emissions map in tCO2e.
    @mcp.tool()
    def get_portco_emissions(
        portco: str, year: int | None = None, scope: int | None = None
    ) -> dict[str, Any]:
        """
        Get Scope 1 and Scope 2 emissions for a specific portfolio company.
    
        Args:
            portco: Portco slug (e.g. 'meridian') or name substring (e.g. 'Meridian').
            year:   Optional. Restrict to a single year (e.g. 2024). If omitted,
                    returns totals for every available year.
            scope:  Optional. 1 or 2 to filter to a single scope. If omitted, returns both.
    
        Returns:
            Dict with portco metadata and an 'emissions' map of {year: {scope1, scope2, total}}
            in tCO2e. Values are tonnes CO2-equivalent.
        """
        slug = _resolve_portco(portco)
        p = PORTCOS[slug]
        totals = _year_totals(slug, year)
    
        if scope in (1, 2):
            key = f"scope{scope}"
            totals = {y: {key: v[key]} for y, v in totals.items()}
    
        return {
            "portco": p["name"],
            "slug": slug,
            "sector": p["sector"],
            "base_year": p["baseYear"],
            "base_year_total_tco2e": TRAJECTORY[slug]["baseYearTotal"],
            "target_2030_tco2e": TRAJECTORY[slug]["target2030"],
            "emissions": totals,
            "units": "tCO2e",
        }
  • server.py:72-72 (registration)
    The `@mcp.tool()` decorator on line 72 (and implicitly for all tool functions) registers `get_portco_emissions` with the FastMCP server under the name 'northwood-carbon'.
    @mcp.tool()
  • The `_year_totals` helper function sums quarterly emissions from the TRAJECTORY data for a given portco slug. It aggregates scope1, scope2, and total per year, and optionally filters to a specific year. This is used by `get_portco_emissions` to compute per-year emissions.
    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
  • The `_resolve_portco` helper resolves a portco identifier (slug or name substring, case-insensitive) to its canonical slug key in the PORTCOS dictionary. Raises ValueError if no match found.
    def _resolve_portco(portco: str) -> str:
        """Match portco by slug or name (case-insensitive). Raises on miss."""
        key = portco.strip().lower()
        if key in PORTCOS:
            return key
        for slug, p in PORTCOS.items():
            if p["name"].lower().startswith(key) or key in p["name"].lower():
                return slug
        raise ValueError(
            f"Unknown portco '{portco}'. Known slugs: {', '.join(PORTCOS.keys())}"
        )
  • server.py:9-9 (registration)
    Comment listing `get_portco_emissions` as one of the available tools in the module docstring.
    - get_portco_emissions     — scope 1/2 emissions for a portco, optionally by year
Behavior5/5

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

Despite no annotations, the description fully discloses input behavior (slugs vs name substrings, optional year/scope filtering) and output shape (dict with emissions map in tCO2e). It implies read-only access, which is appropriate for a 'get' tool.

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 well-structured with Args and Returns sections, providing clear information without excessive verbosity. It could be slightly more terse, but the structure aids readability.

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 simple get tool with an output schema, the description covers all parameters and return format. It does not mention error handling or authentication, but these are not critical for completeness given the tool's straightforward nature.

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?

Given 0% schema description coverage, the description adds crucial meaning: portco can be a slug or name substring, year restricts to a single year, and scope filters to 1 or 2. This far exceeds what the schema (just titles and types) provides.

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 tool gets Scope 1 and 2 emissions for a portfolio company, with a specific verb and resource. It distinguishes itself from sibling tools like list_portcos or simulate_reduction, which serve different purposes.

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?

The description explains the tool's purpose and parameter options, but does not explicitly state when to use it over siblings. However, the narrow scope makes usage clear without needing exclusion clauses.

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