Skip to main content
Glama
BentleySystems

OpenSTAAD MCP Server

Official

Execute Python code

execute_code
Destructive

Execute Python code in a sandbox to automate STAAD.Pro model tasks through the OpenSTAAD API, using pre-connected staad and input_data variables and optional file I/O.

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 injected as the immutable `input_data` variable inside the sandbox. Use this to feed large datasets (e.g. node loads, section properties) into your code without hardcoding them.
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. The ``result`` variable must be formatted as one of: - List-of-lists → written as CSV or single-sheet xlsx: result = [["Node ID", "X", "Y", "Z"], [1, 0.0, 0.0, 0.0], ...] - Dict of sheet dicts → written as multi-sheet xlsx: result = { "Nodes": {"columns": ["Node ID", "X", "Y", "Z"], "rows": [[1, 0.0, 0.0, 0.0], ...]}, "Members": {"columns": ["Member ID", "Start", "End"], "rows": [[1, 1, 2], ...]} }

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the `destructiveHint: true` annotation, the description discloses exactly what the sandbox does: it blocks `import`, `dir()`, and `getattr()`, pre-injects `staad`/`input_data`/`json`/`math`, and returns either the last expression value or an explicit `result` assignment. It also reveals file-write behavior, overwrite guard, and local filesystem/path restrictions, which is substantial behavioral context.

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?

The description is well-structured with clear paragraphs (environment, result semantics, file paths, local-path rules) and front-loads the purpose. However, the reminder to call `discover_api` and `read_skills` appears both in the main description and in the `code` parameter description, creating minor redundancy.

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?

For a complex code-execution tool, the description covers the sandbox environment, blocked operations, result return, output file behavior, and path security, and an output schema exists for return values. It does not explicitly warn that API calls through `staad` may mutate the STAAD model or describe failure/timeout behavior, which is a minor gap given the destructive annotation.

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?

All five parameters have rich descriptions in the input schema (100% coverage), so the description does not need to re-describe them. It adds useful context for the `code` and `output_data_path` parameters by explaining the sandbox result mechanism and file-writing behavior, but this is complementary rather than essential because the schema already covers parameter meaning.

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 opening sentence precisely states the action ('Execute Python code in a sandbox against the OpenSTAAD API') and names the concrete resources (`staad`, `input_data`). It is clearly distinguishable from sibling tools like `discover_api`, `read_skills`, `list_instances`, and `get_status`, which are all informational or instance-selection tools rather than execution tools.

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?

The description gives a clear context for use: it instructs the agent to call `discover_api` and `read_skills` first, notes the pre-connected `staad` and `input_data` variables, and explains when to use `output_data_path` to avoid flooding the context window. It does not explicitly state when *not* to use the tool or name an alternative for code execution, so it stops short of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BentleySystems/openstaad-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server