Skip to main content
Glama

Optics Raytrace

optics_raytrace
Read-only

Ray-trace light bundles through dielectric optical models to compute efficiency, TIR fractions, and exit angles. Uses rayoptics backend without requiring CAD geometry, returning degradation metrics and hotspot locations.

Instructions

Ray-trace a bundle through a dielectric optical model with rayoptics (asynchronous-free; needs no FreeCAD geometry). Requires the rayoptics wheel (the optics extra); when it does not resolve this returns {ok:false, reason, install} rather than raising. The geometric refraction comes from rayoptics; the Fresnel/TIR energy split + the exit histogram come from the exact analysis/optics core, so the trace is gated against that oracle (oracle_max_dev_deg = max rayoptics−Snell exit-angle deviation, ~0).

n_refractive is the medium index n2 (default PMMA 1.49062). source_config is {kind:'collimated'(angle_deg)|'cone'(half_angle_deg)|'lambertian' (max_angle_deg)} (default collimated at normal incidence). model may carry {n1 (incident index, default air 1.0), absorption (0..1 bulk loss), target_half_angle_deg (the acceptance cone counted as efficiency)}.

Returns the degradation dict, or {ok, backend:'rayoptics', rayoptics_version, n_rays, n1, n2, critical_angle_deg, efficiency, leakage_fraction, absorbed_fraction, tir_fraction, energy_balance, oracle_max_dev_deg, exit_distribution:[{angle_deg,intensity}], hotspot_locations}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNo
n_raysNo
n_refractiveNo
source_configNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description reveals important non-obvious behavior: missing dependency yields {ok:false, reason, install} instead of raising, the result is gated against an exact analysis oracle, and the trace uses a hybrid rayoptics + core computation path. It also enumerates the returned fields, including error and validation-related ones, giving excellent transparency.

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 dense but every sentence earns its place: purpose, dependency/fallback behavior, computational backend, parameter semantics, and return fields. It is front-loaded with the primary action and then systematically fills in the details necessary for correct invocation. No filler or tautology is present.

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 no output schema, no enum constraints, and 0% schema description coverage, this description is unusually complete. It explains success and failure shapes, required dependency, all meaningful parameter options and defaults, and the exact output fields. The only minor gap is n_rays, but its name/default make the omission low-risk.

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 description coverage is 0%, so the description carries the burden. It explains n_refractive, source_config kinds, and the model subfields with defaults and meaning. It omits any explicit explanation of n_rays beyond its name and default, so it is not a perfect substitute for full parameter documentation.

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 opens with a specific, unambiguous action: 'Ray-trace a bundle through a dielectric optical model with rayoptics.' It also distinguishes itself from sibling tools by noting it is 'asynchronous-free' and 'needs no FreeCAD geometry,' which separates it from CAD-geometry-based or submission-style optics tools.

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 supplies clear usage context: call this tool for a synchronous ray trace without needing FreeCAD geometry, and be aware it requires the `optics` extra. It does not explicitly say 'use X instead when Y,' but the asynchronous-free and no-geometry framing gives an agent enough situational guidance to choose it over sibling ray-trace/submit tools.

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