Skip to main content
Glama

Analyze contributions

lca_analyze_contributions

Break down what drives an impact category. ref is a<N> (analyses a saved assessment's setup) or s<N> (analyses a saved system directly, with no prior assessment needed; method and amount then shape the solve). Returns a b<N> breakdown ref, a separate object from the a<N> it analyses. Modes: by='process' ranks contributors: on an assembly each row is a member with its upstream; otherwise each row is one process's own direct contribution, its supply chain is in its suppliers' rows, and the rows sum to the total; by='flow' ranks substance drivers by amount × CF; by='upstream' walks the supply chain, a process with its upstream. For composed (bill-of-materials) systems only process via an a<N> is available, read from the assessment's saved breakdown with no new calculation; flow, upstream and an s<N> return 422. Otherwise the first call per solve prepares the engine (about 3–5 s); later calls on the same solve reuse it. Rows carry p<N>/f<N> refs for further detail.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "workspace": "<workspace>",
      "ref": "<ref>"
    },
    "name": "lca_analyze_contributions"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoHow to break down the result: rank contributing processes, rank substance flows, or walk the upstream supply-chain tree. Composed (bill-of-materials) systems support process only.process
refYes`a<N>` — analyse that saved assessment's setup (its system, method and functional unit); `s<N>` — analyse the saved system directly, with NO prior assessment (`method` / `amount` apply only here). List current ones with `lca_get(kind='assessments')` / `lca_get(kind='systems')` — never pass UUIDs.
depthNoUpstream only: maximum depth of the supply-chain walk (1–6).
top_nNoMaximum number of rows to return (default 20).
amountNo`s<N>` only: how many of the system's DECLARED functional units to analyse (N). The solve scales by N x the declared amount, the same way `lca_run_assessment` does. Omit to analyse at the system's declared functional unit (N=1); an explicit value overrides. Ignored with an `a<N>`, which inherits its functional unit — and ignores `amount` entirely — from the saved assessment.
cutoffNoUpstream only: drop nodes contributing less than this fraction of the total impact (0–1, default 0.01).
methodNo`s<N>` only: preferred LCIA method — fuzzy-matched (substring) against the methods in the connected database; free text is accepted. Defaults to the same house preference `lca_run_assessment` uses. Ignored with an `a<N>`, which inherits its method from the saved assessment.
categoryNoImpact category to break down. Defaults to the first category of the method.
directionNoFlow only: which exchange direction to keep — 'input' = substances taken from the environment (resources, land, water intake); 'output' = released to it (emissions like CO₂ to air); 'both' (the default) applies no filter. Most categories are dominated by one direction anyway; narrow mainly for net-balance categories like water consumption, where withdrawals (input) and returns (output) carry opposite signs and would otherwise both rank as top 'drivers' while largely cancelling.both
workspaceYesName of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace. The connection's default is often an empty sandbox rather than the user's work.
compartmentNoFlow only: filter substances to one environmental compartment (medium) — e.g. 'air', 'water', 'soil'. Case-insensitive substring against the compartment path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"`system_ref` only: how many of the system's DECLARED functional units to analyse (N). The solve scales by N x the declared amount, the same way `lca_run_assessment` does. Omit to analyse at the system's declared functional unit (N=1); an explicit value overrides. Ignored with `assessment_ref`, which inherits its functional unit — and ignores `amount` entirely — from the saved assessment."New value: +"`s<N>` only: how many of the system's DECLARED functional units to analyse (N). The solve scales by N x the declared amount, the same way `lca_run_assessment` does. Omit to analyse at the system's declared functional unit (N=1); an explicit value overrides. Ignored with an `a<N>`, which inherits its functional unit — and ignores `amount` entirely — from the saved assessment."
    • removedInput schema / properties / assessment_ref
      Removed value: -{
      -  "description": "Saved-assessment ref in the form `a<N>` (e.g. `a3`) — analyse the setup this assessment captured (its system, method and functional unit). Mutually exclusive with `system_ref`. List current assessments with `lca_get(kind='assessments')` to pick the right one — never pass UUIDs.",
      -  "pattern": "^a\\d+$",
      -  "type": "string"
      -}
    • changedInput schema / properties / method / description
      Previous value: -"`system_ref` only: preferred LCIA method — fuzzy-matched (substring) against the methods in the connected database; free text is accepted. Defaults to the same house preference `lca_run_assessment` uses. Ignored with `assessment_ref`, which inherits its method from the saved assessment."New value: +"`s<N>` only: preferred LCIA method — fuzzy-matched (substring) against the methods in the connected database; free text is accepted. Defaults to the same house preference `lca_run_assessment` uses. Ignored with an `a<N>`, which inherits its method from the saved assessment."
    • addedInput schema / properties / ref
      Added value: +{
      +  "description": "`a<N>` — analyse that saved assessment's setup (its system, method and functional unit); `s<N>` — analyse the saved system directly, with NO prior assessment (`method` / `amount` apply only here). List current ones with `lca_get(kind='assessments')` / `lca_get(kind='systems')` — never pass UUIDs.",
      +  "pattern": "^[as]\\d+$",
      +  "type": "string"
      +}
    • removedInput schema / properties / source
      Removed value: -{
      -  "description": "Which kind of target this analysis runs on — set it to match the ref you pass: 'assessment' with `assessment_ref`, 'system' with `system_ref`.",
      -  "enum": [
      -    "assessment",
      -    "system"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / system_ref
      Removed value: -{
      -  "description": "Saved-system ref in the form `s<N>` (e.g. `s1`) — analyse this system directly, with NO prior assessment. Mutually exclusive with `assessment_ref`. List current systems with `lca_get(kind='systems')` — never pass UUIDs.",
      -  "pattern": "^s\\d+$",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "workspace"
      -]New value: +[
      +  "workspace",
      +  "ref"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / workspace / description
      Previous value: -"Name of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace."New value: +"Name of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace. The connection's default is often an empty sandbox rather than the user's work."
  3. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
  4. Changed2 schema fields changed
    • addedInput schema / properties / workspace
      Added value: +{
      +  "description": "Name of the workspace to work in, as `lca_get(kind='workspaces')` lists it (backticks optional). Named on every call: several conversations can share one connection, and each names its own workspace.",
      +  "maxLength": 255,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "workspace"
      +]
  5. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations declare non-readOnly, non-destructive and non-idempotent, and the description goes beyond them with the 3–5 s first-call engine preparation, reuse on later calls to the same solve, the 422 error surface, and the returned `b<N>` object being separate from the analysed `a<N>`. It does not cover permissions, cost of failure, or whether cached solves expire.

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?

Front-loaded with purpose, then ref semantics, modes, and constraints — nothing is genuinely extraneous given the tool's branching behavior. It is dense and heavily semicolon-claused, making the mode-to-parameter mapping harder to scan than it needs to be.

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?

For an 11-parameter compute tool with no output schema, it still covers return shape (`b<N>`, row refs `p<N>`/`f<N>`), latency and caching, and error cases. An agent has enough to pick a ref, a mode, and anticipate the response.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter behavior the schema only partly states: `method`/`amount` apply only to `s<N>`, are ignored with an `a<N>`, and `amount` overrides the declared functional unit. The mode-specific applicability of `depth`, `cutoff`, `direction` and `compartment` is largely left to the schema.

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?

Opens with a specific verb+resource: "Break down what drives an impact category." It then names the exact ref families it operates on (`a<N>` assessments vs `s<N>` systems) and the breakdown ref it returns, which separates it cleanly from siblings like lca_run_assessment and lca_analyze_sensitivity.

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?

Explicitly states when each ref form applies (`a<N>` vs `s<N>` with no prior assessment) and when each mode is valid (`by='process'|'flow'|'upstream'`), including the exclusion that composed BOM systems support only `process` via `a<N>` while `flow`, `upstream` and `s<N>` return 422. It also routes the agent to `lca_get(kind='assessments'|'systems')` to obtain refs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources