# Spectral Line Analysis AI Agent Connect

> Spectral Line Analysis MCP gives your AI client the ability to perform high-precision spectroscopic calculations. It handles equivalent width, line flux, and centroid determination by integrating flux against a deterministic continuum model. You can use it for both emission and absorption modes with built-in uncertainty estimation using noise profiles or bootstrap resampling.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_a52TUzKBjaptlQySEduqjsmNwR2AbgqdEEqf3nsd/ai-agent-connect
- **Tags:** spectroscopy, astrophysics, equivalent-width, flux, spectral-analysis

## Description

You can now hand off complex spectroscopic math to your AI agent. This MCP provides the specific tools needed to extract physical properties from spectral data without manual integration. It works by calculating the area under spectral lines against a fitted continuum, allowing your agent to determine line strength and profile quality instantly. Whether you are working with absorption or emission lines, the math stays consistent. You can also rely on the built-in uncertainty estimation, which uses noise profiles or bootstrap resampling to ensure your measurements are statistically sound. Instead of writing custom scripts for each line, you give your agent the wavelength and flux arrays and let it handle the heavy lifting.

## Tools

### calculate_equivalent_width
This tool calculates the fundamental width and strength of a single spectral line.

### get_continuum_residuals
Use this to find the difference between your observed flux and the fitted continuum.

### validate_mask_alignment
This tool checks that your provided mask aligns correctly with the spectral data.

### verify_spectral_units
This tool confirms that your wavelength and flux arrays are physically consistent for integration.

## Prompt Examples

**Prompt:** 
```
Calculate the equivalent width for a spectral line between 6560 and 6565 Angstroms with these flux values: [10.2, 10.5, 12.0, 11.5, 10.1].
```

**Response:** 
```
The equivalent width for the specified spectral line is 0.45 Angstroms with a line flux of 1.2 units.
```

**Prompt:** 
```
Check if these wavelength and flux arrays are consistent for Angstrom and erg/s/cm2/A units.
```

**Response:** 
```
The spectral units are physically consistent and compatible for integration.
```

**Prompt:** 
```
Get the residuals for the flux data in the range 5000 to 5100.
```

**Response:** 
```
The residuals show a mean deviation of 0.02 from the fitted continuum.
```

## Capabilities

### Line Strength Calculation
Your agent uses this to find the equivalent width of specific spectral features.

### Continuum Assessment
Your agent checks the quality of a profile by looking at continuum residuals.

### Data Integrity Checks
Your agent verifies that wavelength and flux units match before running math.

### Mask Validation
Your agent ensures data masking is correctly aligned with the spectra.

### Uncertainty Estimation
Your agent applies noise profiles or bootstrap resampling to estimate errors.

## Use Cases

### Line Strength Analysis
An astrophysicist needs to find the equivalent width of a specific absorption line in a star spectrum.

### Data Quality Control
A researcher uses the tool to check if their data masking is properly aligned with the spectral flux.

### Continuum Fitting
A scientist assesses how well a continuum model fits the observed data by checking residuals.

### Unit Verification
A user ensures that wavelength and flux arrays are physically compatible before starting a large batch of calculations.

## Benefits

- Automates the integration of flux against deterministic continuum models.
- Reduces manual errors by validating spectral units and mask alignment.
- Provides statistical rigor through bootstrap resampling and noise profiles.
- Enables rapid calculation of line strength for both emission and absorption.

## How It Works

Connect your client to Vinkius and start sending spectral data to your agent immediately.

1. Connect your preferred MCP-compatible client to Vinkius.
2. Provide your spectral data arrays to your AI agent.
3. Your agent calls the specific tool needed for the calculation.
4. The MCP performs the math or validation.
5. Your agent receives the result and presents it to you.

## Frequently Asked Questions

**What kind of spectral lines can this MCP analyze?**
It supports both emission and absorption lines.

**How does the MCP handle uncertainty?**
It uses noise profiles or bootstrap resampling to provide advanced uncertainty estimation.

**Can I use this with Claude or Cursor?**
Yes, you can use this with any MCP-compatible client including Claude, Cursor, Windsurf, and VS Code.

**Does it check if my units are correct?**
Yes, the verify_spectral_units tool checks that wavelength and flux arrays are physically consistent for integration.

**How are equivalent widths calculated?**
The MCP calculates equivalent width by integrating the flux against a deterministic continuum model.

**How is the continuum determined?**
The continuum is fit deterministically over the specified integration interval provided to the `calculate_equivalent_width` tool.

**Can I handle absorption lines?**
Yes, by setting the mode to 'absorption' in the `calculate_equivalent_width` tool, the calculation will correctly identify the area 'under' the continuum.

**How is uncertainty calculated?**
Uncertainty can be derived using a provided noise array or through bootstrap resampling if a `bootstrapSeed` is supplied.
