Skip to main content
Glama
BIM Viewer MCP Server

BIM Viewer MCP Server

Find the nearest elements to a reference element

find_nearest
Read-onlyIdempotent

Locate the elements physically closest to a reference BIM element by 3D bounding-box distance, optionally filtered by category or level, and return their IDs for highlighting or zooming.

Instructions

Find the elements physically closest to a reference element.

Use this to answer proximity questions (e.g. "what's the nearest transformer to this panel?", "which air terminals are closest to the cooling tower?"), then pass the returned external_ids to highlight_elements or zoom_to. This tool does NOT change the view by itself.

Distance is the true 3D gap between bounding boxes in feet: 0 means the elements overlap or touch, and elements on different floors are correctly far apart.

Examples: - Nearest transformer to a panel: reference_external_id=, category='transformers' - Five closest anything: reference_external_id=, limit=5

Returns: {"reference_external_id": str, "count": int, "elements": [{external_id, asset_type, description, level_name, distance_ft}]} ordered nearest first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reference_external_id": "<reference_external_id>"
    },
    "name": "find_nearest"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoOptional building level to restrict the neighbors to. Omit for all levels.
limitNoHow many of the closest elements to return (1-50).
categoryNoOptional category to restrict the neighbors to (e.g. the nearest transformer). Omit to consider all tracked assets.
reference_external_idYesThe externalId of the element to measure from (e.g. the panel or AHU the question is about). Get it from find_by_category or find_elements first.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description still adds substantive context they cannot express: the distance metric is a true 3D bounding-box gap in feet, 0 means overlap/touch, and cross-floor elements are correctly far apart. That metric definition is exactly the semantics an agent needs to interpret results, not restate annotations.

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 purpose, then usage, then metric semantics, then examples — a clean information hierarchy with no filler sentences. Minor deduction because the Returns block largely duplicates the existing output schema.

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 read-only lookup with one required and three optional parameters, the description covers purpose, trigger conditions, follow-on tools, metric semantics, and result ordering. Nothing an agent needs to select or call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the examples add combinatorial meaning beyond the schema — pairing reference_external_id with category for a targeted lookup and with limit=5 for an unfiltered sweep. The description reinforces where the reference id comes from (find_by_category or find_elements), though it adds nothing on level filtering.

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 ("Find the elements physically closest to a reference element") and immediately bounds the scope by contrasting with view-mutating siblings ("This tool does NOT change the view by itself"), pointing to highlight_elements/zoom_to instead. An agent can distinguish this from find_in_room, find_clearance, or find_extreme without opening any 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 an explicit trigger ("Use this to answer proximity questions") with two illustrative phrasings and a concrete follow-on path (pass external_ids to highlight_elements or zoom_to). It does not contrast with the nearest neighboring alternatives such as find_in_room or find_clearance, so the when-not decision is left partly to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.