Skip to main content
Glama
Weak Lensing Surveys MCP Server

Weak Lensing Surveys MCP Server

predict_shear_correlation

Predict theoretical cosmic-shear correlation functions xi+ and xi- for tomographic bin pairs using CAMB, Limber, and Hankel transforms, with optional baryon corrections and dataset comparison.

Instructions

Predict cosmic-shear xi+(theta), xi-(theta) per tomographic bin pair (CAMB halofit + Limber + Hankel), optional baryons.

Pure GG lensing signal: no intrinsic alignments, shear bias, or photo-z
shifts. P_NL(k,z) from CAMB (halofit, normalised to sigma8);
C_ell by the Limber approximation (k = (ell+1/2)/chi) in flat
cosmology; xi+- by dense Bessel J0/J4 quadrature to ell = 1e5. With
baryon_file the ratio S(k[,z]) multiplies P(k) (S -> 1 below the
tabulated k, held at its last value above), and the output also gives
the DMO prediction and the ratio xi_baryon / xi_dmo. Writes
theory_xipm.csv (bin1, bin2, theta_arcmin, xip, xim[, xip_dmo, xim_dmo,
ratio_xip, ratio_xim]) and, with plot, a triangle figure. Needs camb
(pip install camb). ~5-15 s. Validation: KiDS-1000 n(z), Om=0.27,
S8=0.76 -> served KiDS-1000 xi+ / theory = 0.90 +/- 0.03 (0.5-75
arcmin; the remaining deficit is mostly intrinsic alignments, absent
here).

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

Input Schema

NameRequiredDescriptionDefault
hNoH0 / 100.
ObNoOmega_b.
OmNoOmega_m (total matter, incl. neutrinos).
S8NoS8 = sigma8 sqrt(Om/0.3); used if sigma8 is not given.
nsNoScalar spectral index.
mnuNoSum of neutrino masses [eV].
plotNo
sigma8Nosigma8 (give this or S8).
halofitNoCAMB halofit_version: takahashi, mead2020, mead (HMcode2016), original, bird.takahashi
bin_pairsNo1-based tomographic pairs, e.g. [[1,1],[1,2]]; default all i<=j.
nz_sourceNon(z): 'kids_1000', 'kids_legacy', 'des_y3', 'hsc_y3' (the release n(z) this server serves) or a path to a text/CSV file with columns z, n_1(z), n_2(z), ...kids_1000
output_dirYesDirectory where output files are written.
baryon_fileNoOptional P_hydro/P_dmo ratio CSV multiplied into P(k): hydroemu-mcp-server Pk-ratio output ('# ' header lines, columns x = k [h/Mpc], y_mean = ratio) or plain k[h/Mpc], z, ratio (z-dependent) / k, ratio. Without z the ratio is applied at all redshifts.
theta_arcminNoAngular separations [arcmin]; default 20 log-spaced values 0.5-300.
compare_datasetNoOverlay the served xi+ data vector of this dataset (same n(z) recommended) and fit a single amplitude A = data / theory.

Output Schema

NameRequiredDescriptionDefault
filesYes
statusYes
messageYes
metadataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: it names the external dependency (camb), reports runtime (~5-15 s), specifies exactly which files are written and their columns, explains the baryon ratio's treatment above/below the tabulated k range and the extra DMO columns, and discloses modelling exclusions (no intrinsic alignments, shear bias, or photo-z shifts). It even provides an external validation benchmark.

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?

It is a dense multi-sentence block, but the core action is front-loaded in the first line and every later sentence carries information an agent would otherwise have to guess. Some physics detail (the k = (ell+1/2)/chi substitution, ell = 1e5 cutoff) is background rather than invocation-relevant and could be trimmed for a tighter read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 15-parameter scientific tool with an output schema, the description covers the practical gaps: dependency, runtime, output files, file formats, optional branches, and known model limitations. An agent can decide whether to call it and what to expect from the output without further clarification.

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

Parameters4/5

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

Schema description coverage is already 93%, so the baseline would be 3, but the prose adds genuine meaning for the non-obvious parameters: baryon_file's accepted formats and S(k[,z]) treatment, and compare_dataset's overlay-plus-single-amplitude-A fit. It also states the default theta range and the n(z) dataset options in context, though cosmology parameters (Om, S8, halofit) are left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb and resource: predict xi+(theta) and xi-(theta) per tomographic bin pair, with the method (CAMB halofit + Limber + Hankel) and the physical scope ('pure GG lensing signal'). The word 'predict' plus the theory-only framing implicitly separates it from measure_shear_correlation, but no sibling is named explicitly, so differentiation is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied rather than stated: the reader can infer this is for theory predictions to compare against measured data, aided by the compare_dataset parameter and the KiDS-1000 validation sentence. There is no explicit 'use this when...' or 'use X instead when...' guidance, and no statement of when the baryon or compare options are appropriate.

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