alma-corpus-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ALMA_MCP_DATA | No | Directory of the alma-corpus data bundle containing alma_methods.sqlite, manifest.json and skills/. Defaults to ~/.alma-mcp/data. | |
| ALMA_MCP_WORKDIR | No | Allowed folder for alma-analysis-mcp input and output files such as FITS cubes, visibility tables, moment maps and masks. Defaults to the folder the server was started in. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Compute tools for ALMA analysis. Inputs are plain numbers/lists or local file paths (FITS cubes, or .npz/.csv visibility tables with columns u, v, Re, Im, weight). Every result states units, the convention used and warnings; read the warnings before quoting numbers. corpus_practice lists alma-corpus skill slugs to consult for the settings papers typically use. File paths must lie inside the server's allowed folder (ALMA_MCP_WORKDIR, default its working directory); relative paths start there. Tools that write files refuse to replace an existing file unless overwrite=true.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| dust_mass_from_fluxA | Optically thin dust mass (Hildebrand 1983): M = S_nu D^2 / (kappa_nu B_nu(T_d)). At redshift z (freq_ghz is the observed frequency): M = S_obs D_L^2 / ((1 + z) kappa(nu_rest) B(nu_rest, T_d)). The full Planck function is used, never the Rayleigh-Jeans 1/T form. kappa_nu = kappa0 (nu / nu0)^beta per gram of dust unless kappa_includes_gas=True (then the result is a gas+dust mass and the dust mass is that divided by gas_to_dust). cmb: 'none', 'contrast' (divide by 1 - B(T_CMB(z))/B(T_d), da Cunha 2013 eq. 18) or 'heating_and_contrast' (t_dust_k is then the z = 0 temperature and is heated by the CMB first, da Cunha 2013 eq. 12). Never apply heating twice. Limits: optically thick emission makes the mass a lower limit; kappa is uncertain by about 25% to a factor 3-5 and is NOT propagated; interferometers can resolve out extended flux. |
| fit_modified_blackbodyA | Fit a single-temperature modified blackbody to an SED (observed frequencies in GHz, fluxes in mJy). form='thin': S = (1+z) M kappa(nu_rest) B(nu_rest,T) / D_L^2. form='general': S = (1+z) A (1 - exp(-tau)) B / D_L^2 with tau = (nu_rest/nu_0)^beta, nu_0 = c/lambda0_um, and A = M kappa(nu_0) (tau = 1 at lambda0 defines the area). The mass in this form depends on that area assumption. Free parameters: log10 M_dust (Msun), T_d (K), beta (unless fixed). Errors in quadrature with flux_cal_frac. L_IR is integrated over rest 8-1000 um (and L_FIR over 42.5-122.5 um) from the intrinsic B(T) model. cmb_contrast subtracts B(T_CMB(z)) (da Cunha 2013 contrast term only; T_d is then the heated temperature). Returns least-squares values with covariance errors; mcmc=True adds an emcee posterior (needs [fit] extra). Limits: one temperature misses cold dust mass; T and beta are degenerate; upper limits are not handled. |
| spectral_indexA | Spectral index alpha (S_nu proportional to nu^alpha) from two or more frequencies. Two points: alpha = ln(S2/S1) / ln(nu2/nu1), sigma_alpha = sqrt((s1/S1)^2 + (s2/S2)^2) / |ln(nu2/nu1)|. More points: weighted least squares of ln S on ln nu. Each flux error is the statistical error (+) the per-band flux calibration fraction (default 10%) in quadrature, so the absolute alpha error is calibration dominated (about 0.4 for 10% per band on nearby bands). Also returns beta = alpha - 2 (optically thin Rayleigh-Jeans) and, if t_dust_k is given, beta corrected for the Planck curvature: beta = alpha - dlnB/dlnnu. Limits: needs matched uv ranges / beams across bands; optical depth and scattering lower alpha (mimicking grain growth); non-simultaneous data on variable sources bias it. |
| fit_gaussian_linesA | 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. |
| line_luminosityA | Line luminosity in the Solomon et al. (1997) / Solomon and Vanden Bout (2005) forms. L'_line = 3.25e7 S dv nu_obs^-2 D_L^2 (1+z)^-3 [K km/s pc^2] (S dv in Jy km/s, nu_obs in GHz, D_L in Mpc) L_line = 1.04e-3 S dv nu_obs D_L^2 = 1.04e-3 S dv nu_rest (1+z)^-1 D_L^2 [Lsun] and L_line = 3.18e-11 nu_rest^3 L'. For a local source give distance_mpc (z may stay 0); for z > 0 leave distance_mpc empty and D_L comes from Planck18 (a given distance wins, with a warning if it disagrees). Lensed sources are divided by magnification. Limits: interferometric fluxes can miss extended emission. |
| co_gas_massA | Molecular gas mass from a CO line luminosity. L'_CO(1-0) = L'_CO(J-[J-1]) / r_J1, where r_J1 is the brightness-temperature (L') ratio. If you only have a flux-density ratio S_J/S_1, set ratio_is_flux_density=True: r_J1 = (S_J/S_1) / J^2 (CO). M_mol = alpha_CO L'_CO(1-0). alpha_CO in Msun (K km/s pc^2)^-1: 4.35 Galactic INCLUDING helium (x1.36; 3.2 without), 0.8 ULIRG/SMG convention (stated with helium in most papers; check). Or give x_co (cm^-2 (K km/s)^-1, e.g. 2e20, H2 only): alpha_H2 = X_CO x 2 m_H / (Msun pc^-2), about 3.2 for 2e20, and x1.36 for M_mol with helium. Returns both M_mol (with He) and M_H2 (without) with the factor used. alpha_co_err is an absolute error on the factor in use: on alpha_co, or on the derived alpha_mol when x_co is given (the default alpha_co is ignored then). Limits: alpha_CO depends on metallicity and environment (factors of several); r_J1 for mid-J lines is a large assumed term; a flux ratio used as r_J1 underestimates the mass by J^2. |
| rotational_diagramA | LTE rotational (population) diagram: fit ln(N_u/g_u) = ln(N_tot/Q(T_rot)) - E_u/T_rot. Each line dict: freq_ghz, a_ul (s^-1), e_u_k (K), g_u, w_k_kms (integrated intensity, K km/s) and w_err_k_kms. Instead of w_k_kms you can give flux_jy_kms with bmaj_arcsec, bmin_arcsec (converted with the RJ 1.222e6 factor). flux_jy_kms must be the per-beam integrated intensity in Jy/beam km/s (moment 0 at the position), not a spatially integrated flux in Jy km/s, unless the source is smaller than the beam. For tau_correction also give fwhm_kms per line. N_u = 8 pi k nu^2 W / (h c^3 A_ul) / beam_filling (thin, RJ, background neglected). Errors on W get flux_cal_frac in quadrature. Q(T) from partition_table (log-log interpolation; include vibrational states) or a linear rotor approximation Q = kT/(hB) + 1/3. tau_correction fits ln N_tot and T_rot jointly with each line's thin-assumption column modelled as N_u (1 - exp(-tau))/tau, tau the Gaussian peak opacity from N_u, T_rot and fwhm_kms (Goldsmith and Langer 1999 C_tau). Limits: needs >= 3 lines over a range of E_u; T_rot is a lower limit to T_kin for subthermal gas; beam filling < 1 and opacity make N a lower limit; blends bias it. |
| lte_column_densityA | Total column density from one line in LTE (Mangum and Shirley 2015 form). N_u = 8 pi k nu^2 W / (h c^3 A_ul) x J(T_ex) / (J(T_ex) - J(T_bg)) / beam_filling, with J(T) = (h nu/k) / (exp(h nu / k T) - 1); N_tot = N_u Q(T_ex) / g_u exp(E_u / T_ex). Optical depth: give tau directly, or peak_tb_k so tau = -ln(1 - T_peak / (f (J(T_ex) - J(T_bg)))); then N is multiplied by C_tau = tau / (1 - exp(-tau)). Q from partition_q, a [[T, Q]] table or a linear rotor B. Limits: T_ex must be assumed (N can change by factors of several over 10-100 K); one line cannot test LTE. |
| moment_mapsA | Moment 0/1/2, peak intensity and a quadratic peak velocity from a FITS cube. Velocity range v_min_kms..v_max_kms selects channels. rms per channel comes from |
| keplerian_maskA | Build a Keplerian mask cube for a thin disk on the grid of a template FITS cube. Disk coordinates: x_d = dRA sin(PA) + dDec cos(PA), y_d = (-dRA cos(PA) + dDec sin(PA)) / cos(i), r = sqrt(x_d^2 + y_d^2) with dRA (east) and dDec offsets in arcsec from the disk centre (default: the reference pixel of the cube). PA is east of north to the REDSHIFTED major axis. v_los = v_sys + sqrt(G M / r) sin(i) x_d / r. A voxel is in the mask if r_min <= r <= r_max and |v_chan - v_los| <= line_width_kms + dv/2. Each channel is then dilated by an elliptical beam (dilate_beams x beam FWHM). Writes a 0/1 FITS cube (spectral axis increasing) to out_path (default .keplerian_mask.fits next to the cube). Paths must lie inside the allowed folder (env ALMA_MCP_WORKDIR, default the server's working directory); an existing file is refused unless overwrite=true. Limits: thin disk only (no elevated emission surface, so 12CO back sides can fall outside); a mask built from assumed M*, i, PA biases weak-line maps toward that model. |
| dynamical_massA | Enclosed dynamical mass. kind='keplerian': M = v_rot^2 r / G with v_rot = v_obs / sin(i) when velocity_is_projected (needs inclination). kind='virial': M_vir = (5 / a) sigma^2 R / G, a = (1 - k/3) / (1 - 2k/5) for rho ~ r^-k (k = density_index; k = 0 gives 5 sigma^2 R / G, k = 1 gives 1040 sigma^2 R in Msun, km/s, pc). sigma is the 1D dispersion; set velocity_is_fwhm to pass a FWHM (sigma = FWHM / 2.3548). velocity_is_fwhm applies to kind='virial' only; a Keplerian rotation velocity is never a line width and is used as given. Errors are propagated linearly from velocity, radius and inclination errors. Limits: M scales with distance (r in arcsec); the mass-inclination degeneracy dominates for low i; pressure support and self-gravity are not separated from the central mass. |
| virial_parameterA | Virial parameter alpha_vir = 5 sigma^2 R / (G M) (Bertoldi and McKee 1992), called alpha_5 here. sigma: 1D velocity dispersion (km/s); pass a FWHM with sigma_is_fwhm. R: radius in pc, or give radius_from_sigma_r_pc so R = 1.91 sigma_r (Solomon et al. 1987 convention). For rho ~ r^-k: a = (1 - k/3)/(1 - 2k/5), alpha_E = 2 E_K/|E_G| = alpha_5 / a; equilibrium alpha_5 = a, bound if alpha_5 < 2a (equivalently alpha_E < 2). Never apply a profile-corrected coefficient and then also the 2a threshold. Limits: the mass conversion (alpha_CO, dust T and kappa) dominates; unresolved clouds give limits only; surface pressure and magnetic terms are ignored. |
| toomre_qA | Toomre Q stability parameter. mode='gas': Q = sigma kappa / (pi G Sigma) (gas, Toomre 1964 fluid form). mode='stars': Q = sigma_R kappa / (3.36 G Sigma) (collisionless). mode='keplerian_disk': protoplanetary disk, Q = c_s Omega / (pi G Sigma) with Omega = kappa = sqrt(G M*/r^3) and c_s = sqrt(k T / (mu m_H)), mu default 2.3; needs m_star_msun, radius_au, temperature_k and a surface density. mode='two_fluid': Romeo and Wiegert 2011 with thickness corrections T = 0.8 + 0.7 sigma_z/sigma_R: 1/Q = W/(T_s Q_s) + 1/(T_g Q_g) if T_s Q_s >= T_g Q_g, else 1/(T_s Q_s) + W/(T_g Q_g), W = 2 sigma_s sigma_g / (sigma_s^2 + sigma_g^2), with Q_s = sigma_s kappa/(pi G Sigma_s) as in RW11. kappa: give kappa_kms_kpc, or rotation_velocity_kms and radius_kpc with kappa = epicyclic_a V/R with a = sqrt(2 (1 + dlnV/dlnR)): sqrt(2) for a flat curve, sqrt(3) for V ~ R^0.5, 2 for solid body. Limits: Sigma from dust or CO carries the conversion factor; thick or resolved-out emission makes Sigma a lower limit (Q an upper limit); observed dispersions include beam smearing; Q < 1-2 is not a sharp threshold. |
| fit_uv_modelA | Fit a parametric source model directly to visibilities (u, v, Re, Im, weight) from .npz or .csv. Models: point, gaussian (circular, FWHM), elliptical_gaussian (FWHM major, axis ratio, PA), uniform_disk (diameter, inclination, PA), ring (radius, Gaussian FWHM width via the thin-ring x Gaussian approximation, valid for width << radius; inclination, PA). All carry flux_jy and offsets dra_arcsec (east), ddec_arcsec. chi^2 = sum w [(Re - Re_m)^2 + (Im - Im_m)^2] with CASA WEIGHT = 1 / sigma^2 per real and per imaginary part. rescale_weights: 'none', or 'residual_scatter' (refit after scaling weights so the residual scatter of sqrt(w) (Re, Im) has unit robust std; pipeline weights are often off by factors 2-4). fixed: parameters to hold, e.g. {"dra_arcsec": 0}. uv_range_klambda: [min, max] selection. Starting offsets come from the peak of a coarse dirty map within search_radius_arcsec of the phase centre (unless given in initial); sizes, PA and inclination are grid-searched before the least-squares fit. Returns least-squares values with covariance errors (statistical only), reduced chi^2 and the weight scale; mcmc=True adds an emcee posterior (uniform priors in bounds; needs the [fit] extra). Limits: flux errors exclude the absolute flux scale (about 5-10%, add in quadrature); sizes near the resolution limit need S/N >= 8-10; the model sign convention matters for offsets (see model_visibilities). |
| deproject_and_binB | Phase-centre shift, deprojection and radial binning of visibilities. Shift: V' = V exp(+2 pi i (u dRA + v dDec)) moves a source at (dRA, dDec) to the phase centre. Deprojection: q = sqrt(q_maj^2 + (q_min cos i)^2) with q_maj along the PA (east of north) of the major axis. Each bin gives weighted means of Re and Im (weights = CASA WEIGHT) and errors 1/sqrt(sum w). Returns uv distance in klambda. Limits: assumes axisymmetry; Im is near zero only for a centred symmetric source, so residual Im flags offsets or asymmetry. |
| frank_profileA | Non-parametric 1D radial brightness profile with frank (Jennings et al. 2020), if installed. Wraps frank.radial_fitters.FrankFitter with a FixedGeometry (inclination, PA east of north, offsets). alpha (1.05 default, papers use 1.01-1.3) and weights_smooth (1e-4 default, 1e-1 to 1e-4 used) set the Gaussian-process prior; report both. Returns r (arcsec), I (Jy/sr) and 1-sigma errors. Limits: frank assumes axisymmetry; its uncertainties are likely underestimated; the innermost 1-2 beams are least reliable; visibility weights must be correctly scaled first. Without frank installed this returns the install command. |
| beam_and_brightnessA | Convert between Jy/beam and brightness temperature (K) for a Gaussian beam, and report beam areas. Rayleigh-Jeans: T = S c^2 / (2 k nu^2 Omega) = 1.222e6 S(Jy/beam) / (nu_GHz^2 bmaj bmin) with FWHMs in arcsec. planck=True uses the full Planck inversion T = (h nu / k) / ln(1 + 2 h nu^3 / (c^2 I_nu)) (no CMB term). direction: 'jy_to_k' (value in Jy/beam) or 'k_to_jy' (value in K). Limits: T_B equals the gas or dust temperature only for optically thick emission that fills the beam. |
| rms_from_line_freeA | Noise from line-free channels of a FITS cube (per-channel and median rms, robust MAD and plain std) or of a 1D spectrum. line_free_channels: [[start, end], ...] inclusive channel indices (cube channels are ordered by increasing velocity). Without it, all channels are used (biased high if the line is extended). Limits: primary-beam corrected cubes have noise rising toward the field edge; measure rms before PB correction or in the field centre. |
| largest_angular_scaleA | Maximum recoverable scale (MRS) and angular resolution from baseline lengths. Gives both conventions: the older ALMA Technical Handbook / Wilner and Welch (1994) form theta_MRS ~ 0.6 lambda / B_min, and the current Handbook form theta_MRS ~ 0.983 lambda / L05 with L05 the 5th percentile baseline; resolution ~ 0.574 lambda / L80 (80th percentile). The Handbook percentiles are over unique antenna pairs. Input: baselines_m (one projected length in metres per antenna pair), or a visibility file (u, v; with antenna id columns ant1/ant2 the percentiles use each pair's mean length, otherwise they are over visibility rows and say so), or just b_min_m (then only the 0.6 form). Limits: these are rules of thumb for smooth structure; flux on scales near the MRS is already partly lost (use flux_recovery for a model estimate) and the actual MRS depends on uv coverage and imaging. |
| flux_recoveryA | Rough fraction of a smooth source's total flux still seen on the shortest baseline. gaussian (size = FWHM): V(q)/V(0) = exp(-pi^2 theta^2 q^2 / (4 ln 2)); uniform_disk (size = diameter): 2 J1(pi D q)/(pi D q); q = B_min / lambda. Also gives the source sizes at which this fraction falls to 0.5 and 0.1. This is a note, not a measurement: actual recovery depends on the full uv coverage and on deconvolution, and is usually worse for extended emission. Remedy: add ACA 7 m and total power data. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 20 tools
Most tools target a clearly distinct quantity (spectral index, brightness temperature, dust mass, line luminosity, moment maps, uv fitting, imaging metrics), and the descriptions explicitly note which related tool to use instead. The main overlaps are dynamical_mass(kind='virial') versus virial_parameter, and lte_column_density versus rotational_diagram — both pairs analyse LTE excitation, but the descriptions differentiate single-line vs multi-line usage well enough.
All names are lowercase snake_case and readable, with descriptive noun phrases plus a few 'fit_*' prefixes and one verb-noun form (deproject_and_bin). The mix of noun-phrase names (line_luminosity) and verb-prefixed names (fit_uv_model) is a minor deviation but not confusing.
20 tools is on the heavy side for a single server and pushes against the practical limit for an agent choosing among them. Each tool does perform a genuinely distinct calculation, so nothing is clearly redundant, but the surface is broad enough that discoverability suffers.
Coverage of the radio/submm analysis domain is strong: SED and line fitting, moment maps, masks, gas/dust/dynamical masses, stability, uv-plane modelling, and array-scale diagnostics. Gaps exist for continuum subtraction, non-LTE/radiative-transfer excitation (e.g. RADEX-style), and explicit cube spectral extraction, which an agent would have to work around.