Skip to main content
Glama
BentleySystems

OpenSTAAD MCP Server

Official

Execute Python code

execute_code
Destructive

Run sandboxed Python against the OpenSTAAD API to automate STAAD.Pro tasks, extract model data, or set properties, with optional CSV/Excel input and output.

Instructions

Execute Python code in a sandbox against the OpenSTAAD API (don't forget to call discover_api and read_skills for API guidance).

The sandbox provides pre-connected staad (the OpenSTAAD root object) and input_data (if input_data_path is provided) variables (plus json and math modules). import statements, dir(), getattr(), ... are BLOCKED.

The last expression value or an explicit result = ... assignment is returned as the result. If output_data_path is provided, the sandbox will write the result to the specified file.

Paths must be on the user LOCAL filesystem and inside MCP roots or configured allowed_dirs. On Claude Desktop, users can configure allowed directories in the extension settings and Claude can use the filesystem copy_file_to_claude tool to move files to Claude's filesystem.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython source code to execute. Use the pre-injected ``staad`` variable to interact with the API. (don't forget to call discover_api and read_skills for API guidance)
instanceNoAlias (from ``list_instances``, e.g. ``staadPro1``) of the STAAD instance to target. If omitted, last opened instance is selected.
overwriteNoAllow overwriting an existing output file.
input_data_pathNoPath on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file. Its content is parsed and injected as ``input_data`` inside the sandbox. Use this to feed large datasets (e.g. node loads, section properties) into your code without hardcoding them. The shape is determined by the extension: - CSV -> list of row lists. When a header is detected, it is the first row: columns = input_data[0] for row in input_data[1:]: print(row) - XLSX -> dict mapping every sheet to ``columns`` and ``rows`` lists: sheet = input_data["Sheet1"] columns = sheet["columns"] for row in sheet["rows"]: print(row) The containers are mutable for normal Python compatibility, but are fresh for each execution; mutations do not change the source file or persist across executions.
output_data_pathNoPath on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file where to write the ``result`` value. Use this to avoid flooding the context window with large amount of data. **Units rule:** every column holding a physical quantity MUST carry its unit inside the header cell as ``Name [unit]`` (e.g. ``"Fx [kN]"``, ``"UY [mm]"``). Never emit a separate units row — the first row is the header and any row below it is data, so a units row is read back as a record and turns the whole column into text. Take the unit string from ``Output.GetOutputUnitFor*`` and convert the value into it first (every result getter returns base units). Leave ID/count/dimensionless columns unbracketed. Keep file headers plain single-line text — no ``<br>`` or newlines (that variant is for chat tables only). Put model-level context (model name, base unit system, load cases, date) on a separate ``"Info"`` sheet, never as banner rows above the header. The ``result`` variable must be formatted as one of: - List-of-lists → written as CSV or single-sheet xlsx: result = [["Node ID", "X [m]", "Y [m]", "Z [m]"], [1, 0.0, 0.0, 0.0], ...] - Dict of sheet dicts → written as multi-sheet xlsx: result = { "Nodes": {"columns": ["Node ID", "X [m]", "Y [m]", "Z [m]"], "rows": [[1, 0.0, 0.0, 0.0], ...]}, "Reactions": {"columns": ["Node ID", "Load Case", "FX [kN]", "MZ [kN-m]"], "rows": [[1, 1, 12.5, 3.2], ...]} }

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.3.0
    • changedInput schema / properties / input_data_path / description
      Previous value: -"Path on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file. Its content is injected as the immutable `input_data` variable inside the sandbox.\nUse this to feed large datasets (e.g. node loads, section properties) into your code without hardcoding them."New value: +"Path on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file. Its content is parsed and injected as ``input_data`` inside the sandbox.\nUse this to feed large datasets (e.g. node loads, section properties) into your code without hardcoding them.\nThe shape is determined by the extension:\n- CSV -> list of row lists. When a header is detected, it is the first row:\n    columns = input_data[0]\n    for row in input_data[1:]:\n        print(row)\n- XLSX -> dict mapping every sheet to ``columns`` and ``rows`` lists:\n    sheet = input_data[\"Sheet1\"]\n    columns = sheet[\"columns\"]\n    for row in sheet[\"rows\"]:\n        print(row)\nThe containers are mutable for normal Python compatibility, but are fresh for each execution; mutations do not change the source file or persist across executions."
    • changedInput schema / properties / output_data_path / description
      Previous value: -"Path on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file where to write the ``result`` value.\nUse this to avoid flooding the context window with large amount of data. The ``result`` variable must be formatted as one of:\n- List-of-lists → written as CSV or single-sheet xlsx:\n    result = [[\"Node ID\", \"X\", \"Y\", \"Z\"], [1, 0.0, 0.0, 0.0], ...]\n- Dict of sheet dicts → written as multi-sheet xlsx:\n    result = {\n        \"Nodes\": {\"columns\": [\"Node ID\", \"X\", \"Y\", \"Z\"],\n                \"rows\": [[1, 0.0, 0.0, 0.0], ...]},\n        \"Members\": {\"columns\": [\"Member ID\", \"Start\", \"End\"],\n                    \"rows\": [[1, 1, 2], ...]}\n    }"New value: +"Path on user LOCAL filesystem to a ``.csv`` or ``.xlsx`` file where to write the ``result`` value.\nUse this to avoid flooding the context window with large amount of data.\n**Units rule:** every column holding a physical quantity MUST carry its unit inside the header cell as\n``Name [unit]`` (e.g. ``\"Fx [kN]\"``, ``\"UY [mm]\"``).  Never emit a separate units row — the first row is\nthe header and any row below it is data, so a units row is read back as a record and turns the whole\ncolumn into text.  Take the unit string from ``Output.GetOutputUnitFor*`` and convert the value into it\nfirst (every result getter returns base units).  Leave ID/count/dimensionless columns unbracketed.\nKeep file headers plain single-line text — no ``<br>`` or newlines (that variant is for chat tables only).\nPut model-level context (model name, base unit system, load cases, date) on a separate ``\"Info\"`` sheet,\nnever as banner rows above the header.  The ``result`` variable must be formatted as one of:\n- List-of-lists → written as CSV or single-sheet xlsx:\n    result = [[\"Node ID\", \"X [m]\", \"Y [m]\", \"Z [m]\"], [1, 0.0, 0.0, 0.0], ...]\n- Dict of sheet dicts → written as multi-sheet xlsx:\n    result = {\n        \"Nodes\": {\"columns\": [\"Node ID\", \"X [m]\", \"Y [m]\", \"Z [m]\"],\n                \"rows\": [[1, 0.0, 0.0, 0.0], ...]},\n        \"Reactions\": {\"columns\": [\"Node ID\", \"Load Case\", \"FX [kN]\", \"MZ [kN-m]\"],\n                      \"rows\": [[1, 1, 12.5, 3.2], ...]}\n    }"
  2. First observedv1.2.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, openWorldHint=false, idempotentHint=false, so the safety profile is covered. The description adds substantial value beyond annotations: import/dir()/getattr() are BLOCKED, pre-injected variables (staad, input_data, json, math), result return semantics, overwrite behavior via output_data_path, and path locality constraints. It doesn't connect to the annotations directly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very long and dense, especially the output_data_path rules which read like a formatting spec rather than tool guidance. Front-loads the core purpose well but the units/header/sheet rules are excessively verbose for a description field and would be better in a docs resource. Every sentence is useful but the size is disproportionate.

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?

Covers execution environment constraints, injected variables, results handling, output writing, and path locality. Output schema exists, so return shape explanation is optional. Missing: explicit statement that this is destructive (surfaced only via annotations), and what 'against' the API means in practice (does it need a connected instance?).

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

Parameters3/5

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

Schema coverage is 100%, so all five parameters are documented in the schema. The description mentions input_data/output_data_path behavior at a high level but the deep formatting rules (units, header rules, result shapes) are duplicated in the schema descriptions. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Strong verb+resource ('Execute Python code in a sandbox against the OpenSTAAD API'), specific target identified. Not differentiated from siblings in the description, but the sibling names (discover_api, read_skills) are referenced as prerequisites which implicitly distinguishes the role. Loses a point for lacking explicit sibling differentiation.

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 instructs to call discover_api and read_skills for API guidance before/while using this tool. It names the alternative tools to consult. However, it doesn't state when NOT to use this (e.g. versus a direct filesystem or other execution path) and doesn't define conditions or sequencing beyond the reminder.

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