Skip to main content
Glama
FreeCAD Tutor MCP
by alex-r-t

execute_script

Run Python scripts inside FreeCAD’s main thread to automate modeling tasks, with optional transaction wrapping so changes can be undone.

Instructions

Execute Python inside FreeCAD's main thread (escape hatch; undoable when wrap_transaction=True).

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": {
      "script": "<script>"
    },
    "name": "execute_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYes
doc_nameNo
wrap_transactionNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations, it discloses main-thread execution and makes undo support conditional on wrap_transaction=True, both operationally important for an arbitrary-code tool. It does not clarify whether every side effect is captured by that transaction or mention blocking and failure behavior, so the disclosure is useful but not comprehensive.

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?

One dense but readable sentence front-loads the action and execution context, then adds fallback and undo semantics. There is no redundant wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The definition is sufficient for a basic invocation, and the output schema removes the need to describe return values. For a powerful general-purpose executor, however, correct selection and use would benefit from explicit fallback guidance, doc_name behavior, and the scope and limits of transaction-based undo.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description usefully establishes that script contains Python and links wrap_transaction to undoability. It gives no semantics for doc_name, such as which document is targeted or what the empty default means, and provides no details about the script execution environment.

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 description pairs a specific verb and resource—"Execute Python"—with the execution context, "inside FreeCAD's main thread." Calling it an "escape hatch" also distinguishes this general scripting route from the many specialized FreeCAD siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Escape hatch" implies that this is a fallback when purpose-built operations are insufficient, providing some selection guidance. It never explicitly says to prefer specialized siblings or identifies cases where scripting should not be used.

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