Skip to main content
Glama

Cast ray

cast_ray
Read-onlyIdempotent

What stands on a path: the bodies a ray hits, nearest first, with distance. An empty result counts only together with n_tested. segments pairs each body's crossings into enter_m/exit_m; null with reason odd_crossings, truncated or max_distance and the unpaired crossings_m. Read-only.

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": {
      "origin": "<origin>",
      "direction": "<direction>",
      "among": "<among>"
    },
    "name": "cast_ray"
  }
}

Input Schema

NameRequiredDescriptionDefault
amongYesThe elements tested; only these can be hit
max_mNoLength of the ray; with it, segments stay null (reason max_distance)
originYes[x,y,z] in m from the project origin
directionYes[x,y,z] in m ({x,y,z} is read the same)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / max_m / description
      Previous value: -"Length of the ray"New value: +"Length of the ray; with it, segments stay null (reason max_distance)"
  2. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed world), so the bar is lower, and the description clears it by disclosing real behavioral traits: results are ordered nearest first, an empty result is only meaningful together with n_tested, and segments can be null for three distinct reasons (odd_crossings, truncated, max_distance) with unpaired crossings_m surfaced. That is genuine context an agent cannot get from the annotations. It stops short of describing cost or performance characteristics.

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 dense sentences with no filler, and the purpose is front-loaded before the result-shape caveats. The phrasing is telegraphic to the point of being hard to parse on first read ('null with reason odd_crossings, truncated or max_distance and the unpaired crossings_m'), which costs a little clarity, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must carry the return-value burden, and it does so for the important cases: hit ordering, distance, the enter_m/exit_m segment pairing, and the three null reasons. It leaves n_tested and crossings_m undefined, which is a real gap for a tool whose empty results must be interpreted carefully. Still largely adequate for a geometrically complex tool.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already carries parameter meaning, which sets the baseline at 3. The description adds only an indirect reference to max_m through the 'max_distance' null reason and does not elaborate on origin, direction, or the among filters. No meaning is added beyond what the schema provides.

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 description states a specific operation on a specific resource: casting a ray and returning the bodies it hits, nearest first, with distance. The opening phrase 'What stands on a path' is oblique, but the rest of the sentence disambiguates it. It does not name or contrast any sibling, so the agent must infer the difference from check_contacts or find_elements on its own.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no prerequisites, and no named alternative. The only usage-adjacent statement is 'Read-only', which the annotations already declare. An agent gets no help deciding between cast_ray and check_contacts for a proximity question, even though the schema hints at that distinction.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources