Skip to main content
Glama
Supernova Cosmology MCP Server

Supernova Cosmology MCP Server

compute_distance_modulus

Computes theory distance modulus μ(z) for a chosen w0waCDM cosmology and redshift grid, writing a CSV for Hubble-diagram overlays or cosmology comparisons.

Instructions

Theory distance modulus mu(z) = 5 log10(D_L/10pc) for a given cosmology (w0waCDM, curvature).

Use for theory curves to overlay on a Hubble diagram, or to quantify how much two
cosmologies differ in mu (the CSV includes mu minus flat LCDM Om=0.3, offset-free at
low z). Radiation is neglected (< 1e-4 mag for z < 3). Cross-checked against
astropy.cosmology in the tests.

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": "compute_distance_modulus"
  }
}

Input Schema

NameRequiredDescriptionDefault
H0NoH0 [km/s/Mpc]; only shifts mu by a constant.
OkNoCurvature Omega_k (0 = flat).
OmNoMatter density Omega_m.
w0NoDark-energy w0 (CPL).
waNoDark-energy wa (CPL, w = w0 + wa(1-a)).
z_maxNoHighest redshift.
z_minNoLowest redshift.
n_pointsNoNumber of log-spaced redshifts.
output_dirYesDirectory for the CSV.

Output Schema

NameRequiredDescriptionDefault
filesYes
statusYes
messageYes
metadataYes

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 behavioral burden and discloses useful details: the output CSV includes mu relative to flat LCDM Om=0.3, radiation is neglected below 1e-4 mag for z < 3, and the implementation is cross-checked against astropy.cosmology. It does not describe file writing behavior, overwrite rules, or error handling, but the key scientific assumptions are transparent.

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?

The description is front-loaded with the formula and purpose, followed by usage context and scientific caveats. It is appropriately sized with little wasted wording, though the final validation note is less essential than the physics assumptions.

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?

The tool has nine parameters and an output schema, and the description supplies purpose, use cases, physics approximations, and CSV contents. Operational details about the output file are left to the schema and output schema, which is acceptable, but a brief note on file naming or overwrite behavior would improve completeness.

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 description coverage is 100%, so parameter meanings are already fully documented in the schema. The description adds cosmology context such as w0waCDM and curvature but does not add significant per-parameter semantics beyond what the schema provides.

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?

The description states a specific computation: the theory distance modulus mu(z) = 5 log10(D_L/10pc) for a w0waCDM cosmology with curvature. It also distinguishes the output as theory curves for Hubble diagrams or cosmology comparisons, making the tool's role clear against siblings such as fitting or plotting tools.

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?

It gives clear when-to-use guidance: overlay theory curves on a Hubble diagram or quantify differences between cosmologies in mu. It does not explicitly name alternatives or when not to use it, but the intended use context is well specified.

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