Skip to main content
Glama

starccm_run_macro

Destructive

Run checked Java macros against an open STAR-CCM+ simulation through a batch client, with source safety checks, output capture, and timeout handling that leaves the server running.

Instructions

Runs a Java macro on the STAR-CCM+ server at localhost: through a batch client. The server, its GUI and the open simulation stay running; on timeout only the batch client is killed.

Before running, the source is checked against patterns. Refused: Java reflection, class loading, System.exit/getenv, Runtime and processes, network and script engines (a reflective read-only macro once crashed a parallel server when it reached unloaded 3D-CAD sketches). Refused unless allow_risky=True: 3D-CAD access, saveState, deleting or clearing objects and data, closing the simulation, running the solver, meshing, and writing files. These checks catch mistakes; they are not a sandbox, and a macro that runs has the user's full rights.

Good practice: call starccm_session_info first; verify every class and method with starccm_api_lookup; write simple macros like the ones STAR-CCM+ records; print results with sim.println(...), and prefix lines with 'MCP|' to get them back in tagged_lines.

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": {
      "port": "<port>"
    },
    "name": "starccm_run_macro"
  }
}

Input Schema

NameRequiredDescriptionDefault
portYesServer port from starccm_session_list
sourceNoFull Java source of the macro: a public class extending StarMacro, with execute()
max_charsNoCharacters of output to return from the end
timeout_sNo
macro_pathNoPath of an existing .java macro (instead of source)
allow_riskyNoAllow operations that save, delete, close, run the solver or touch 3D-CAD. Only after the user agreed to that specific action.
expected_simNoRefuse to run unless this simulation name is the one open on the port (checked against the GUI window title)

Output Schema

NameRequiredDescriptionDefault
resultYes

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?

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds substantial context beyond them: the server, GUI and simulation persist, only the batch client is killed on timeout, and the source is pattern-screened before execution. It is candid about the limits of that screening ('not a sandbox, and a macro that runs has the user's full rights'), which is exactly the sort of risk disclosure an agent needs for a destructive tool.

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 action and the non-obvious persistence detail, then organized into screening rules and good-practice steps. The parenthetical crash anecdote is longer than strictly needed but justifies why the refusals exist, so it mostly earns its place.

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 a destructive, code-executing tool this covers the essential ground: execution model, timeout semantics, pre-flight validation, risk gating, and safety caveats. An output schema exists, and the description still points to the tagged_lines convention, so nothing an agent needs to invoke it correctly is missing.

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 86%, so the baseline is 3. The description goes beyond the schema by explaining the practical effect of allow_risky (save/delete/close/solver/3D-CAD operations) and by mentioning output handling ('prefix lines with MCP| to get them back in tagged_lines'), which ties to max_chars behavior. It does not explain timeout_s tradeoffs or macro_path vs source precedence beyond what the schema states.

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 ('Runs a Java macro on the STAR-CCM+ server at localhost:<port> through a batch client') and immediately clarifies the execution model, which none of the sibling tools share. An agent can tell this apart from starccm_session_info or starccm_api_lookup without opening a 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 prerequisite chain ('call starccm_session_info first; verify every class and method with starccm_api_lookup'), plus when-to-use constraints via the allow_risky gating rules and expected_sim refusal behavior. It also names the preferred alternative style of work (write simple macros like the ones STAR-CCM+ records).

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