Skip to main content
Glama

to_openscad

Converts a mesh into an editable parametric OpenSCAD script for simple parts and verifies the generated geometry against the original mesh.

Instructions

Write an editable parametric OpenSCAD script (.scad) for a simple part.

Same parts as to_cadquery: a box/plate base with rectangular pads, holes and bosses along X, Y, or Z (countersink, draft, and chamfer only when the axis is vertical), one radius on the four vertical corners, edge_fillet_r when every edge of the box shares one radius (a through-hole that clears those rounds is cut after the fillet, and a straight boss that clears them is fused after it), fillet_r on every vertical edge of an L-bracket including the inner corner (leg_x, leg_y), through-holes in the foot and the upright of that bracket (base_hole_N_d, leg_hole_N_d), a row, axis-aligned grid, or bolt circle of plain Z through-holes (hole_row_1_n, hole_row_1_pitch, hole_grid_1_nx, hole_circle_1_n, hole_circle_1_r), a straight obround through-slot along Z (slot_1_len, slot_1_w, slot_1_angle), a quarter-torus fillet on a vertical boss or hole (boss_N_fillet, hole_N_rim_r, hole_N_floor_r), a straight extrusion of a 2D outline (straight round bosses on the top face of a Z extrusion are boss_N_d, boss_N_h, boss_N_x, boss_N_y; a vertical countersink on that Z extrusion is hole_N_csk_d and hole_N_csk_angle; vertical corners of that Z extrusion that share one radius are outline_fillet_r), and a small boolean of those extrusions. Parameter names match the CadQuery script (hole_1_d, hole_row_1_n, hole_circle_1_r, slot_1_len, boss_1_h, fillet_r, edge_fillet_r, leg_x, base_hole_1_d, boss_1_fillet, extrude_len, ...). Edit one and render in OpenSCAD. Returns the parameters, whether the openscad CLI verified the script against the mesh, and the measured deviation when it did. Without the openscad program the script is still written and verified is false. Returns an "error" key when the part is outside that vocabulary.

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": {
      "input_path": "<input_path>"
    },
    "name": "to_openscad"
  }
}

Input Schema

NameRequiredDescriptionDefault
tolNo
input_pathYes
output_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

B3.2/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 does well: it discloses the return payload (parameters, CLI verification against the mesh, measured deviation), the graceful degradation path (script still written, verified=false without openscad), and the failure mode (an 'error' key when the part is outside the vocabulary). It does not say whether existing files are overwritten or what 'tol' controls, which are the remaining behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

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

The purpose is front-loaded correctly in sentence one, but the body is a single sprawling run-on that crams dozens of parameter tokens and edge-case rules (countersink only on vertical axes, fillet ordering, obround slots) into one unparseable paragraph. Some of those constraints are load-bearing, but the density and lack of structure make it hard to scan and much of the token list is irrelevant to a three-argument call.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Return values, verification behavior, and the error path are covered, which is what an absent output schema requires. The domain constraints on the part vocabulary are unusually thorough. What is missing is anything about the actual invocation surface (input_path, output_path, tol) for a tool with no annotations and no output schema, which is a meaningful hole in a definition of this complexity.

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

Parameters2/5

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

Schema description coverage is 0% and the tool's three arguments (input_path, tol, output_path) are never mentioned in the description. The long list of terms like hole_row_1_pitch and boss_1_fillet refers to the part vocabulary embedded in the input, not to the callable arguments, so it does not compensate for the undocumented parameters. An agent must guess that input_path is the source CAD file and what output_path/tol default to.

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?

The first sentence gives a specific verb and resource: write an editable parametric OpenSCAD (.scad) script for a simple part. It also relates itself to the sibling to_cadquery by declaring the same part vocabulary, so an agent can tell what it produces versus a CadQuery/FreCAD output. It stops short of a crisp one-line differentiation (why .scad instead of .py), but the resource produced is unambiguous.

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

Usage Guidelines3/5

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

It states 'Same parts as to_cadquery' and 'Edit one and render in OpenSCAD', which implies the domain of applicability, and it discloses that missing the openscad CLI still yields a script. It never says when an agent should choose this over to_cadquery or to_freecad, nor what inputs are prerequisites, leaving the routing decision to inference.

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