Skip to main content
Glama
clusters-mcp-server
by HEP-KE

fit_cluster_wl_mass

Fits NFW weak-lensing masses to SPT-SZ Megacam cluster shear profiles, returning M500c and M200c with 68% intervals and published-mass comparisons.

Instructions

NFW weak-lensing mass of SPT-SZ Megacam clusters from their measured g_t(r) profiles.

Use after (or instead of) fetch_cluster_wl_profiles to get M500c and M200c [1e14 Msun]
with 68% intervals per cluster. Model (mirrors the release's lensing.py): NFW with c fixed
by c(M,z), Sigma_crit from each cluster's source N(z) via <beta>, reduced shear
g = gamma/(1-kappa) (1 + kappa(<beta^2>/<beta>^2 - 1)), Gaussian likelihood, flat prior in
ln M200c. Reports the ratio to the Dietrich+19 published masses where available. These
are raw NFW masses: no simulation-calibrated WL bias (~0.94) or LSS scatter is applied.

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_cluster_wl_mass"
  }
}

Input Schema

NameRequiredDescriptionDefault
hNoHubble parameter h (masses in Msun, not Msun/h).
Om0NoFlat LCDM Omega_m for distances.
clustersNoSPT IDs (e.g. 'SPT-CLJ0516-5430'); None = all 19 Megacam clusters.
r_max_mpcNoOuter fit radius [Mpc].
r_min_mpcNoInner fit radius [Mpc]. Profiles span 0.75-2.5 Mpc (Dietrich+19 range); the SPT likelihood uses 0.5-1.5.
output_dirYesDirectory for the mass table, JSON and PNG.
concentration_modelNoc(M,z): diemer15 (Diemer & Kravtsov 2015, used by Dietrich+19 and the SPT likelihood 'DK15'), diemer19, or duffy08 (Duffy+08 200c).diemer15

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 full disclosure burden and does so well: it names the mass model, concentration fixing, Sigma_crit treatment, reduced-shear correction, likelihood and prior, and explicitly warns the masses are raw NFW (no ~0.94 WL bias, no LSS scatter) and that a Dietrich+19 ratio is reported. What it omits is operational behavior — whether profile data must already be cached, expected runtime, and failure modes when a cluster lacks profiles.

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?

Purpose and outputs are front-loaded in the first two sentences, with model internals and caveats after. Density is high but nearly every clause is load-bearing; the 'mirrors the release's lensing.py' aside and the shear-correction formula are the one stretch of detail most agents won't need for selection.

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 a 7-parameter scientific fitting tool with an output schema present, the description is close to sufficient: it explains what is computed, the model assumptions, and that results are uncorrected raw NFW masses. The remaining gap is the prerequisite/state question — whether it reuses previously fetched profiles or performs its own data access.

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 every parameter is already documented in the schema, including the r_min/r_max fit-range caveat. The description adds only the mass-unit/interval context (M500c/M200c in 1e14 Msun at 68%), not per-parameter meaning beyond the schema. Baseline 3 is appropriate.

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 — 'NFW weak-lensing mass of SPT-SZ Megacam clusters from their measured g_t(r) profiles' — and names the exact outputs (M500c, M200c with 68% intervals). It explicitly distinguishes itself from the sibling fetch_cluster_wl_profiles, so an agent can route without opening either schema.

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?

Gives clear pipeline placement: 'Use after (or instead of) fetch_cluster_wl_profiles'. That is real when-to-use guidance tied to a named alternative. It stops short of stating when the 'instead of' path is preferable (e.g., cached profiles vs. re-fetch) or any cost/precondition difference.

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