Skip to main content
Glama

optics_lens_optimize

Optimize a sequential optical system via optiland's optimizer: vary surface radii and thicknesses to meet focal length or RMS spot size targets and converge the merit function.

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

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

With no annotations, the description carries full burden and does well: it discloses the soft dependency ('Requires the optics extra; degrades to {ok:false, reason, install} otherwise') and the return shape including before/after metrics. It does not disclose convergence failure modes or rate/time behavior for the optimization loop.

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?

Front-loaded with the core capability and constraint, then structured parameter definitions. Slightly dense but each line earns its place; no redundant padding.

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 7-param optimization tool with no annotations and no output schema, the description covers the key parameters, the optional dependency behavior, and the return payload. It is nearly complete; missing only how surfaces/wavelengths/field_angles interact with optimization scope and any convergence/iteration caveats.

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 coverage is 0% and the description compensates thoroughly, defining `variables` element structure ({type:'radius'|'thickness', surface:<1-based int>}), `targets` shape with operand enum examples, and `maxiter` semantics. This goes well beyond the bare property names in the schema.

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?

Specific verb+resource: 'Optimize a SEQUENTIAL optical system with optiland's optimizer'. It distinguishes from siblings by naming optics_lens_design for the surface schema and explicitly notes the capability rayoptics lacks, separating it from 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?

Implies usage via reference to optics_lens_design for surfaces and by framing it as the sequential optimization path. However it does not explicitly state when to use this vs. optics_solid_trace or optics_raytrace, leaving some inference to the agent.

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