Skip to main content
Glama
nx-ai-bridge

nx-ai-bridge

by qiuyekai

run_journal

Compiles and executes arbitrary NX Open C# or VB journals inside NX when no dedicated tool exists, returning Main output, console text, and errors for debugging.

Instructions

ESCAPE HATCH: compile and run arbitrary NX Open code inside NX. Use it when no dedicated tool exists. The code must be a complete journal with a public static/shared Main method (C# class or VB Module). It may return a string from Main; text written to Console is captured too. Compile errors and NX exceptions are returned verbatim so you can fix the code and retry. WARNING: this executes arbitrary code with the user's privileges.

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": "run_journal"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments passed to Main(args).
codeYesComplete journal source code.
languageNoSource language.vb

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so well: it discloses the return channel (a string from Main, plus Console capture), the failure mode (compile errors and NX exceptions returned verbatim), the implied retry loop, and a security warning that code runs with the user's privileges. That is exactly the behavioral context an agent needs before invoking an arbitrary-code-execution tool.

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

Conciseness5/5

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

Front-loads the identity ("ESCAPE HATCH"), then selection rule, then code requirements, then return/error behavior, then the safety warning. Every sentence adds information an agent would otherwise have to discover by trial, and nothing is repeated from the schema or annotations.

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 high-risk, schema-simple tool with no annotations and no output schema, the description covers everything material: when to reach for it, what constitutes valid input, how results and errors come back, and the privilege implications. No significant gap remains for an agent deciding whether and how to call it.

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 description coverage is 100%, so the baseline is 3, but the description adds real meaning by defining what a valid `code` value is: a complete journal with a public static/shared Main method, in a C# class or VB Module. That constraint is behavioral and not fully conveyed by the schema's "Complete journal source code" 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 pair and resource: "compile and run arbitrary NX Open code inside NX." The framing as an "ESCAPE HATCH" immediately distinguishes it from the dedicated modeling siblings like extrude, chamfer, or boolean_unite, which do narrow, typed operations.

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?

Gives an explicit selection rule: "Use it when no dedicated tool exists," which functions as a when-to-use and a when-not-to-use (if a dedicated tool exists, prefer it). It does not enumerate concrete fallback scenarios or a priority order, but the routing condition is clear enough for an agent to act on.

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