Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Geometry Make Part

geometry_make_part

Build a 3D part from a declarative JSON spec and export STEP, GLB, STL or BREP with exact volume, surface area and bounding-box metrics.

Instructions

Build a 3D part from a declarative JSON spec (nothing is executed) and write STEP, optionally GLB, STL and BREP, with exact volume, surface area, bounding-box size and optional mass. Needs the optional cad engine (uv sync --extra cad). The spec is a JSON object with "params" (name: expression, optional) and "features" (a list, at most 200). Every number is a unit string such as "25 mm" or "90 deg"; bare numbers are rejected. "$name" uses an earlier param; an expression may use + - * / ( ) and one plain power of at most 6, e.g. "($L - 2 mm) / 2", at most 200 characters. Features run in order on one solid; the first must be a body with mode "add". Each feature has "op" and an optional "name" (letters, digits, _ and -). Types: L = unit string like "25 mm" or "1.5 in"; V2 = list [L, L]; V3 = list [L, L, L]; POINTS = list of at least 3 V2; A = angle like "90 deg" or "1.57 rad"; AXIS = "+x" "-x" "+y" "-y" "+z" "-z"; MODE = "add" | "cut" | "intersect"; PLANE = "xy" | "xz" | "yz" (sketch axes u, v = x, y | x, z | y, z; normal +z | +y | +x); UV = "u" | "v"; DEPTH = L or "thru"; ENTRIES = list of V3; CBORE = {"diameter": L, "depth": L}; CSINK = {"diameter": L, "angle": A} (included angle); TEXT = short text; SEL = edge selector; FSEL = face selector; INT = whole number; NAME = an earlier feature's name; PATH = file path; SEGS = list of {"to": V2} (line) | {"to": V2, "radius": L, "turn": "left"|"right"="left"} (arc, shorter way; left = counter-clockwise) | {"to": V2, "via": V2} (arc through via); the last to = start. * = required. Ops:

  • box (body): size* V3, at V3=origin, mode MODE="add". Block; at is its minimum corner.

  • cylinder (body): diameter* L, height* L, at V3=origin, axis AXIS="+z", mode MODE="add". Round bar from its base centre at, rising along axis.

  • sphere (body): diameter* L, at V3=origin, mode MODE="add". Ball; at is its centre.

  • cone (body): diameter* L, top_diameter* L, height* L, at V3=origin, axis AXIS="+z", mode MODE="add". Cone or frustum from its base centre at, rising along axis; top_diameter 0 mm makes a point.

  • extrude (body): plane PLANE="xy", offset L=0 mm, profile* PROFILE, distance* L, taper A, mode MODE="add". Extrude a 2D profile along the plane normal; a negative distance reverses it; taper (0 to 45 deg) narrows the walls along the extrusion.

  • import (body): file* PATH, at V3=origin, mode MODE="add". The one solid of a STEP, IGES or BREP file (read in mm), moved by at.

  • revolve (body): plane PLANE="xy", offset L=0 mm, profile* PROFILE, axis UV="v", angle A=360 deg, mode MODE="add". Turn a profile about the plane's u or v axis through its origin; keep the profile on one side of it.

  • hole (modifier): at* ENTRIES, axis AXIS="-z", diameter* L, depth DEPTH="thru", counterbore CBORE, countersink CSINK, thread TEXT, fit TEXT. Drill at each entry point along axis; depth counts from the entry; thread and fit are text callouts only.

  • pattern (modifier): of* NAME, count* INT, step V3, angle A, center V3=origin, axis AXIS="+z". Repeat an earlier body or hole feature (rather than computing copies or rotated outlines by hand) to count instances in all, the original included: linear by step, or polar about axis through center over angle (360 deg = evenly round, less = first to last).

  • mirror (modifier): plane* PLANE, offset L=0 mm, of NAME. Reflect in a plane (xy: z = offset, xz: y = offset, yz: x = offset) and add it: the whole part so far, or only the feature of.

  • shell (modifier): faces* FSEL, thickness* L. Hollow the solid: remove the selected faces, walls grow inward.

  • fillet (modifier): edges* SEL, radius* L. Round the selected edges.

  • chamfer (modifier): edges* SEL, distance* L. Bevel the selected edges symmetrically. Profiles: {"rect": {size* V2, at V2=[0 mm, 0 mm], centered BOOL=false}} | {"circle": {diameter* L, at V2=[0 mm, 0 mm]}} | {"polygon": {points* POINTS}} | {"slot": {length* L, width* L, at V2=[0 mm, 0 mm], angle A=0 deg}} | {"path": {start* V2, segments* SEGS}} (a rect's at is its minimum corner unless centered). Edge selectors join terms with &: all |x |y |z >x y z <z convex concave line circle. |x = straight edges along x; >x = edges in the +x face of the part's bounding box; convex and concave = outside and inside corners (a cylinder seam is neither). Face selectors (shell): all >x y z <z plane cylinder; >z = the top face. Both accept of:NAME = what the earlier body, hole, pattern or mirror NAME created, e.g. "of:boss & circle". Both union up to 8 groups with lowercase ' or '; & binds tighter; no parentheses. Divide by plain numbers ("$L / 4"), not by lengths. Example: {"params":{"L":"100 mm","W":"50 mm","T":"20 mm","d":"10 mm"},"features":[{"op":"box","name":"body","size":["$L","$W","$T"]},{"op":"hole","name":"bore","at":[["$L / 4","$W / 2","$T"]],"axis":"-z","diameter":"$d","depth":"thru","fit":"H7"},{"op":"fillet","name":"corners","edges":"|z & convex","radius":"2 mm"}]} Errors: input.invalid has details.pointer (e.g. /features/2/diameter) and details.allowed; geometry.empty_selection and geometry.build_failed name the failing feature_index. Also writes .features.json (declared holes, bound to the STEP by sha256) and spec.json.

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": {
      "spec": "<spec>"
    },
    "name": "geometry_make_part"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoProduct name in the STEP file and stem of the output files: 1 to 64 letters, digits, '_' or '-'part
specYesPart spec as a JSON string, at most 64 kB: {params, features}. The grammar and an example are in the tool description
densityNoOptional material density with unit, e.g. '2700 kg/m^3'; adds 'mass'. Empty = no mass
formatsNoComma list of files besides the STEP: 'glb' (one colour: geometry_view colours it and writes a PNG), 'stl', 'brep'. Empty = STEP onlystep
output_unitNoLength unit of the results, e.g. 'mm', 'cm', 'inch'mm
mesh_deflectionNoChord error of the GLB/STL tessellation, 0.001 mm to 100 mm, e.g. '0.01 mm'0.01 mm

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so well: it discloses that nothing is executed, which files get written (including the side-effect <name>.features.json and spec.json bound by sha256), hard limits (200 features, 64 kB spec, 200-char expressions, taper 0-45 deg), and named error codes with details.pointer/allowed and failing feature_index.

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?

It is long, but the length is driven by a genuinely large declarative grammar, and the layout is disciplined: purpose first, then spec shape, types, ops, profiles, selectors, an example, and errors. Some of this is reference-manual material that could live in a linked doc, so it falls short of model conciseness, but each block is load-bearing.

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 tool of this complexity the description is complete: it defines the full input language, units policy, limits, failure modes, and side-effect files, and an output schema exists so return-value shape needn't be re-explained. An agent could author a valid multi-feature spec from this alone.

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%, so the baseline is 3, but the description supplies the entire grammar for the most important and most opaque parameter, 'spec' — value types, unit-string requirement, expression rules, feature ordering, and a worked example that the schema explicitly defers to. The remaining parameters (name, density, formats, output_unit, mesh_deflection) are only restated from the schema, keeping it below a 5.

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?

The opening sentence names a specific verb and resource — build a 3D part from a declarative JSON spec — and enumerates the concrete artifacts produced (STEP, optional GLB/STL/BREP, volume, surface area, bbox, mass). This is unmistakably distinct from geometry_convert, geometry_measure, geometry_view, and geometry_check_dfm, so an agent can select it without opening the schema.

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?

The definition gives a prerequisite ('Needs the optional cad engine (uv sync --extra cad)') and heavy guidance on how to author the spec, but never states when to reach for this tool versus a sibling (e.g. use geometry_convert to change an existing file's format, geometry_check_dfm to validate). Usage is implied by the purpose rather than explicitly scoped.

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