Skip to main content
Glama
freecad-mcp

freecad-mcp

create_object

Creates a new FreeCAD object in a specified document by type and properties, with optional screenshot feedback for visual verification.

Instructions

Create a new object in FreeCAD.

obj_type must name a type registered in FreeCAD's C++ type system, such as "Part::", "PartDesign::" or "Fem::" types. A number of FreeCAD features are implemented in Python rather than C++ and so are not registered types; of those, these are supported here through dedicated factories. They accept the properties listed beside them (required for Draft factories):

Part::Tube        InnerRadius, OuterRadius, Height (optional; defaults 2, 5, 10 mm)
Draft::Circle     Radius
Draft::Rectangle  Length, Height
Draft::Polygon    FacesNumber, Radius
Draft::Wire       Points (list of {x, y, z}), optional Closed

Any other Python-implemented type (Draft::Point, Draft::Ellipse, ...) must be built with execute_code instead.

Note that the Draft factories name objects themselves, so for those the returned object_name will differ from the requested obj_name, which is applied to the object's Label instead. Always use the returned name in later get_object/edit_object calls.

Args: doc_name: The name of the document to create the object in. obj_type: The type of the object to create (e.g. 'Part::Box', 'Part::Cylinder', 'Part::Cut', 'PartDesign::Body', etc.). obj_name: The name of the object to create. obj_properties: The properties of the object to create. include_screenshot: Whether to return a screenshot of the model (default True). Set to False to save tokens when visual feedback is not needed, e.g. for intermediate steps in a longer sequence of changes. view_name: The view orientation of the returned screenshot (default "Isometric"). Pick the view that best shows the change being made.

Returns: A message indicating the success or failure of the object creation and a screenshot of the object.

Examples: If you want to create a cylinder with a height of 30 and a radius of 10, you can use the following data. json { "doc_name": "MyCylinder", "obj_name": "Cylinder", "obj_type": "Part::Cylinder", "obj_properties": { "Height": 30, "Radius": 10, "Placement": { "Base": { "x": 10, "y": 10, "z": 0 }, "Rotation": { "Axis": { "x": 0, "y": 0, "z": 1 }, "Angle": 45 } }, "ViewObject": { "ShapeColor": [0.5, 0.5, 0.5, 1.0] } } }

If you want to cut one solid out of another, create both solids first,
then reference them by name as 'Base' and 'Tool'.
```json
{
    "doc_name": "MyPart",
    "obj_name": "Cut",
    "obj_type": "Part::Cut",
    "obj_properties": {
        "Base": "Box",
        "Tool": "Cylinder"
    }
}
```

If you want to create a pipe with an outer diameter of 250, a 10 wall
and a length of 500, you can use the following data.
```json
{
    "doc_name": "MyPipe",
    "obj_name": "Pipe",
    "obj_type": "Part::Tube",
    "obj_properties": {
        "OuterRadius": 125,
        "InnerRadius": 115,
        "Height": 500
    }
}
```

If you want to create a FEM analysis, you can use the following data.
```json
{
    "doc_name": "MyFEMAnalysis",
    "obj_name": "FemAnalysis",
    "obj_type": "Fem::AnalysisPython"
}
```

If you want to create a FEM constraint, you can use the following data.
```json
{
    "doc_name": "MyFEMAnalysis",
    "obj_name": "FemConstraint",
    "obj_type": "Fem::ConstraintFixed",
    "analysis_name": "FemAnalysis",
    "obj_properties": {
        "References": [
            {
                "object_name": "MyObject",
                "face": "Face1"
            }
        ]
    }
}
```

If you want to create a FEM mechanical material, you can use the following data.
```json
{
    "doc_name": "MyFEMAnalysis",
    "obj_name": "FemMechanicalMaterial",
    "obj_type": "Fem::MaterialCommon",
    "analysis_name": "FemAnalysis",
    "obj_properties": {
        "Material": {
            "Name": "MyMaterial",
            "Density": "7900 kg/m^3",
            "YoungsModulus": "210 GPa",
            "PoissonRatio": "0.3"
        }
    }
}
```

If you want to create a FEM mesh, you can use the following data.
The `Shape` property is required (legacy `Part` is also accepted).
On FreeCAD 1.x the size limits are `CharacteristicLengthMax/Min`;
the legacy `ElementSizeMax/Min` keys are also accepted.
```json
{
    "doc_name": "MyFEMAnalysis",
    "obj_name": "FemMesh",
    "obj_type": "Fem::FemMeshGmsh",
    "analysis_name": "FemAnalysis",
    "obj_properties": {
        "Shape": "MyObject",
        "CharacteristicLengthMax": 10,
        "CharacteristicLengthMin": 0.1
    }
}
```

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": {
      "doc_name": "<doc_name>",
      "obj_type": "<obj_type>",
      "obj_name": "<obj_name>"
    },
    "name": "create_object"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_nameYes
obj_nameYes
obj_typeYes
view_nameNoIsometric
analysis_nameNo
obj_propertiesNo
include_screenshotNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.32

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses real side effects: Draft factories rename objects so the returned object_name differs from obj_name (which goes to the Label), plus token cost of screenshots and legacy-vs-1.x FEM property key aliases. It does not state what happens on duplicate names, whether the document must already exist, or whether creation is atomic on failure.

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 most failure-prone rule (obj_type must be a registered type), and the examples earn their space given polymorphic obj_properties. The Args block partly restates what the examples already demonstrate, and the six JSON examples make it long, but there is little pure filler.

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?

For a 7-parameter, 0%-schema-coverage tool with no output schema, the description is unusually complete, covering naming behavior, return contents, screenshot orientation, and type-specific property requirements. Remaining gaps are analysis_name's undocumented parameter role and the absence of any error/failure semantics beyond "success or failure".

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 description coverage is 0%, so the description must compensate, and it largely does: obj_type semantics are explained in depth, required per-type properties are tabulated for Draft factories, and obj_properties structure (Placement, ViewObject, name references for Part::Cut) is shown by example. However, analysis_name never appears in the Args list and is only inferable from the FEM examples, and obj_properties remains an open-ended map with no guidance on property naming or accepted value formats outside the examples.

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?

Opens with a specific verb+resource ("Create a new object in FreeCAD") and immediately narrows scope by explaining that obj_type must be a registered C++ type, with a named whitelist of supported Python-implemented factories. This clearly separates it from siblings like edit_object, create_document, and execute_code.

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

Usage Guidelines5/5

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

Gives an explicit routing rule to an alternative: unsupported Python types (Draft::Point, Draft::Ellipse) must be built with execute_code instead. It also states a follow-up rule (always use the returned name in later get_object/edit_object calls) and gives conditional guidance for include_screenshot (set False for intermediate steps to save tokens).

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