Skip to main content
Glama

read_vmf_nearest_surface

Finds the nearest solid surface to a point in a .vmf, returning the exact distance, closest point, and owning brush and face for clearance and trace checks.

Instructions

The nearest solid surface to a point in a .vmf, exactly -- distance, the point on the surface, and which brush and face it belongs to. Exact rather than sampled: the closest point on a convex brush is the closest over its faces, and on a face it is either the foot of the perpendicular or a point on an edge. A sampled version would report a clearance that changes when the sample step does.

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": {
      "path": "<path>",
      "at": "<at>"
    },
    "name": "read_vmf_nearest_surface"
  }
}

Input Schema

NameRequiredDescriptionDefault
atYesA point in Hammer units, [x, y, z].
maskNoWhat counts as an obstacle. `sight` sees through clip brushes, `player` does not, `solid` is the world as vbsp builds it. The difference between 'can they see the door' and 'can they reach it'.solid
pathYes
ownersNo
radiusNoHow far to look. Nothing within it reports null rather than the nearest anyway.

Output Schema

NameRequiredDescriptionDefault
pathYes
notesYes
radiusYes
nearestYes
excludedYes
brushCountYes
insideSolidYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.24-alpha

TDQS

A3.6/5.0
Behavior4/5

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

Annotations are effectively empty (title only), so the description carries the burden and does reasonable work: it discloses the exactness guarantee, the algorithm by which the closest point is found, and implicitly the deterministic nature of the result. It omits cost/performance characteristics of walking every brush in range and any note on failure behavior for a malformed or missing .vmf.

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?

Three sentences, front-loaded with the payload, and no filler or repetition. The closing sentence about sampled clearances drifting with sample step is motivation rather than operative information, but it is short and reinforces the exactness claim, so the cost is minor.

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?

An output schema exists, so return values need no restating, and the mask/radius semantics that drive results are covered in schema descriptions. What remains for the description — the exactness guarantee and the definition of the returned point — is present, making it complete enough for a nine-sibling read family.

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

Parameters2/5

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

Schema coverage is 60%: `at`, `mask`, and `radius` are documented in the schema, but `path` and `owners` are undocumented in both places. The description itself adds no parameter meaning beyond the passing phrase 'which brush and face it belongs to', leaving non-compensated gaps for a quarter of the inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource ('nearest solid surface to a point in a .vmf') and enumerates the return payload (distance, closest point, owning brush and face). It clearly separates itself from sampled approximations but never names the sibling tools it overlaps with (measure_vmf_clearance, read_vmf_trace), so differentiation stops at the algorithmic level.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is implied rather than stated: the emphasis on exactness versus sampling tells the agent this is the authoritative query, but there is no explicit when-to-use, when-not-to-use, or pointer to the sibling that measures clearance or traces a ray. The agent must infer the routing from the description's framing.

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