Spec & measure

Give your agent the tools to check its work.

A part from CADGenBench, an external CAD-generation benchmark. 220 × 120 × 45 mm, with ten Ø12 holes, four Ø36 bosses, and more.

A CAD part is only correct if every feature is correct. One hole a millimeter off, one count wrong, and the part is scrap. Coding agents get consistent results because they can run the code and see it fail. CAD agents have had no equivalent.

Real CAD workflows carry a lot of specific detail: exact diameters, hole counts, wall thicknesses, fits. Asking an agent to keep track of them all makes it hard to get consistent results. Agentcad gives agents tools to eliminate these types of errors.

The spec tool lets the agent create structured, programmatic checks. The measure tool reads the real geometry back. Agents use both of these together to perfect designs.

A simple example

Here’s a mounting plate an agent built to a brief: four Ø8 corner bolt holes and a Ø30 center bore. It looks finished.

Except it isn’t. The corner holes are a millimeter under spec. This is invisible to the naked (or agent) eye, and exactly the kind of error that costs a benchmark task.

Step 1: The agent writes the spec first

Before building, the agent writes its requirements into a spec: the definition of done it holds itself to, like a test.

# spec.json: the agent writes this first, from the brief (like a test)
{
  "diameter_tolerance_mm": 0.2,
  "features": [
    { "name": "corner_bolt_holes", "diameter_mm": 8.0,  "count": 4 },
    { "name": "center_bore",       "diameter_mm": 30.0, "count": 1 }
  ]
}

Step 2: Measure reads what actually got built

After building, the agent points measure at the model and it reports the geometry as data, right alongside the visuals agentcad already renders for it. And there it is, Ø7 where the spec wanted Ø8.

$ agentcad measure plate.step --cylinders-only

{
  "dimensions": { "x": 120.0, "y": 80.0, "z": 10.0 },
  "cylindrical_features": [
    { "diameter_mm": 7.0,  "count": 4, "axis": "+z" },   # Ø7: the spec called for Ø8
    { "diameter_mm": 30.0, "count": 1, "axis": "+z" }    # Ø30 center bore: correct
  ]
}

Step 3: Check-spec compares the two

check-spec measures the model and compares it against the spec. Because Ø7 is outside tolerance from Ø8, it doesn’t quietly accept the nearest hole. It reports the required feature as missing.

FAILcheck-spec · first build
corner_bolt_holesØ8 ×4 required, no matching feature found (nearest is Ø7)
center_boreØ30 ×1: match

Step 4: The agent fixes it and re-checks

A failed check is an instruction, not a dead end. The agent corrects the hole diameter, rebuilds, and runs the same check again.

PASScheck-spec · after the fix
corner_bolt_holesØ8 ×4: match (error 0.0 mm)
center_boreØ30 ×1: match (error 0.0 mm)
specbuildmeasurecheck-specrevisepass ✓

The agent closed the loop on its own, before ever reporting the part as done.

What measure reads

measure is a measured feature inventory: it reports the geometry that’s actually there, not the design intent behind it.

Supported today

  • Overall dimensions and bounding box
  • Cylindrical features: hole & boss diameters, counts, axis
  • Planar faces grouped by orientation
  • Volume, surface area, center of mass
  • Face & edge counts, validity

Try it yourself

Agentcad is open source under Apache-2.0 and ships on PyPI:

pip install agentcad[mcp]
agentcad check-spec part.step spec.json
agentcad measure part.step

Humans can review the same pass/fail in the browser with agentcad view --spec spec.json.

Sign up for updates

New releases and agent-facing features. We’ll send a confirmation link before adding you.