Skip to main content
Glama
openLCA MCP Server

openLCA MCP Server

by Below280

olcabasic_run

Destructive

Run olcaBASIC programs against openLCA in a stateful session to build models, calculate product systems, query results, and batch-process work, with dry-run validation before execution.

Instructions

Run olcaBASIC code against openLCA, in a session that keeps its state between calls.

  1. One statement per line; names in "double quotes"; blocks end with END .

  2. Explore with FIND, SHOW and CAT; build with BRIDGE, MAKE PROCESS and SYSTEM; analyse with CALCULATE "system" USING "method", then RESULT ... on the result it leaves open, CONTRIBUTION, SENSITIVITY. PARAMETER name = value makes an openLCA parameter (global at the top level, the process's own inside MAKE PROCESS or BRIDGE, the scenario's value inside SCENARIO); LET is a program variable and never writes to openLCA.

  3. The language refuses anything that would build or calculate a wrong model: a background process used without a bridge, an ambiguous or partial name, a changed block run again, a product system that is out of date or failed VALIDATE, a programme rule broken in an EPD. There is no override. Each error gives the line and a hint that says what to type: do that.

  4. A program stops at its first error. dry_run=true checks a program without touching openLCA. Use a FOR loop in one program for batch work.

  5. The reply is JSON: ok, text, data (the structured result of each command, RESULT queries included), errors, warnings. DELETE needs CONFIRM DELETE ON. Commands that ask a person (PARAMETERISE ... ALL, changing a method olcaBASIC did not make, SHUTDOWN SERVER) only run in the olcaBASIC terminal; INPUT runs here only with a DEFAULT, which it takes. Call olcabasic_help first for the command list; olcabasic_help with a topic or a command name gives syntax and examples.

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": {
      "code": "<code>"
    },
    "name": "olcabasic_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesolcaBASIC program text, one statement per line
dry_runNoParse and check the program without touching openLCA

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

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 (destructiveHint=true, idempotentHint=false) by disclosing that the session persists state, that a program halts at its first error with no override, that DELETE requires CONFIRM DELETE ON, that person-prompting commands only run in the terminal, and that the reply is JSON with ok/text/data/errors/warnings. This is the behavioral context an agent needs before issuing a destructive, non-idempotent call.

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-loads the core action in sentence one, then uses a numbered list so each rule is scannable; every item carries distinct information about syntax, errors, or confirmation requirements. It is dense for a tool this complex but not padded, though a few clauses could be trimmed.

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?

There is no output schema, and the description compensates by describing the JSON reply fields explicitly. Combined with error semantics, session persistence, and dry-run behavior, an agent has everything needed to call this destructive tool 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 already 100%, so the baseline is 3, but the description adds real semantics: code is one statement per line with double-quoted names and END-terminated blocks, and dry_run parses and checks without touching openLCA. That meaning is not in the schema text.

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?

States a specific verb and resource — run olcaBASIC code against openLCA — and adds the defining scope detail that the session keeps state between calls. That distinguishes it from olcabasic_help (command discovery) and olcabasic_reset (state clearing) without needing the schemas opened.

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 routes the agent: 'Call olcabasic_help first for the command list', and explains that dry_run=true checks a program without touching openLCA, plus that a FOR loop should be used for batch work. It stops short of naming when to use olcabasic_reset or when not to run code at all, so no explicit exclusions.

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

Deploy Server

Other Tools