Skip to main content
Glama

optics_raytrace

Trace ray bundles through dielectric optical models to compute refraction, Fresnel/TIR energy split, efficiency, leakage, absorption, exit-angle distribution, and hotspots.

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.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the rayoptics wheel dependency, that failures return {ok:false, reason, install} instead of raising, and that results are gated against an exact oracle via oracle_max_dev_deg. It does not cover permissions, limits, or convergence caveats, so it falls short of a 5.

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?

Content is front-loaded (verb+resource first, then dependency behavior, then parameters and returns). It is dense and parenthetical-heavy but nearly every sentence carries distinct information, with little waste.

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?

For a 4-param tool with no output schema and no annotations, the description covers purpose, dependency/failure behavior, all defaulted parameters, and the returned dict fields (efficiency, tir_fraction, exit_distribution, hotspot_locations, etc.). Gaps are minor rather than blocking.

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 0%, so the description must compensate, and it largely does: it defines n_refractive (n2, default PMMA 1.49062), enumerates source_config kinds with their fields, and lists model keys (n1 default air, absorption, target_half_angle_deg). n_rays is only inferable from the return-field list, leaving one parameter under-explained.

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 states a precise verb+resource: 'Ray-trace a bundle through a dielectric optical model with rayoptics'. It also implicitly differentiates itself from geometry-bound siblings like optics_solid_trace by noting it 'needs no FreeCAD geometry' and is 'asynchronous-free', so an agent can place it without opening a schema.

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?

It conveys context ('needs no FreeCAD geometry', dependency on the optics extra, async-free), which implies when this is the right tool, but it never names an alternative or states an explicit when-not condition. Usage must be inferred rather than read.

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