Skip to main content
Glama

Measure Distance

measure_distance
Read-only

Measure the minimum distance between two objects in millimeters to verify clearance, gaps, or contact. Returns closest points and a touching flag, with 0 mm indicating touching or interpenetrating.

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

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description explains the closest-approach semantics, that 0.0 means touching/intersecting, the touching threshold of 1e-7, and that the return is a dict with no handle. These are meaningful behavioral details that help an agent interpret results and avoid misuse.

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

Conciseness5/5

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

The description is well-structured: a one-line summary, then Args, behavior notes, and a Returns dict. Every sentence adds information, and the most important distinction (closest-approach vs overlap volume) is called out clearly. It is thorough without being bloated.

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 measurement tool with no output schema and no parameter descriptions in the schema, this definition fully covers what an agent needs: parameters, return fields, units, edge cases, and exclusions. There are no critical gaps that would prevent correct invocation or interpretation.

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 carries the full burden of parameter documentation. It explains that a and b are handles, and precisely defines a_ref and b_ref as optional sub-shape selectors with allowed forms (f_* face tags, e_* edge tags, or literal FaceN/EdgeN) and the default behavior when omitted. This far exceeds what the bare input schema provides.

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 states a specific operation: 'Minimum distance between two entities, in mm', with a clear resource (two entities) and the measurement outcome. It also differentiates from siblings by noting this does NOT report overlap volume and explicitly names min_clearance / interference_check for that purpose, so an agent can distinguish it from related measurement tools.

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?

It explicitly says when to use the tool: 'lets a blind agent verify gaps, clearances, and contact.' It also gives an explicit when-not and alternative: 'This does NOT report overlap volume -- use min_clearance / interference_check for penetration depth.' This is clear routing guidance beyond what the schema or annotations provide.

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