Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes
gradeNo
lengthNo
standardYes

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: it states that arithmetic is exact on a discrete ladder with no interpolation, no silent rounding, both rungs plus signed deltas returned, and that ok=True means the request is already stocked. These are precisely the behavioral traits an agent needs and none are in structured fields.

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-loaded with the core behavior and organized into purpose, per-parameter notes, and return semantics. A few sentences are narrative flourish ('This is the call that changes how you design') that cost space without adding invocation-relevant information, but overall it stays tight.

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 4-parameter tool with no output schema and no annotations, the description covers inputs, arithmetic behavior, the full returned field set, the meaning of designation, and the ok flag. An agent has everything needed to call it and interpret the result.

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?

With 0% schema description coverage, the description compensates fully: it defines standard (with two alias examples), size (thread designation, nominal mm, shaft/bore mm), length (omit for no-length products or to list the whole ladder), and grade (optional property class/material used to complete the returned designation). It adds semantics far beyond the bare 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?

States a specific verb and resource: snapping a desired standard part to the nearest one that actually exists, with a concrete example (ISO 4762 M4×13 → 12/16 stocked). This is distinguishable from catalog_search and catalog_check because it is explicitly about resolving to the nearest discrete rung rather than searching a catalog.

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 context for when to call it — the moment a fastener length falls out of a dimension chain, before geometry hardens. It does not explicitly name or exclude alternatives such as catalog_search or catalog_check, so the routing guidance is strong but not complete.

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