Skip to main content
Glama

Solve a two-mirror laser cavity: g-parameters, stability, and the TEM00 waist and mirror spot sizes.

opticsResonator

Solve a two-mirror laser cavity: g-parameters, stability, and the TEM00 waist and mirror spot sizes.

The identical function behind the worked examples on /lab/optics-bench, built from the resonator code the bench runs. Give the mirror spacing l (cm), each mirror radius r1, r2 (cm; positive is concave toward the cavity, negative convex, omitted means flat) and the wavelength w (nm). Returns g1, g2, their product, the round-trip half-trace and whether the cavity is stable; when it is, mode holds the waist radius (um), its distance from mirror 1 (cm) and the spot radius on each mirror (mm). mode is null for an unstable cavity or one on the g1*g2 = 0 or 1 boundary.

Every result carries provenance.canonicalUrl — the published page for these exact inputs, or the lane hub when they are off the published grid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lYesMirror spacing (cavity length), centimetres.
wYesWavelength, nanometres.
r1NoRadius of curvature of mirror 1, cm. Positive = concave toward the cavity, negative = convex. Omit for a flat mirror.
r2NoRadius of curvature of mirror 2, cm, same convention. Omit for a flat mirror.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsYesThe parsed inputs, echoed back with defaults filled in.
resultYesThe solved analysis. Shape is per-tool.
licenseYes
provenanceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden well: it discloses the exact stability return fields, the crucial edge case that `mode` is null for unstable cavities and for the g1*g2 = 0 or 1 boundary, and that every result includes provenance.canonicalUrl. It doesn't discuss side effects or failure modes, but as a pure computation these are largely moot.

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?

Three short paragraphs, front-loaded with the core purpose, then inputs, then return shape and provenance. Dense but every sentence carries information; the one red flag is that the first sentence duplicates the tool title verbatim.

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 deterministic 4-parameter compute tool with a full input schema and an output schema, the description covers inputs, units, conventions, return structure, the null/edge-case behavior, and provenance. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents units and the r1/r2 sign convention; the description restates them ('positive is concave toward the cavity, negative convex, omitted means flat') without adding syntax or new meaning. Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb and resource ('Solve a two-mirror laser cavity') and enumerates the exact outputs (g-parameters, stability, TEM00 waist, mirror spot sizes). This clearly separates it from siblings like gaussianBeam, roomModes, and solenoidField.

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?

The description implies when to use it by listing the required inputs and the context ('the resonator code the bench runs'), but it names no alternatives and gives no explicit when-not guidance (e.g., how it differs from gaussianBeam for propagating a beam). Usage is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources