Skip to main content
Glama

freecad_run

Runs Python scripts in headless FreeCAD to create 3D-printable parts and return STL/3MF exports plus measurements.

Instructions

Executa um script Python dentro do FreeCAD headless e devolve exportações + medidas.

O script já tem disponíveis: App (FreeCAD), Part, awcad (helpers) e doc (documento vazio). Vetores: awcad.V(x, y, z) ou App.Vector; eixos awcad.X/Y/Z. Termine com awcad.export(shape, "nome-da-peca") para gerar STL+3MF na pasta de saída; use awcad.measure(shape) só para medir sem exportar. Prints aparecem no retorno. Peça sempre com a base em Z=0 (awcad.on_bed).

Exemplo mínimo: s = awcad.rounded_box(40, 30, 10, r=3, center=True) s = awcad.magnet_cavity(s, at=(10, 0, 10), d=5, h=2, axis=-awcad.Z) s = awcad.chamfer_bottom(s) awcad.export(s, "base-ima")

name: prefixo do arquivo de script salvo em /_scripts para rastreabilidade.

Input Schema

NameRequiredDescriptionDefault
codeYes
nameNomodelo
timeout_sNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden for a code-execution tool. It usefully discloses that execution is headless, that `doc` starts as an empty document, that files land in the output folder, and that prints come back in the response. However it says nothing about failure behavior, whether execution is sandboxed or has filesystem access, or what happens when timeout_s expires — material gaps 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.

Conciseness4/5

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

Purpose is front-loaded, followed by environment facts and a minimal worked example that earns its space by showing the export idiom. The trailing note on `name` reads as an afterthought tacked onto the end rather than integrated with the rest of the parameter guidance.

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?

An output schema exists, so return values need not be spelled out, and the description still flags that exports, measurements, and prints come back. What it omits — timeout semantics and error/partial-failure behavior for a code-execution tool — are the remaining gaps an agent would want before calling it.

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?

Schema description coverage is 0%, so the description must compensate. It explains `code` thoroughly (available bindings, expected final call) and explains `name` as the script filename prefix saved under <output>/_scripts for traceability. `timeout_s` is never mentioned anywhere, leaving one of three parameters entirely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 Python script in headless FreeCAD and return exports plus measurements. The output contract (STL+3MF, measurements, prints) is concrete. It does not differentiate itself from the sibling freecad_run_file, so an agent must infer that this one takes inline code rather than a path.

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 in-context guidance: what is pre-bound in the script scope (App, Part, awcad, doc), and the rule that awcad.export is for exporting while awcad.measure is for measuring without exporting. It also states the placement convention (base at Z=0 via aword.on_bed). It never says when to prefer this over freecad_run_file or freecad_selftest, so no explicit alternatives or exclusions.

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