Skip to main content
Glama

Catalog Nearest

catalog_nearest
Read-only

Find the closest stocked standard part (e.g., fastener) to a requested size or length. When your dimension isn't available, get the nearest options with exact differences to adjust your design and BOM.

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.8/5.0
Behavior5/5

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

Annotations already mark readOnlyHint true and openWorldHint false, but the description adds substantial behavioral detail beyond that: exact arithmetic on a discrete ladder, no interpolation, no silent rounding, both rungs with signed deltas are returned, and ok=True indicates the requested size is stocked. This significantly clarifies what the tool does and does not do.

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 long but every section earns its place: a crisp opening, a motivating example, parameter semantics, behavioral guarantees, and a return-field explanation. The most important concept—snapping to nearest existing part—is front-loaded, and the parameter details are clearly structured.

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, the description is unusually complete. It documents all parameters, optional behavior, the discrete-ladder semantics, and the full return envelope including the meaning of ok and designation. An agent has enough information to invoke it correctly and interpret the result without external knowledge.

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 description coverage is 0%, so the description carries the full burden, and it fully succeeds. It explains each parameter: standard accepts alias names, size accepts thread or nominal mm, length is optional and can be omitted for products without length dimension or to list the full ladder, and grade is an optional property class/material. This is far more meaningful than 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?

The description states a specific verb and resource: 'Snap a desired standard part to the nearest one that actually exists.' It is immediately clear this tool resolves a requested part to real stocked options, and the ISO 4762 M4×13 example makes the behavior concrete. It clearly separates this from general catalog search or validation tools by focusing on nearest-stock resolution.

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?

The description gives explicit usage context: 'Use it the moment a fastener length falls out of a dimension chain, before the geometry hardens around a size nobody sells.' It also explains when to omit length and what that yields. However, it does not explicitly name sibling alternatives or state when not to use this tool in favor of catalog_search or catalog_check, so the exclusion guidance is implied rather than explicit.

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