Skip to main content
Glama
alma-corpus-mcp

alma-corpus-mcp

by adamzacharia

fit_gaussian_lines

Fit one or more Gaussians to a continuum-subtracted spectrum to estimate line parameters (amplitude, center, width, FWHM, integrated flux) and their uncertainties from channel data.

Instructions

Fit 1..N Gaussians to a continuum-subtracted spectrum.

x: channel centres (km/s, or GHz/MHz; integrated fluxes are then in flux_unit x x_unit). flux: per channel. rms: per-channel noise; if None it is estimated from the fit residuals (MAD). initial_guesses: optional [[amplitude, centre, sigma], ...]; otherwise peaks are found greedily on the residual spectrum. For each component: amplitude, centre, sigma, FWHM = 2.3548 sigma, integrated flux = sqrt(2 pi) A sigma with its covariance error, and a direct channel sum over centre +/- window_nsigma sigma with error rms dv sqrt(N_chan). Limits: assumes independent channels (Hanning-smoothed or oversampled data have correlated noise, so the errors are too small by up to sqrt(2)); a Gaussian may be a poor shape for double-peaked disk lines.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "x": "<x>",
      "flux": "<flux>"
    },
    "name": "fit_gaussian_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
rmsNo
fluxYes
x_unitNokm/s
flux_unitNomJy
n_componentsNo
window_nsigmaNo
initial_guessesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 well: it discloses that rms is estimated from residuals via MAD when omitted, that peaks are found greedily on the residual spectrum, which quantities are returned with covariance errors, and a real caveat about correlated noise inflating errors by up to sqrt(2). It does not say what happens on non-convergence or how failures are signalled, which is the remaining gap.

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?

Dense but front-loaded: purpose first, then parameter semantics, then outputs, then limits. Every clause carries information, though the parameter and output sentences run long and could be split for faster scanning.

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 an 8-parameter tool with no annotations and no output schema, the description supplies the missing return-value information and states the domain limits. Only the n_components parameter and the unit parameters lack explicit semantics, and error/failure behavior is unaddressed.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does for most of the 8 parameters: x and flux are defined with units, rms default behavior is explained, initial_guesses gets an explicit [[amplitude, centre, sigma], ...] shape, and window_nsigma is defined as the sigma multiplier for the summed-flux window. n_components is only implied by '1..N' and x_unit/flux_unit appear only in a parenthetical, so coverage is strong but incomplete.

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 ('Fit 1..N Gaussians') plus a precondition that scopes it ('to a continuum-subtracted spectrum'). This is clearly distinct from siblings like fit_modified_blackbody, moment_maps, or fit_uv_model, which operate on different data or produce different products.

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 the operating context (continuum-subtracted line spectra) and says when initial_guesses should be supplied, but never explicitly routes the agent between this tool and moment_maps, fit_modified_blackbody, or fit_uv_model. 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.