Skip to main content
Glama

Fit a body to a mesh

fit_mesh
Idempotent

Turn a mesh file (STL, OBJ, glTF or GLB, or the tessellated bodies of a STEP AP242 file) into MBEstudio geometry: outline lofts fitted slice by slice, holes as subtracting lofts, and an envelope that is the mesh's bounding box. Without text and owner: { text, report }, where text is the envelope item and the generated body to paste into a part def. With text and owner: the fit written into that part def as one edit (an earlier generated body and the envelope are replaced), { ok, message, text, ops, errors, replacedBody, replacedEnvelope, report }. The report gives the slicing axis, envelope (mm), loft and point counts, and overlap, the mean intersection over union of fitted and true cross sections (1 is perfect).

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": {
      "file_base64": "<file_base64>",
      "file_name": "<file_name>"
    },
    "name": "fit_mesh"
  }
}

Input Schema

NameRequiredDescriptionDefault
axisNoThe part axis to slice along; auto tries each and keeps the best.
nameNoLoft name prefix (default shell).
textNoA model to write the fit into, with owner.
holesNoKeep holes as cuts (default true).
ownerNoThe part def (qualified or unique name) that gets the body.
unitsNoUnits of the file; auto takes a mesh under 3 units across as metres. glTF and AP242 are metres.
formatNo
originNoPart origin: the bounding box centre (default), or the mesh's own origin for a mesh already in the part frame.
pointsNoMost corners per ring (default 26 or 24).
step_mmNoDistance between slices (default 2.5 mm under 90 mm across, else 3).
file_nameYesThe file's name; its extension gives the format unless format is set.
max_pointsNoBudget of outline points for the body (default 2000); over it the fit coarsens.
file_base64YesThe mesh file, base64.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false, openWorldHint=false), the description discloses the critical side effect: the fit is written into a part def 'as one edit' and an earlier generated body and envelope are replaced, which is exactly the idempotent-rewrite behavior an agent needs to anticipate. It also documents both return shapes, including ok/message/ops/errors plus the report fields (slicing axis, envelope in mm, loft and point counts, overlap/IoU). Nothing here contradicts the annotations — the 'replacement' concerns the tool's own prior output, consistent with destructiveHint=false.

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?

The purpose is front-loaded in the first clause, and the mode-based return contracts are organized in parallel sentences. The brace-laden field enumerations are dense, but they substitute for a missing output schema, so most of the length is earned; a small amount of compression would still be possible.

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 13-parameter tool with no output schema, the description covers purpose, the two invocation modes, the mutation semantics, and the full returned payload including the quality metric. An agent has everything needed to choose a mode and interpret the result without inspecting source or docs.

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

Parameters3/5

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

Schema description coverage is 92%, so the schema already explains axis, units, origin, points, step_mm and the rest; the description largely duplicates this at a high level (holes as subtracting lofts, envelope as bounding box). It adds some interpretation — that overlap is the mean IoU of fitted versus true cross sections, with 1 being perfect — but no per-parameter syntax or format detail beyond the schema.

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 description opens with a specific verb and resource ('Turn a mesh file ... into MBEstudio geometry'), enumerates accepted formats (STL, OBJ, glTF, GLB, STEP AP242 tessellations), and states exactly what geometry is produced (outline lofts, subtracting lofts for holes, bounding-box envelope). An agent can tell this is a mesh-to-solid fitting tool rather than a generic importer or edit tool.

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?

The 'Without text and owner ... With text and owner ...' construction gives clear conditional guidance on the two operating modes and what each returns, which is the key call-shape decision an agent must make. It stops short of naming alternatives (e.g. when to prefer a plain import over a fit) or stating exclusions, so it is clear context without explicit when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources