Skip to main content
Glama
freecad-mcp

freecad-mcp

freecad_execute_python

Execute arbitrary Python code in FreeCAD to automate CAD tasks and return results through _mcp_result.

Instructions

Execute arbitrary FreeCAD Python code. WARNING: This tool runs arbitrary Python code with full system access. Only use in trusted environments. The code runs in a context with FreeCAD and Part already imported. Set _mcp_result["result"] to return data.

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": "freecad_execute_python"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesPython code to execute in FreeCAD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it discloses the key behavioral facts: arbitrary code execution, full system access, and the pre-imported FreeCAD/Part context. It omits failure behavior, timeouts, and whether state changes persist, which are relevant for an execution tool.

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 sentences, front-loaded with the warning, with no redundant wording. Every sentence carries either purpose, safety, or execution-context information.

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 one-parameter execution tool with no output schema, the description covers purpose, safety, execution environment, and how to return results. An agent has enough to call it correctly, with only minor gaps around error handling.

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 100% for the single code parameter, so the baseline is 3, but the description adds real meaning: the code runs with FreeCAD and Part already imported and must set _mcp_result["result"] to return data. That return contract is valuable information the schema does not convey.

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: executing arbitrary FreeCAD Python code. This is clearly distinguishable from the domain-specific modeling siblings (sketch, arch, assembly tools) as the general-purpose escape hatch.

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 a clear conditional: only use in trusted environments, since it runs arbitrary code with full system access. It does not explicitly point to the purpose-built sibling tools as preferred alternatives for routine modeling, which keeps it from a 5.

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