Skip to main content
Glama

Optics Lens Optimize

optics_lens_optimize
Read-only

Optimize sequential optical lens systems by adjusting surface radii and thicknesses to meet target metrics like focal length or RMS spot size. Returns converged results with before/after values.

Instructions

Optimize a SEQUENTIAL optical system with optiland's optimizer (MIT, in-process) — the capability rayoptics lacks. Requires the optics extra; degrades to {ok:false, reason, install} otherwise.

surfaces: as in optics_lens_design. variables: [{type:'radius'|'thickness', surface:<1-based int>}] — the degrees of freedom. targets: [{operand:'f2'| 'rms_spot_size'|…, target, weight?, surface?}] — the merit function. maxiter caps iterations.

Returns the degradation dict, or {ok, backend:'optiland', converged, n_fev, before:{efl_mm,rss}, after:{efl_mm,rss}, surfaces:[optimized]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
epdNo
maxiterNo
targetsYes
surfacesYes
variablesYes
wavelengths_umNo
field_angles_degNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses meaningful behavior beyond the readOnlyHint annotation: it runs in-process, uses a specific backend, reports optimization convergence, exposes before/after metrics, and degrades gracefully if the required extra is absent. This is substantial behavioral context.

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 compact and well-organized: purpose, prerequisite/fallback, parameter semantics, then return format. No sentence is redundant, and important information is front-loaded.

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?

The description covers prerequisites, parameters, and return behavior, which is strong for a tool with no output schema. The main gap is the three optional parameters that are left to name-based inference, but the required calling contract is fully explained.

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?

With 0% schema description coverage, the description compensates well for the core parameters: surfaces, variables, targets, and maxiter are given structure and meaning. The optional parameters epd, wavelengths_um, and field_angles_deg are not described, but their names and defaults make them reasonably self-explanatory.

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 action and resource: 'Optimize a SEQUENTIAL optical system with optiland's optimizer.' It also distinguishes itself by noting this is 'the capability rayoptics lacks,' making its purpose clear relative to nearby 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 gives a concrete prerequisite ('Requires the optics extra') and explains the degradation fallback when it's missing. It references optics_lens_design for surface format, but it does not explicitly enumerate when to choose this tool over optics_lens_design or other siblings beyond the rayoptics comparison.

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