Skip to main content
Glama
akontadakis
by akontadakis

spectral_metrics

Calculate human-centric lighting metrics from spectral power distribution, including CCT/DUV, melanopic DER, melanopic/photopic ratio, and EML to EDI conversions.

Instructions

Derived HCL quantities from an SPD: cct/duv, mel-DER, mel/photopic ratio, and EML<->EDI.

spd accepts a .spd file path, 2-column text, or a list of [wavelength, value]. The two modes below are mutually exclusive, so the eml_edi key has a DIFFERENT shape in each:

  • spd= -> {cct_duv, mel_der, mel_photopic_ratio, eml_edi:{mel_edi, eml}}. Here eml_edi is the SPD's melanopic EDI + its EML equivalent. NOTE: the eml_edi block is ABSOLUTE/scale-dependent (see its scale_note); the other metrics are scale-invariant. metric ('all' | one key) selects a single block.

  • eml_edi_value= -> scalar EML<->mel-EDI conversion only (no SPD needed): {eml_edi:{input, direction, result}}. eml_edi_direction= 'medi_to_eml' (default) or 'eml_to_medi'. (Spec 7.1 row 5 EML<->EDI.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spdNo
metricNoall
eml_edi_valueNo
eml_edi_directionNomedi_to_eml

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/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. It discloses that the eml_edi block is absolute/scale-dependent and includes a scale_note, while other metrics are scale-invariant. It also notes the output shape differs by mode and that metric selects a single block. This is meaningful behavioral context beyond just 'compute'.

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?

The description is structured with bullets and indentation, front-loading the purpose and then detailing modes. It is somewhat dense but every sentence earns its place, providing necessary detail without excessive verbosity. The organization aids scanning.

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?

Despite complexity (two modes, varying output shapes, scale-dependence), the description covers everything an agent needs: input formats, output structures, parameter defaults, and important caveats. With an output schema present, the description still provides the behavioral context needed for correct use.

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 description coverage is 0%, so the description fully compensates. It explains spd accepts a file path, 2-column text, or a list; eml_edi_value is a scalar; eml_edi_direction has two allowed values; and metric selects 'all' or one key. It also clarifies the mutual exclusivity and how parameters interplay, which is essential for correct invocation.

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 clearly states the tool computes specific HCL quantities from an SPD, listing cct/duv, mel-DER, mel/photopic ratio, and EML<->EDI. It also distinguishes two mutually exclusive modes, giving the agent a precise understanding of the tool's function and output.

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 explicitly explains when to use each mode (spd= for full metrics, eml_edi_value= for scalar conversion) and notes the default direction for eml_edi_direction. It does not explicitly compare to sibling tools like circadian_metrics, but the usage context is clear enough for an agent to decide when to invoke it.

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