MCP for OpenFilters

v0.2.2
io.github.BBrunoEsteves/mcp-for-openfilters Checked 2 days ago Published 28 days ago

Design, simulate and optimize optical thin-film coatings with the OpenFilters engine.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

server_info Server information

Version, build (git commit of a source checkout, and when this server started: a server started before a code change still runs the old code until the app is restarted), data folder, worker count and whether the compiled C++ core is in use.

list_materials List materials

List available materials (built-in OpenFilters library plus the user's own) with n,k at a few wavelengths. Mixtures (variable composition) report their index range at 550 nm.

ParameterTypeDescription
name_filter

get_material_index Material optical constants

Tabulate n and k of a regular material over wavelengths (default 300-2000 nm, 50 nm steps). For a mixture (kind "mixture" in list_materials): its composition steps, the index of each step k at each wavelength (default 550 nm; up to 10 wavelengths), as used by graded layers.

ParameterTypeDescription
name *string
plotboolean
wavelengths{"from": 380, "to": 1100, "step": 1} or an explicit list of wavelengths (nm). Default: the design's wavelength_range if it has one (e.g. from a project), else 380-1100 nm (simulate_random_errors: Open…

add_material Add a material

Add a material to the user's material folder. model = "constant" (n, k) | "cauchy" (coefficients [A, B, C] with n = A + B/l^2 + C/l^4, l in um, optionally + [Ak, exponent, edge_nm] Urbach absorption) | "sellmeier" ([B1, C1, B2, C2, B3, C3], C in um^2, optional same 3 absorption terms) | "table" (rows [wavelength, n, k] in `table`, or a CSV/whitespace text file `table_file` with columns wavelength, n, k; wavelength_unit nm|um|eV). k is the positive extinction coefficient.

ParameterTypeDescription
model *string
name *string
coefficients
descriptionstring
knumber
n
overwriteboolean
table
table_file
wavelength_unitstring

remove_material Remove a material

Delete one of the user's own materials (from add_material or import_refractiveindex_material). Built-in OpenFilters materials cannot be removed; if a user material had the same name as a built-in one, the built-in one is used again. Designs and projects that use it will no longer load.

ParameterTypeDescription
name *string

search_refractiveindex Search refractiveindex.info

Search the refractiveindex.info database of optical constants (public domain) by material name, formula or author, e.g. "Ta2O5", "silicon nitride", "HfO2 thin film", "N-BK7". Each result gives a `page` id to pass to import_refractiveindex_material (pass it exactly, spaces included), the source (author, year, range) and the database's category for it, e.g. "Thin film", "Amorphous thin film" or "Experimental data: bulk, thick film": thin-film data usually suit coatings best. shelf limits the search: main (inorganic), organic, glass, other, specs (supplier data sheets), popula…

ParameterTypeDescription
query *string
limitinteger
refreshboolean
shelf

import_refractiveindex_material Import a refractiveindex.info material

Download one refractiveindex.info entry (`page` from search_refractiveindex) and add it to the user's materials as an n,k table, usable in designs like any other material. Tabulated data and dispersion formulas are both converted; k = 0 when the entry gives none. name defaults to <book>_<page> (e.g. Ta2O5_Bright-amorphous); from_nm/to_nm crop the table. Returns the material, its wavelength range, the references (cite them when using the data) and the web page.

ParameterTypeDescription
page *string
from_nm
name
overwriteboolean
plotboolean
to_nm

describe_design Describe a design

Validate a design and list its layers (thickness, index and QWOT at the center wavelength; graded layers: number of steps, index range, first and last index, optical thickness), total thickness, the substrate and incident medium indices, and the normalized design JSON (e.g. a formula expanded into layers; omitted for formulas of more than 20 layers, which can be passed as they are; written to a design_file when graded layers have many steps). Two-sided designs also list back_layers (with a warning if consider_backside is false). plot_index_profile draws n at the center wave…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
plot_index_profileboolean

compute_spectrum Compute spectrum

Compute R, T, A, OD, phase, GD or GDD spectra (quantity names R, T, A, OD, R_phase, T_phase, R_GD, T_GD, R_GDD, T_GDD) versus wavelength for one design at one or more angles and polarizations. Returns, per series, min/max/mean and `sample_points` evenly spaced samples (set sample_points=0 for statistics only); full data go to a CSV when save_csv=true. reverse=true illuminates from the substrate side (R, T, A, OD only; the angle is then measured in the substrate, or in the exit medium when consider_backside is true, as in OpenFilters). Quantity "OD" is optical density (-…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
anglesarray
plotboolean
polarizationsarray
quantitiesarray
reverseboolean
sample_pointsinteger
save_csvboolean
threshold{"above": 0.999} or {"below": 0.01}: ranges where each series is above/below the level, edges interpolated (e.g. the high-reflection band of a mirror); {"half_max": true}: FWHM, peak and half-maximum…
wavelengths{"from": 380, "to": 1100, "step": 1} or an explicit list of wavelengths (nm). Default: the design's wavelength_range if it has one (e.g. from a project), else 380-1100 nm (simulate_random_errors: Open…

compute_angle_scan Angle scan

R/T/A (or phase) versus angle of incidence at a single wavelength. Per curve: min/max with the angle where each occurs (e.g. Brewster's angle is at_deg_min of "R p"), mean, `sample_points` evenly spaced samples (0 for statistics only) and optional threshold ranges.

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
wavelength *number
anglesobject{"from": 0, "to": 85, "step": 1}
plotboolean
polarizationsarray
quantitiesarray
sample_pointsinteger
thresholdas in compute_spectrum, over angle

compute_color Coating color

Color of the coating in reflection or transmission: XYZ, xy, L*a*b*, LCh, sRGB and hex, at each angle (use several angles to see the color shift).

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
anglesarray
illuminantstring
modestring
observerstring
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)

compute_electric_field Electric field in the coating

Standing-wave |E|^2 inside the coating (relative to the incident wave), e.g. for laser-damage analysis, sampled every 1 nm inside every layer (graded layers too). Returns the peak value and position, its value at each interface and, for graded layers, the peak inside each one.

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
wavelength *number
anglenumber
plotboolean
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)

compute_monitoring_curves Optical monitoring curves

Optical monitoring signal (R or T) versus deposited thickness, as seen during deposition. Returns the signal at the end of each layer (turning-point/level-cut planning). With many wavelengths (spectroscopic monitoring) it returns the layer-end signals of the selected wavelength (the center wavelength if it is on the grid, else the middle one, as OpenFilters selects), a CSV of the spectrum at every layer end, a map of signal versus thickness and wavelength (save_map: the full map as CSV), and the curve at the selected wavelength. direction "reverse": light from the substrate…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
wavelengths *Monitoring wavelengths: a list (e.g. [550]), a range {"from": 400, "to": 800, "step": 2}, or "spectroscopic" = every wavelength of the design's wavelength_range (OpenFilters' spectroscopic option: bro…
anglenumber
directionstring
modestring
plotboolean
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)
save_mapboolean

thermal_sensitivity Thermal sensitivity of a peak

How the peak of R or T nearest `near` (default the center wavelength; e.g. a band-pass line) moves when each material's index or thickness changes: d(lambda)/dn in nm per refractive-index unit and d(lambda)/d(strain) in nm per unit relative thickness change, for all layers of that material (half-maximum centre, central differences). These do not depend on any thermal property, so they can be combined with measured dn/dT later. With `thermal`, also d(lambda)/dT in pm/K, each material's contribution, kelvin per FWHM (the heating that moves the peak by its width) and, per mate…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
anglenumber
near
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)
quantitystring
thermal
windowWhere to look for the peak first, {"from": 507, "to": 557, "step": 0.05}; default near +/- 25 nm. It is widened if the peak does not fit and then refined to FWHM/500.

thermal_sweep Thermal tuning sweep

The peak of R or T nearest `near` at each temperature change delta_T (K, relative to the temperature the design's materials and thicknesses describe), with every material's dn/dT, dk/dT and thickness strain applied together: half-maximum centre, peak wavelength and value, FWHM; a linear fit gives d(lambda)/dT in pm/K. The model is linear in temperature: check it against measurements over wide ranges.

ParameterTypeDescription
delta_T *array
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
thermal *objectThermal properties: {"materials": {"TiO2": {"dn_dT": -1e-4, "cte": 5e-6, "poisson": 0.27, "dk_dT": 0}, "SiO2": {"dn_dT": 1e-5, "cte": 0.5e-6, "poisson": 0.17}}, "substrate_cte": 0.55e-6, "clamped": tr…
anglenumber
near
plotboolean
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)
quantitystring
windowWhere to look for the peak first, {"from": 507, "to": 557, "step": 0.05}; default near +/- 25 nm. It is widened if the peak does not fit and then refined to FWHM/500.

evaluate_design Evaluate a design

Merit (chi^2, OpenFilters' definition) of a design against targets, with per-target pass fraction and maximum deviation. all_targets_met is true when every point meets its target (inequalities must hold; "equal" targets must be within tolerance).

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
targets *arrayTargets, each {"kind": "R"|"T"|"A"|"R_phase"|"T_phase"|"R_GD"|"T_GD"|"R_GDD"|"T_GDD", "angle": 0, "polarization": "unpolarized"|"s"|"p" or an angle psi in degrees (0 = p, 90 = s), then either "wavelen…
plotboolean

layer_sensitivity Layer sensitivity

Change in merit (delta_chi2) and in worst margin when each layer thickness changes by +/- relative_step (default 1 %; the worse direction), to find the layers that need the tightest deposition control. worst_margin is the smallest distance to a limit over all target points in units of each point's tolerance (positive = met; e.g. 0.5 with tolerance 0.001 means 0.0005 inside the limit). It ranks layers of a design that meets its inequality targets with room to spare, where the merit stays 0. A graded layer is scaled as a whole (every step by the same factor: a deposition-rate…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
targets *arrayTargets, each {"kind": "R"|"T"|"A"|"R_phase"|"T_phase"|"R_GD"|"T_GD"|"R_GDD"|"T_GDD", "angle": 0, "polarization": "unpolarized"|"s"|"p" or an angle psi in degrees (0 = p, 90 = s), then either "wavelen…
relative_stepnumber

optimize_design Optimize a design

Optimize a design with OpenFilters: method "refine" (thicknesses only), "needle" (refine and insert new layers until no improvement) or "step" (graded/step index, needs a mixture material). Waits up to wait_seconds (max 45); if not finished, returns a job_id to poll. Returns the best design found (not merely the last), stop_reason with a plain stop_explanation, thinnest_layer_nm, and an .ofp project (start + optimized) openable in OpenFilters. thin_layers_removed counts layers removed while enforcing min_thickness (a layer held at the minimum is dropped when that does not w…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
targets *arrayTargets, each {"kind": "R"|"T"|"A"|"R_phase"|"T_phase"|"R_GD"|"T_GD"|"R_GDD"|"T_GDD", "angle": 0, "polarization": "unpolarized"|"s"|"p" or an angle psi in degrees (0 = p, 90 = s), then either "wavelen…
methodstring
optionstime_limit (s, default 300), max_iterations, min_thickness (nm; guaranteed in the result: thin layers are clamped or removed and the design re-refined with that bound; a clamped design that already me…
wait_secondsnumber

run_batch Run a parameter sweep

Parameter sweep run in parallel on all cores as a background job. operation: "spectrum" (args: design, quantities, wavelengths, angles, polarizations, metrics), "evaluate" (design, target_specs), "optimize" (design, target_specs, method, options), "tolerance", "color". For "spectrum", give `metrics` to reduce each spectrum to numbers, e.g. [{"name": "Rmin_vis", "quantity": "R", "from": 400, "to": 700, "stat": "min"}, {"name": "T633", "quantity": "T", "stat": "at", "wavelength": 633}] (stat: mean|min|max|std|at; optional angle/polarization). Peak stats for a band-pass:…

ParameterTypeDescription
operation *string
parameters *objecte.g. {"n_pairs": [4, 6, 8], "aoi": [0, 15, 30]}
template *objectArguments of the operation, where any value written "$name" (or "${name}" inside a string) is replaced by the swept parameter `name`.
labelstring
modestring

run_optimization_campaign Run an optimization campaign

Many optimizations from different starting designs, in parallel; ranks distinct results (by yield first when a tolerance stage is requested, then targets met, merit, layer count, total thickness) and saves the top_n designs as an .ofp project. Starts that converge to the same design are marked duplicate_of. Pass options min_thickness to avoid unmanufacturable sub-nanometre layers. Returns a job_id.

ParameterTypeDescription
targets *arrayTargets, each {"kind": "R"|"T"|"A"|"R_phase"|"T_phase"|"R_GD"|"T_GD"|"R_GDD"|"T_GDD", "angle": 0, "polarization": "unpolarized"|"s"|"p" or an angle psi in degrees (0 = p, 90 = s), then either "wavelen…
labelstring
methodsarray
optionsSame as optimize_design options, applied to every optimization (e.g. max_layers, min_thickness, time_limit).
random_startsGenerate starts: {"count": 50, "materials": ["TiO2", "SiO2"], "n_layers": [5, 25], "thickness": [20, 200], "substrate": "BK7", "seed": 1, ...other design keys}. n_layers only sizes the starting design…
startsExplicit starting designs.
toleranceOptional yield stage on the top_n designs: {"n_trials": 200, "thickness_error": {"type": "relative", "sigma": 0.01}, "index_error": {"sigma": 0.005}, "seed": 0}
top_ninteger

tolerance_analysis Tolerance (yield) analysis

Monte Carlo yield: random thickness (and optional index) errors; a trial passes when every target is met. Runs in parallel; returns yield with 95 % interval, merit statistics and the failure rate of each target. Both faces of a two-sided design are perturbed. A graded layer is scaled as a whole (all its steps by one factor: a deposition-rate error); index_error does not perturb mixtures.

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
targets *arrayTargets, each {"kind": "R"|"T"|"A"|"R_phase"|"T_phase"|"R_GD"|"T_GD"|"R_GDD"|"T_GDD", "angle": 0, "polarization": "unpolarized"|"s"|"p" or an angle psi in degrees (0 = p, 90 = s), then either "wavelen…
index_error{"sigma": 0.005} relative index error, drawn per material per trial
n_trialsinteger
seedinteger
thickness_error{"type": "relative"|"absolute", "sigma": 0.01 (fraction) or nm, "distribution": "normal"|"uniform", "systematic": 0.0 (common relative offset)}
wait_secondsnumber

simulate_random_errors Simulate random errors

OpenFilters' Preproduction > Simulate random errors: the spread of R, T, A, phase, GD, GDD (and colour) curves when every layer thickness is off by a random error, without targets (tolerance_analysis gives the yield against targets instead). Runs OpenFilters' own analysis: front layers only, graded layers shifted step by step, nb_tests designs. Per quantity: the largest standard deviation and the worst deviation from the design (where they occur) and samples of design/mean/std_dev/min/max; colour (quantity "color"): design, mean and worst Lab with the spread in Delta E 2000…

ParameterTypeDescription
design *objectDesign: {"substrate": "BK7", "incident_medium": "void", "center_wavelength": 550, "substrate_thickness_mm": 1, "layers": [{"material": "TiO2", "thickness": 58.6}, {"material": "SiO2", "qwot": 1}]} wit…
anglenumber
illuminantstring
nb_testsinteger
observerstring
plotboolean
polarization"s", "p", "unpolarized", or a polarization angle psi in degrees from 0 to 90 (as in the OpenFilters dialogs: R = sin^2(psi) Rs + cos^2(psi) Rp; 0 = p, 90 = s, 45 = unpolarized)
quantitiesarray
sample_pointsinteger
save_all_resultsboolean
seedinteger
showWhat the plots draw, as the dialog's Show boxes: {"all_results": false, "mean": false, "std_devs": null (e.g. 3 for mean +/- 3 sigma), "worst_case": true, "design": true, "targets": false}
targets
thickness_error{"type": "relative" (value a fraction, 0.01 = 1 %) | "absolute" (value in nm), "value": 0.01 ("sigma" is accepted too), "distribution": "uniform" (within +/- value) | "normal" (sigma = value)}; defaul…
wavelengths{"from": 380, "to": 1100, "step": 1} or an explicit list of wavelengths (nm). Default: the design's wavelength_range if it has one (e.g. from a project), else 380-1100 nm (simulate_random_errors: Open…

job_status Job status

Progress of a background job (tasks done/total, failures, ETA, output files when done).

ParameterTypeDescription
job_id *string

list_jobs List jobs

Most recent background jobs, newest first.

ParameterTypeDescription
limitinteger

get_results Get job results

Result rows of a job (campaigns are ranked best first; batches in task order unless sort_by is given). Works on partial results while the job is running. include_designs adds the optimized design JSON of the returned rows. For finished campaigns, plots the top 3 designs against the targets.

ParameterTypeDescription
job_id *string
descendingboolean
include_designsboolean
plotboolean
sort_by
top_ninteger

cancel_job Cancel a job

Cancel the pending tasks of a running background job. Reports tasks_done, tasks_still_running (they finish on their own) and tasks_cancelled (never started); a finished job is left as it is.

ParameterTypeDescription
job_id *string

load_project Load an OpenFilters project

Read an OpenFilters .ofp project: returns its designs (as design JSON) and targets. A relative path or bare name (e.g. "my_ar") is looked up in the data folder's projects directory, where save_project writes; give the full path for projects elsewhere. OpenFilters' example projects load as "examples/<name>": examples/AR, examples/Beamsplitter, examples/Color, examples/Edge, examples/Fourier, examples/Ramp, examples/Rugate. A design whose graded layers have many steps (rugate filters: thousands) is summarized (steps, index range, optical thickness per graded layer) and wr…

ParameterTypeDescription
path *string
full_graded_arraysboolean

save_project Save an OpenFilters project

Write designs and their targets to an .ofp project that opens in the OpenFilters GUI. ALWAYS pass the targets the designs were optimized or evaluated against: the GUI's Design/Optimize menu stays disabled in a project without targets, so the user could not continue the work there. Each design becomes ONE filter in the project; a part coated on both faces must be a single design with back_layers and consider_backside: true (written as BackLayer lines), not two designs. Keep the fields optimize_design returns in each design (description, needle_materials, layer flags) and…

ParameterTypeDescription
designs *array
path *string
commentstring
targets