Skip to main content
Glama

part_run_script

Run a Python script in headless FreeCAD to model custom geometry like threads or parametric enclosures that other tools cannot handle.

Instructions

Roda um script Python no FreeCAD headless: a válvula de escape da API completa.

Serve para modelar o que as outras tools não cobrem (roscas, gabinetes paramétricos, peças de jogo). O script já tem no namespace doc (documento novo), OUT_DIR (str) e os módulos FreeCAD (também como App) e Part; qualquer outro (Mesh, Sketcher, PartDesign...) é import seu. Grave o que quiser em OUT_DIR, por exemplo shape.exportStl(OUT_DIR + "/peca.stl"). Retorna stdout, files (novos ou modificados em out_dir) e objects (objetos finais de doc). Erro no script volta como {error} com traceback e stdout. timeout_s vale de 5 a 900 (padrão: MCP_FREECAD_TIMEOUT_S ou 120). ATENÇÃO: o script roda com as permissões do usuário; MCP_FREECAD_ALLOWED_PATHS valida só os argumentos, não isola o script.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
out_dirYes
timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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, the description carries the full burden and does so: it documents the pre-populated namespace (doc, OUT_DIR, FreeCAD/App, Part, imports required for Mesh/Sketcher/PartDesign), the return payload (stdout, files, objects), the failure shape ({error} with traceback and stdout), the timeout range and default, and a security caveat that the script runs with user permissions and is not isolated by MCP_FREECAD_ALLOWED_PATHS.

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 purpose, and every sentence adds operational value (namespace, output, errors, timeout, security). It is dense and parenthetical-heavy, but there is no filler; only minor tightening is possible.

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-complexity arbitrary-code-execution tool with 3 params at 0% schema coverage, the description supplies invocation environment, output handling, error contract, timeout bounds and the critical sandboxing caveat. An output schema exists, yet the extra return-format detail reinforces rather than pads.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does for all three parameters: `script` (what is pre-injected, what must be imported), `out_dir` (exposed as OUT_DIR, output files land there), and `timeout_s` (valid 5–900, defaults to MCP_FREECAD_TIMEOUT_S or 120). Nothing is left undocumented.

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+resource ('Roda um script Python no FreeCAD headless') and immediately frames its niche against the sibling set ('a válvula de escape da API completa', covering what other tools don't: threads, parametric enclosures, game pieces). An agent can tell this apart from doc_inspect/doc_export without opening the schema.

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 clear positive selection criteria — use it for geometry the other tools don't cover, with concrete examples (roscas, gabinetes paramétricos, peças de jogo). No explicit when-not-to-use or named alternative is given, so it stops short of a 5.

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