Skip to main content
Glama

measure_distance

Calculates the minimum distance in millimeters between two FreeCAD entities or sub-shapes, returning closest points and touch status to verify gaps and clearances.

Instructions

Minimum distance between two entities, in mm. The workhorse measurement tool: lets a blind agent verify gaps, clearances, and contact.

Args: a: handle of the first object. b: handle of the second object. a_ref: optional sub-shape selector on a to measure FROM instead of the whole solid -- an f_* face tag, an e_* edge tag, or a literal "FaceN"/"EdgeN" (1-based). Omit to use the whole shape. b_ref: optional sub-shape selector on b (same forms as a_ref).

Measures the minimum (closest-approach) distance, so distance_mm = 0 means the two entities touch or interpenetrate. This does NOT report overlap volume -- use min_clearance / interference_check for penetration depth.

Returns a dict (no handle; this is a measurement): distance_mm: float -- minimum gap in mm (0.0 when touching/intersecting). point_on_a: [x, y, z] mm -- closest point on a (or its sub-shape). point_on_b: [x, y, z] mm -- closest point on b (or its sub-shape). touching: bool -- True when distance_mm < 1e-7.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes
a_refNo
b_refNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/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 it well: it defines the degenerate case (distance_mm = 0 means touch/interpenetrate), gives the exact touching threshold (1e-7), states the tool is non-mutating/no handle returned, and openly declares what it does not compute.

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-loads the essential scope in the first sentence and organizes the rest into Args/Returns blocks with no wasted content. The docstring-style layout is slightly verbose for a 4-parameter tool, but every line carries information.

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?

Covers everything an agent needs despite no output schema and no annotations: argument forms, measurement semantics, edge cases, and a full returns breakdown (distance_mm, point_on_a, point_on_b, touching) so the caller knows exactly what comes back.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and does: it defines a and b as object handles, and a_ref/b_ref as optional sub-shape selectors with concrete accepted forms (f_* face tag, e_* edge tag, literal 'FaceN'/'EdgeN', 1-based) plus the default behavior when omitted.

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?

States a precise verb+resource (minimum distance between two entities) with units (mm) and even names the quantity type (closest-approach vs overlap). It distinguishes itself from measurement siblings like min_clearance and interference_check within the same paragraph.

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?

Explicitly tells the agent when to use it ('verify gaps, clearances, and contact') and when not to ('This does NOT report overlap volume -- use min_clearance / interference_check for penetration depth'). The alternative tool is named with the condition that selects it.

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