Skip to main content
Glama

bounding_box

Measure a FreeCAD shape's axis-aligned bounding box, returning min/max/size/center in mm without modifying the model. Set tight=True for mesh-verified extents.

Instructions

Axis-aligned bounding box (AABB) of a shaped object. All lengths in mm, in world coordinates. This is a measurement — it returns numbers, not a new object, and does not modify the model.

KNOWN QUIRK (issue #284): min/max/size are FreeCAD/OCC's ANALYTIC box, which is an UPPER bound, not the true extent. OCC boxes a trimmed face using its untrimmed carrier surface, so a planar cut through fillets, chamfers, lofts or a sphere can report several mm of material that is not there — a real case had a trim plane at X=-32.0 reported as X=-36.7. Before you conclude a part is the wrong size, check "verified" (and pass tight=True): the analytic box over-estimating a correct part looks exactly like a wrong part.

handle: the object to measure. oriented: if True, also compute the tightest box at any orientation (the oriented bounding box, OBB) and return it under "oriented"; if the build can't compute it, "oriented" is null. Default False. This is about ORIENTATION, not tightness — it comes from the same analytic geometry and inherits the same over-estimate. tight: if True, also tessellate the shape and return the mesh-derived box under "tight" — the trustworthy numbers when the analytic box over-estimates. Opt-in because tessellation is not free (~1.4s on a 200mm plate with 60 filleted holes). Default False. deflection: mesh chord tolerance in mm for tight=True. Default diagonal/2000 (floor 0.001mm); larger is coarser and faster.

Returns a dict: min [x,y,z] mm — lower corner of the analytic AABB (upper bound) max [x,y,z] mm — upper corner of the analytic AABB (upper bound) size [x,y,z] mm — extents (max - min) along X, Y, Z center [x,y,z] mm — AABB center point diagonal float mm — space-diagonal length of the AABB oriented null, or {size:[x,y,z] mm, center:[x,y,z] mm, diagonal: mm} when oriented=True and supported — the minimum-volume box at the shape's best orientation (size is its three edge lengths). verified how far min/max above can be trusted: "exact" — proven tight (the shape's own vertices reach all six faces of the analytic box). "mesh_agrees" — tight=True found no disagreement beyond the mesh tolerance. "unverified" — unproven, the usual verdict on a curved part. Treat min/max/size as an upper bound only, and re-run with tight=True to measure. "over_estimate" — tight=True proved the analytic box overshoots. Use "tight"; min/max/size are wrong-big. tight null unless tight=True, else {min, max, size, center, diagonal, deflection, triangles} measured off the mesh. Accurate to about deflection; the true box lies between "tight" and the analytic box, never outside them. warnings list of strings (empty when there is nothing to say): which face over-estimates and by how many mm, or that an unverified box has not been checked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tightNo
handleYes
orientedNo
deflectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so richly: it discloses the issue #284 analytic-box over-estimation quirk, the ~1.4s tessellation cost of tight=True, the meaning of every `verified` verdict, and the guarantee that the true box lies between tight and analytic. This is exactly the behavioral context annotations would otherwise supply.

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?

Long but front-loaded: purpose and the critical quirk come first, then parameter semantics, then the return dict. Every section is purposeful given the complexity, though the prose is denser than strictly necessary in a few places.

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?

With no output schema and no annotations, the description correctly takes on documenting the full return dict (min/max/size/center/diagonal/oriented/verified/tight/warnings) and the safety/behavior profile. Nothing an agent needs to call or interpret this tool is missing.

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% (no property descriptions), so the description must compensate, and it does: it defines handle, oriented (orientation vs tightness, null on failure), tight (mesh-derived, opt-in cost), and deflection (chord tolerance, default diagonal/2000, floor 0.001mm, larger = coarser/faster). This fully covers all four otherwise-undocumented parameters.

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 specific resource (axis-aligned bounding box of a shaped object) plus units and coordinate frame, and explicitly frames it as a read-only measurement ('returns numbers, not a new object, and does not modify the model'). This distinguishes it from measurement siblings like measure_distance and mass_properties without needing 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 Guidelines4/5

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

Gives clear situational guidance: 'Before you conclude a part is the wrong size, check "verified" (and pass tight=True)' and explains when to opt into the costly tight box. It does not, however, explicitly contrast against sibling tools (e.g. measure_distance) for the same measurement need, so 4 rather than 5.

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