Skip to main content
Glama

generate_spectrum

Draw IR, ¹H/¹³C NMR, MS, UV/Vis, Raman, NIR, fluorescence, ORD or CD spectra as PNG/SVG panels from supplied peak lists, with correct axis conventions for each spectrum type.

Instructions

Draw a spectrum — IR, ¹H/¹³C NMR, mass spectrum (MS), UV/Vis, Raman, NIR, fluorescence, ORD or CD — as PNG/SVG files with a panel.

Any request to draw, sketch, plot or show a spectrum is this tool, including a "schematic" spectrum of a named compound ("aspirin IR spectrum schematic") and requests with no peak values: then supply typical literature peak positions yourself (aspirin IR: C=O ~1750 and ~1690 cm⁻¹, broad O–H ~2500–3300 cm⁻¹). Use it instead of drawing the spectrum as a generic chart or visualization — this tool gets the axis conventions right (IR: inverted wavenumber axis with transmission dips; NMR: ppm right to left; MS: bars). It draws exactly the peaks it is given; it predicts nothing.

Not this tool for: working out WHICH bands to expect, or what a measured wavenumber belongs to (use predict_spectrum — its band list can then be drawn here), or the compound's structure formula (use generate_molecule).

Args: spectrum_type: One of "ir", "nir", "raman", "uv_vis", "fluorescence", "ord", "cd", "nmr_1h", "nmr_13c", "ms". peaks: Peak list. position uses the type's natural unit (cm⁻¹ for ir/nir/raman, nm for uv_vis/fluorescence/ord/cd, ppm for NMR, m/z for ms). intensity is relative on any scale (negative values only for ord/cd). width (optional) is the half-width in x-units; label (optional) annotates the peak in the plot (e.g. "C=O"). title: Display name shown in the plot title, also used for the filename (can be localized, e.g. "Aspirin IR"). formats: Output file formats, any of "png", "svg" (default: both). CDXML is not available for spectra.

Input Schema

NameRequiredDescriptionDefault
peaksYes
titleNo
formatsNo
spectrum_typeYes

Output Schema

NameRequiredDescriptionDefault
svgNo
nameNo
typeNospectrum
filesNo
spectrum_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.7/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 and does disclose real behavior: it 'draws exactly the peaks it is given; it predicts nothing', enforces axis conventions per type (IR inverted wavenumber, NMR ppm right-to-left, MS bars), and notes CDXML is unavailable for spectra. It does not describe where files are written or how they are returned, but the presence of an output schema covers the return contract.

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 action, then usage guidance, then exclusions, then a structured 'Args' section — an agent can stop reading at any level. It runs long and repeats the axis-convention idea in the parenthetical, but each block adds distinct routing or parameter information rather than padding.

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 complex, 4-parameter generator with 0% schema coverage, the description fills every gap an agent needs: valid type values, unit conventions, optional-field semantics, defaults, and the boundary against predict_spectrum. Return values need not be explained because an output schema exists.

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 must compensate and it does: it lists all ten valid spectrum_type values (the schema has no enum), defines position units per type (cm⁻¹, nm, ppm, m/z), explains intensity as relative and negative only for ord/cd, defines width as half-width in x-units, and explains label annotation. It also covers title's dual role as plot title and filename and formats' default of both png and svg.

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?

States a specific verb and resource ('Draw a spectrum') and enumerates the exact spectrum types covered (IR, ¹H/¹³C NMR, MS, UV/Vis, Raman, NIR, fluorescence, ORD, CD) plus output formats. It explicitly distinguishes itself from generic chart/visualization tools and from the sibling generate_molecule, so an agent can identify it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit positive triggers, including the ambiguous case of a 'schematic' spectrum with no peak values, and instructs the agent to supply typical literature positions itself with concrete example values. It also names exclusions ('Not this tool for: working out WHICH bands to expect... use predict_spectrum') and a second alternative (generate_molecule), leaving nothing to inference.

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