Skip to main content
Glama

run_script

Execute custom Python code (rhinoscriptsyntax) inside Rhino to perform modeling operations not covered by dedicated tools; assign a value to result to return it.

Instructions

逃生舱:直接在 Rhino 里执行一段 Python 代码(rhinoscriptsyntax)。

代码里可用变量:rs、Rhino、scriptcontext、doc;把返回值赋给变量 result 会被带回。 常规建模优先用上面的专用工具,这个只用于工具覆盖不到的操作。

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_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses the execution environment (rhinoscriptsyntax), the pre-bound variables (rs, Rhino, scriptcontext, doc), and the convention that assigning to `result` returns a value. It says nothing about whether the script mutates the open document, how errors/exceptions surface, timeouts, or any confirmation/undo semantics — notable omissions for arbitrary code execution.

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?

Three short blocks, front-loaded with the essential framing, then the environment/variables, then the routing rule. No filler sentences; every line adds information the agent needs.

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 an open-ended code-execution tool, the description covers the runtime, available symbols, and the return convention, and an output schema already exists to explain the response shape. The remaining gap is failure/mutation behavior (what happens to the document, how script errors are reported), which the agent would want before invoking.

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% and the single parameter is only typed as a string, so the description must compensate. It does: it tells the agent the code must be rhinoscriptsyntax Python, which globals are in scope, and how to hand a value back via `result` — meaning well beyond the bare schema.

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: execute a snippet of Python (rhinoscriptsyntax) directly inside Rhino. The framing as an 'escape hatch' plus the closing sentence distinguish it from the modeling siblings (add_box, boolean_union, fillet_edges, etc.) without needing their schemas.

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?

Explicit routing in both directions: prefer the dedicated tools for normal modeling, and use this only for operations those tools don't cover. That is a clear when-to-use / when-not-to-use rule rather than implied guidance.

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