Skip to main content
Glama

Optics Solid Trace

optics_solid_trace
Read-only

Trace non-sequential rays through solid STL optical parts using refractive index. Simulates light pipes, prisms, and lenses; returns bend angles and exit paths for leakage mapping.

Instructions

NON-SEQUENTIAL ray trace through a real solid (STL mesh) with a refractive index — the lane for molded optical parts (light-pipes, prisms, lenses). Backed by KrakenOS, which is GPL-3.0 and is run ONLY in a subprocess (the parent never imports it — same arm's-length isolation as the GPL Elmer/OpenFOAM binaries). Requires the optics_gpl extra; degrades to {ok:false, reason, install} otherwise.

Geometry: pass a model handle (exported to STL here) OR a ready stl_path. Material: glass (KrakenOS catalog name, e.g. 'BK7') or n_refractive (constant index). rays: [{origin:[x,y,z], dir:[l,m,n]}]; each ray's turn_deg is its input->exit bend (~90 for a TIR corner prism, ~0 for a straight pass). solid: {diameter, thickness, axis_move} placement. wavelength_um default 0.55. want_paths (default False): also return each valid ray's polyline as paths — the per-surface hit points [[x,y,z], ...] in the traced frame. The LAST point of each path is the ray's EXIT LOCATION on the solid, so the spatial exit/leakage map a diffuser needs can be reconstructed from it.

Returns the degradation dict, or {ok, backend:'KrakenOS (subprocess-isolated, GPL-3.0)', n_launched, n_valid, valid_fraction, mean_turn_deg, max_turn_deg, rays:[{valid, exit_dir, turn_deg}], stl_path, paths?:[[[x,y,z],...],...]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raysYes
glassNo
modelNo
solidNo
stl_pathNo
want_pathsNo
n_refractiveNo
wavelength_umNo

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?

Beyond readOnlyHint=true, it discloses a non-obvious execution model: KrakenOS is GPL-3.0 and runs only in a subprocess with 'arm's-length isolation.' It also warns about the `optics_gpl` extra and the degradation path {ok:false, reason, install}, plus the `want_paths` exit-point semantics, all of which materially shape how an agent should call and interpret the tool.

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 tightly organized into labeled topics (purpose, licensing/install, geometry, material, rays, solid, paths, return shape), with the core purpose front-loaded. Each sentence carries necessary operational or behavioral information, and the field-by-field style is scannable rather than bloated.

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 tool with 8 parameters, no output schema, and a nontrivial backend, this description supplies all the missing semantics: install requirements, degradation behavior, complete output fields, ray/path semantics, and geometry/material selection. The coordinate frame of paths is defined as the 'traced frame,' and return values are fully enumerated, making it complete enough for an agent to call correctly.

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 this description carries the full documentation burden. It explains every parameter: model/stl_path alternatives, glass vs n_refractive, the exact rays array shape, solid placement fields, wavelength default, and want_paths behavior, including how the last path point is the ray's exit location.

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?

Opens with a specific verb-resource pair: 'NON-SEQUENTIAL ray trace through a real solid (STL mesh) with a refractive index.' It names the domain ('molded optical parts') and the backing engine (KrakenOS), and the qualifier 'NON-SEQUENTIAL' plus 'real solid (STL mesh)' clearly distinguishes it from generic ray-tracing siblings like optics_raytrace.

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 frames this as 'the lane for molded optical parts (light-pipes, prisms, lenses)', giving strong intended-context guidance. It does not explicitly name sibling alternatives or state when-not-to-use, so it stops just short of full exclusion guidance.

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