Skip to main content
Glama

Analyze contributions

lca_analyze_contributions

Break down what drives an impact category. Takes exactly one target: assessment_ref (a<N>) analyses a saved assessment's setup, or system_ref (s<N>) analyses a saved system directly, with no prior assessment needed. source must match the target; with system_ref, method and amount shape the solve. Returns a b<N> breakdown ref, a separate object from the a<N> it analyses. Modes: by='process' ranks contributing processes (total_amount = per-process total, loop-corrected); by='flow' ranks substance drivers by amount × CF; by='upstream' walks the supply chain. For composed (bill-of-materials) systems only process via assessment_ref is available; flow, upstream and system_ref return 422. The first call per solve prepares the engine in the background (about 3–5 s); later calls on the same solve reuse it. Rows carry p<N>/f<N> refs for further detail.

Input Schema

TableJSON 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
depthNoUpstream only: maximum depth of the supply-chain walk (1–6).
top_nNoMaximum number of rows to return (default 20).
amountNo`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.
cutoffNoUpstream only: drop nodes contributing less than this fraction of the total impact (0–1, default 0.01).
methodNo`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.
sourceNoWhich kind of target this analysis runs on — set it to match the ref you pass: 'assessment' with `assessment_ref`, 'system' with `system_ref`.
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.
system_refNoSaved-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.
compartmentNoFlow only: filter substances to one environmental compartment (medium) — e.g. 'air', 'water', 'soil'. Case-insensitive substring against the compartment path.
assessment_refNoSaved-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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. 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
  3. 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"
      +]
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the 3–5 s background engine preparation on the first call per solve, the reuse of that engine on later calls, the 422 failure conditions for unsupported mode/target combinations, and the fact that the returned `b<N>` breakdown is a separate object from the analysed `a<N>`. This explains why readOnlyHint=false is correct (a new breakdown artifact is created), so no contradiction arises.

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 the core purpose, then mode-by-mode semantics and constraints in a compact run of sentences; no filler. It is dense and somewhat long for a single paragraph, and the clause clarifying that the `b<N>` result is 'a separate object from the `a<N>` it analyses' is slightly redundant, keeping it below a 5.

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?

With no output schema, the description carries the return-value burden and does so by naming the `b<N>` breakdown ref and the `p<N>`/`f<N>` row refs for follow-up detail. Combined with the error conditions, timing note, and per-mode behavior, an agent has everything needed to invoke it correctly.

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 semantics the schema cannot express: `amount` and `method` only apply with `system_ref` and are ignored with `assessment_ref`, and `source` must match whichever ref is passed. Minor gap: `top_n`, `cutoff` and `depth` are left entirely 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?

The first sentence states a specific verb+resource ('break down what drives an impact category'), and the rest pins down scope precisely: it analyses either a saved assessment (`a<N>`) or a saved system (`s<N>`). An agent can distinguish it from siblings like lca_run_assessment because the description names the exact target refs it consumes and the `b<N>` artifact it produces.

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?

Strong on when/when-not: 'source' must match the target, `system_ref` needs no prior assessment, and composed bill-of-materials systems support only `process` via `assessment_ref` ('flow', 'upstream' and 'system_ref' return 422). It references lca_run_assessment only for the amount/method defaults rather than routing the agent away from or toward the closest siblings such as lca_analyze_sensitivity, so it stops short of full alternative guidance.

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