Skip to main content
Glama
EvgenVer

lira-sapr-mcp

by EvgenVer

lira_run_script

Destructive

Run custom Python code inside LIRA-SAPR to cover tasks the dedicated tools do not handle, with direct access to the COM API, model adapter, and constants.

Instructions

Run Python code inside the server with full access to LIRA, for anything the other tools do not cover. Prefer the dedicated tools when one fits.

Names available: lira (LIRA's Application COM object), doc (the document of model, default the active one; None if none is open), adapter (the server's LIRA adapter: read_table(ref, name), write_table(ref, name, rows), units(), node_displacements(path, nodes, cases), element_forces(...), ...), constants (LIRA's enum constants, e.g. constants.kLiraTable_Nodes_Coordinates). Assign result to return a JSON value; print() output is returned as "output". The model file is backed up first. Python code stops after timeout_s; a COM call that hangs (e.g. LIRA shows a dialog) is not interrupted. LIRA's API description: LIRA-FEM COM type library "LiraSapr" (see lira_status capabilities).

Input Schema

NameRequiredDescriptionDefault
codeYes
modelNo
timeout_sNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond openWorldHint/destructiveHint by disclosing that the model file is backed up first (mitigating the destructive hint), that Python stops at timeout_s but a hanging COM call (e.g. an LIRA dialog) is NOT interrupted, and that print() output returns as 'output'. Those are exactly the operational gotchas an agent needs before executing arbitrary code against a live model.

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 and the routing rule, then the bound names, then behavior — good ordering with little filler. Minor friction: the guidance sentence is broken mid-clause by the line wrap and the trailing 'LIRA's API description: ...' line dangles as a pointer rather than actionable information.

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 arbitrary-code tool this is unusually complete: it lists every pre-bound name with signatures (lira, doc, adapter methods, constants), defines the result/output return convention, and covers backup and timeout risk. With an output schema present it correctly does not spend words on return-value structure.

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 0%, so the description carries the load and mostly does: it explains the `model` scoping (doc is the document of `model`, defaults to the active one, None if nothing open) and the `timeout_s` semantics including the non-interruptible COM caveat. It stops short of saying what form a model reference takes (file path vs. name vs. open handle) or what happens on a timeout or exception in `code`.

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 Python code inside the server with full access to LIRA' — and immediately scopes it as the fallback ('for anything the other tools do not cover'). It explicitly contrasts itself against the 38 sibling tools by saying to prefer the dedicated ones when one fits, so an agent can place it without opening the schema.

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?

Gives an explicit selection rule: use this only when no dedicated tool covers the task, otherwise prefer the dedicated tool. That is a when-to-use plus a named alternative class, which is the strongest form of routing guidance available for an escape-hatch tool.

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