Skip to main content
Glama

run_script

Execute custom Python inside the FreeCAD worker with App, Part, and ObjectsFem in scope, return JSON results via result, and auto-register new shapes for later tool calls.

Instructions

Escape hatch: execute Python in the worker with App/Part/ObjectsFem in scope.

Set __result__ in the script to return a JSON-serializable value.

auto_register (default True): any new shape-bearing object the script creates is automatically registered into the handle table. The result includes a registered list of {handle, name, type} entries so the next tool call (render_view, list_faces, fillet_edges, mass_properties, etc.) can address script-created objects via handle without a separate register_handle round-trip.

Returns {result, registered}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
auto_registerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

No annotations exist, so the description bears the full burden and does well: it discloses the arbitrary-code-execution nature, the scope variables available, the __result__ convention, the auto-registration side effect, and the exact return shape {result, registered}. It omits sandboxing/timeout/error-handling behavior, which is the main residual gap.

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 defining 'Escape hatch' phrase, then the result convention, then the auto_register behavior. Every sentence earns its place, though the explanation of the registered-list rationale is somewhat verbose relative to its weight.

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?

With no output schema, the description correctly spells out the return value, along with the in-scope names and the handle-registration workaround. For a code-execution tool this is nearly complete; only error/failure semantics and any execution limits are unaddressed.

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%, so the description must carry parameter meaning. It fully explains auto_register (default True, side effect, resulting `registered` list), and the `code` parameter's contract is conveyed via 'execute Python' plus the `__result__` convention. Only minor gaps (no typing/format rules for code) remain.

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 (execute Python) plus the exact execution context (in the worker with App/Part/ObjectsFem in scope), and frames it as an 'Escape hatch' to distinguish it from the many dedicated feature tools. An agent immediately knows what it does and why it exists.

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 'Escape hatch' label strongly implies this is the fallback when dedicated tools (fillet_edges, pad, etc.) don't cover the case, and the description explicitly names follow-on tools that consume its output. It lacks an explicit when-not statement, but the positioning as a last resort is clear enough to route correctly.

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

Deploy Server

Other Tools