Skip to main content
Glama
Supernova Cosmology MCP Server

Supernova Cosmology MCP Server

fit_sn_cosmology

Fits flat LCDM, wCDM, or w0waCDM models to a Type Ia supernova sample with full covariance and marginalised M/H0, then writes best-fit summaries and contour data.

Instructions

Fit flat LCDM / wCDM / w0waCDM to one SN sample on a grid (+ Nelder-Mead refinement).

Use for SN-only cosmology: full stat+sys covariance, offset M/H0 marginalised
analytically, flat priors over the grid. Writes `<tag>_summary.json` (best fit, chi2,
1D marginal mean/sd/68/95%), `<tag>_1d_<p>.csv` and `<tag>_2d_<a>_<b>.csv` (posterior,
profile chi2 and in_68/in_95 HPD flags) for plot_sn_contours. Heavy: w0wacdm with
the default 41^3 grid on Pantheon+ takes a few minutes locally. When set_dispatch
points at an HPC site it runs as one facility job (kernel sn.kernels.fit_sn_cosmology).
SN alone barely constrain w0wa; expect posteriors hitting prior edges (flagged).
Sanity: Pantheon+ lcdm Om = 0.334 +- 0.018 (Brout+22); DES-SN5YR 0.352 +- 0.017.

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": {
      "output_dir": "<output_dir>"
    },
    "name": "fit_sn_cosmology"
  }
}

Input Schema

NameRequiredDescriptionDefault
zmaxNoUpper z cut.
zminNoz cut (None = release standard: Pantheon+ 0.01).
modelNolcdm (flat, Om) | wcdm (flat, Om+w) | w0wacdm (flat CPL, Om+w0+wa).lcdm
n_gridNoGrid points per parameter (0 = 401/121/41 by model).
datasetNoSN sample.pantheonplus
w_rangeNo[lo, hi] prior on w (wcdm; default [-2, -0.3]).
Om_rangeNo[lo, hi] flat prior on Om (default [0.05, 0.65]).
w0_rangeNo[lo, hi] prior on w0 (default [-2, 0]).
wa_rangeNo[lo, hi] prior on wa (default [-6, 3]).
output_dirYesDirectory for summary JSON + marginal/contour CSVs.
calibratorsNoPantheon+ calibrators include | exclude | only.include

Output Schema

NameRequiredDescriptionDefault
filesYes
statusYes
messageYes
metadataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and mostly does: covariance handling, analytic marginalisation of M/H0, flat priors, exact output filenames and their contents, HPC dispatch behaviour via set_dispatch, and runtime cost ('a few minutes' for w0wacdm on a 41^3 grid). It also warns that SN-only data barely constrains w0wa and that posteriors hitting prior edges get flagged, which is exactly the failure-mode context an agent needs.

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 scoped to outputs, cost, and caveats in a sensible order. Some fragments ('kernel sn.kernels.fit_sn_cosmology', very specific sanity values) are dense but each serves the agent's decision, so little waste.

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 11-parameter, compute-heavy fitting tool this covers cost, outputs, dispatch mode, and interpretive caveats well; the existing output schema handles return values. It doesn't say how the SN sample is loaded or whether existing output files are overwritten, which keeps it short of fully complete.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already explains every parameter including prior ranges and n_grid defaults. The description adds conceptual context (priors over the grid, M/H0 marginalised) but no per-parameter meaning beyond that, so it sits at the schema-driven baseline.

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 flat LCDM / wCDM / w0waCDM to one SN sample'), including the method ('on a grid (+ Nelder-Mead refinement)'). This clearly separates it from siblings like compute_sn_chi2 and plot_sn_contours, which do scoring/plotting rather than fitting.

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?

'Use for SN-only cosmology' gives clear scope, and the note that output feeds plot_sn_contours tells the agent where this fits in a workflow. It doesn't name what to use instead for combined probes or for fixed-model chi2 evaluation, so explicit alternatives are missing.

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