catalog_nearest
Finds the nearest stocked standard part for a requested standard and size, returning available lengths and deltas so you can adjust designs to real parts.
Instructions
Snap a desired standard part to the nearest one that actually exists.
This is the call that changes how you design. Ask for an ISO 4762 M4×13 and it tells you that 12 and 16 are stocked and 13 is not — which turns "I need a 13 mm screw" into "I need to adjust my stack-up to 12 or 16". Use it the moment a fastener length falls out of a dimension chain, before the geometry hardens around a size nobody sells.
standard: a product standard or alias ("ISO 4762", "DIN 912", "ISO 7380-1"). size: thread designation, nominal mm, or shaft/bore mm. length: the wanted length in mm. Omit it for a product with no length dimension (a nut, a washer, a circlip), or to list the whole stocked ladder. grade: optional property class / material, used to complete the designation the call hands back.
Exact arithmetic on a DISCRETE ladder: nothing is interpolated, and nothing is silently rounded on your behalf. A length between two rungs is not a part, so you get both rungs and the signed deltas and you decide which way to move.
Returns {ok, standard, name, size, requested_length, exact, stocked, below, above,
nearest [{length, delta}], lengths, grades, designation, reason, fidelity,
captured, market}. designation is the canonical designation of the RECOMMENDED
part, so the answer is directly usable in a BOM. ok=True means what you asked for
is already stocked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | ||
| grade | No | ||
| length | No | ||
| standard | Yes |