Weak Lensing Surveys MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| COSMO_MCP_DATA | No | Directory used for the data cache. | ~/.cache/cosmo-mcp/weak-lensing-mcp-server |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Weak Lensing Surveys MCP Server: public cosmic-shear / 3x2pt products of DES Y3, DES Y6 (published chains only; Y6 2pt data vectors not yet public), KiDS-1000, KiDS-Legacy and HSC Y3, in three kinds: catalogs = shear catalogue (KiDS-1000 gold, 21M galaxies, fetched as tile / patch / RA-Dec / tomographic-bin / row-limit subsets; DES Y3 312 GB HDF5 and HSC credentialed catalogues are not fetched); summary statistics = xi+-, COSEBIs, band powers, C_ell, n(z), covariance; published results = chains and S8 (COMPARISON ONLY, never data or an unlabelled prior). Start with list_wl_datasets / describe_wl_dataset; list_wl_skills for recipes (wl-tour first). Shear catalogue flow: fetch_shear_catalog -> plot_shear_catalog -> measure_shear_correlation (heavy; treecorr; weights, m-bias, c-term; compute_bmodes=True for the <M_x^2> B-mode null test) -> compare_measured_with_published_xi; measure_nz_from_catalog for the z_B histogram. Summary statistic flow: fetch_wl_datavector(dataset, statistic) -> CSV (bin1, bin2, angbin, x, value, error) + covariance .npy -> plot_shear_correlation / plot_covariance / compute_signal_to_noise; plot_redshift_distributions for n(z); predict_shear_correlation (CAMB halofit + Limber, GG only) for theory xi+- from a served or user n(z), with optional baryon P(k) ratio file (hydroemu output) and compare_dataset amplitude fit; fetch_wl_chain -> analyze_wl_chain (heavy) -> plot_s8_om_contours; fetch_des_y6_chain for DES Y6 chains (fiducial 3x2pt S8 0.789 +/- 0.011); compare_s8_with_published for S8 tension vs Planck 2018 (0.832 +/- 0.013). Conventions: theta in arcmin, xi dimensionless, bins 1-based (gammat: bin1 = lens, bin2 = source), S8 = sigma8 sqrt(Omega_m/0.3); published data vectors are uncut (no scale cuts applied by this server). Data download on first use into ~/.cache/cosmo-mcp/weak-lensing-mcp-server (override $COSMO_MCP_DATA); KiDS releases are 50-130 MB tarballs. HSC Y3 chains require HSC-SSP credentials: tools raise an error with manual-download instructions. Tools that write files take an output_dir and return ArtifactResult; pass file paths between tools, never raw arrays. Heavy tools can run on ALCF/NERSC via the hep-genesis IRI dispatch engine (set_dispatch / export_dispatch_pack); this server holds no facility credentials.
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 |
|---|---|
| list_wl_datasetsA | List the public datasets this server exposes. Call this first. Products are grouped as catalogs (object-level data), summary statistics (measurements with covariance) and published results (chains / parameter constraints, for comparison only). Build analyses on catalogs and summary statistics. Each entry also gives access (bundled vs downloaded on first use) and which tools read it. |
| describe_wl_datasetA | Full description of one dataset: products, units, conventions, URLs, citation. |
| list_wl_skillsA | List this server's skills: named multi-tool recipes. |
| load_wl_skillA | Load the full instructions of one of this server's skills and follow them. |
| fetch_shear_catalogA | Download a SUBSET of the KiDS-1000 gold weak-lensing shear catalogue as a slim FITS. |
| plot_shear_catalogA | QA plots of a shear catalogue: e1/e2 and weight histograms, z_B, and the sky footprint. |
| measure_shear_correlationA | Measure xi+(theta) and xi-(theta) per tomographic bin pair from a shear catalogue (optional B-mode test). |
| measure_nz_from_catalogA | Weighted photo-z histogram n(z) per tomographic bin from a shear catalogue. |
| compare_measured_with_published_xiA | Overlay your own catalogue-measured xi+/- on the released KiDS-1000 xi+/- (both summary statistics) per bin pair. |
| fetch_wl_datavectorA | Download one published 2pt statistic and write a tidy CSV. |
| plot_shear_correlationA | Triangle-of-bin-pairs plot of xi_+ (upper) and xi_- (lower), as in Amon+22 Fig. 1 / Asgari+21. |
| plot_redshift_distributionsA | Plot n(z) per tomographic bin (one panel per dataset) and write them to CSV. |
| plot_covarianceA | Plot the correlation matrix r_ij = C_ij / sqrt(C_ii C_jj) of a data vector. |
| compute_signal_to_noiseA | S/N = sqrt(d^T C^-1 d) of the published data vector, using its full covariance. Use for 'how significant is the detection' questions. Statistics listed together are combined with their cross-covariance (they must live in the same file, e.g. xip+xim, or all four DES 3x2pt blocks). No scale cuts are applied (DES files are uncut), so this is the raw measurement S/N. Writes a CSV summary. |
| fetch_wl_chainA | [Published result - for comparison only] Download a published MCMC/nested-sampling chain and write a slim CSV (published result, for comparison only). Use before analyze_wl_chain / plot_s8_om_contours. The CSV holds weight, omega_m, sigma_8, S_8 (derived as sigma_8 sqrt(Om/0.3) where the chain lacks it or has NaN) and h0 / w when present. DES chains are 5-50 MB each; KiDS chains come from the release tarball. HSC Y3 chains need HSC-SSP credentials (clear error + manual-download path). |
| analyze_wl_chainA | [Published result - for comparison only] Marginal S8, Omega_m, sigma8 (h, w) of a PUBLISHED chain (published result, for comparison only). Use to quote a survey's parameter constraints. Reports mean +/- std, median with 16/84% quantiles, 95% intervals, and the marginal mode with 68% HPD (KiDS papers quote MAP/mode + PJ-HPD; DES quotes mean +/- std). Heavy: downloads tens of MB; with set_dispatch it runs the chains.kernels.chain_marginals kernel on the facility instead. Sanity: des_y3 3x2pt_lcdm S8 = 0.776 +/- 0.017. |
| plot_s8_om_contoursA | [Published result - for comparison only] Overlay published 68/95% Omega_m - S8 (or sigma8) contours (published result, for comparison only). Use to reproduce the classic multi-survey S8-Om figure (DES Y3 Fig. 7 / Asgari+21 Fig. 5 style). Contours come from a weighted, smoothed 2D histogram (no getdist needed). The Planck S8 band is 0.832 +/- 0.013. |
| compare_s8_with_publishedA | [Published result - for comparison only] Compare S8 with published values: whisker plot vs Planck 2018 and tension in sigma (published result, for comparison only). Use for 'is there an S8 tension' questions. Tension per entry is the Gaussian difference-in-means (S8_ref - S8) / sqrt(sigma^2 + sigma_ref^2), taking the survey error on the side facing the reference for asymmetric errors. This is the simple 1D estimate the papers quote as a first number (DES Y3 3x2pt ~2.3 sigma, KiDS-1000 ~3 sigma, KiDS-Legacy < 1 sigma); full-posterior metrics differ at the few-0.1 sigma level. |
| fetch_des_y6_chainA | [Published result - for comparison only] DES Y6 published chain: download, weighted Om / sigma8 / S8 (w0, wa) summaries, contour (published result, for comparison only). Use for 'what does DES Y6 find' or to put your own analysis next to the DES Y6 posterior. Files come from the public DES Y6 chains_release (desdr-server.ncsa.illinois.edu/despublic/y6a2_files/y6_key/chains_release/) and are cached. Column names are read from the CosmoSIS header; Nautilus chains are weighted by exp(log_weight), csislike combined chains by their 'weights' column; non-finite / zero weights are dropped. Reports weighted mean, std and 16/50/84% quantiles. Writes a summary JSON, a slim chain CSV (weight, omega_m, sigma_8, S_8, ...; feeds plot_s8_om_contours / compare_s8_with_published) and optionally a PNG. Sanity (fiducial 3x2pt_lcdm): S8 = 0.789 +/- 0.012, Om = 0.333 +0.023/-0.028 (paper, arXiv:2601.14559); chain mean S8 = 0.789 +/- 0.011, Om = 0.325 +/- 0.023, sigma8 = 0.759 +/- 0.033. |
| predict_shear_correlationA | Predict cosmic-shear xi+(theta), xi-(theta) per tomographic bin pair (CAMB halofit + Limber + Hankel), optional baryons. |
| auth_statusA | Report the facility sign-in state THIS server sees for its own HPC dispatch (ALCF and NERSC). |
| export_dispatch_packA | Hand THIS server's compute kernels to the client for HPC runs. |
| get_dispatchA | Report where THIS server's heavy tools currently execute. |
| set_dispatchA | Set where THIS server's heavy tools execute: 'local' (this machine), 'polaris' (ALCF) or 'perlmutter' (NERSC). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| hpc-dispatch-handoff | Run this server's heavy kernels (catalogs.kernels.shear_correlation - treecorr xi+- from a shear catalogue; catalogs.kernels.kids1000_subset - KiDS-1000 catalogue subset; chains.kernels.chain_marginals - chain summary) on ALCF Polaris or NERSC Perlmutter through the hep-genesis IRI engine - client-side pack export (hosted) or server-side set_dispatch (own machine) |
| measure-kids1000-xi-from-catalogue | From shear catalogue to xi+- - fetch a ~75 deg^2 KiDS-1000 gold shear-catalogue subset, QA it, measure xi+/xi- in 5 tomographic bins with treecorr (weights, m-bias, c-term, jackknife), histogram n(z), and validate against the released KiDS-1000 xi+- with the area-scaled covariance; ~10 min, ~800 MB of Range reads |
| reproduce-des-y3-shear-figure | Reproduce the DES Y3 cosmic-shear xi+/xi- data figure (Amon+22 / Secco+22 Fig. 1 style), plus the KiDS-1000 / KiDS-Legacy / HSC Y3 equivalents |
| s8-tension-across-surveys | Published results (for comparison only) - quantify the S8 tension of DES Y6, DES Y3, KiDS-1000, KiDS-Legacy and HSC Y3 against Planck 2018 from the surveys' published chains; contours and a whisker plot with sigma tensions |
| wl-datavector-inspection | Inspect a weak-lensing data vector before using it - statistics available, n(z) per bin, covariance health (PD, condition number, correlations) and detection S/N, compared across DES Y3, KiDS and HSC Y3 |
| wl-tour | First-contact tour - KiDS-1000 shear catalogue subset -> your own xi+- and n(z) -> released data vectors, S/N and a fit-ready vector -> compare with published S8 (for comparison only); ~5-10 min, ~150 MB downloads |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 24 tools
Most tools target distinct resources and actions, and descriptions clearly separate catalogue-level work from published data-vector, chain, and theory workflows. There is minor overlap around published-result tools, especially fetch_des_y6_chain versus fetch_wl_chain/analyze_wl_chain/plot_s8_om_contours, and catalogue-fetching versus data-vector-fetching could still confuse a careless agent.
The set overwhelmingly uses snake_case verb_noun names such as fetch_shear_catalog, measure_shear_correlation, plot_covariance, and compare_s8_with_published. Minor deviations include inconsistent wl_ prefixes and the noun-first auth_status, but the naming remains readable and predictable.
With 24 tools, the surface is heavy for a single server, though the breadth reflects several real subdomains: catalogue access, measurement, published products, plotting, theory, and HPC dispatch. Some consolidation could reduce overlap, especially in published-chain and comparison tools.
The tool set covers the main weak-lensing lifecycle: dataset discovery, catalogue fetching, QA, correlation measurement, n(z), published data vectors and chains, covariance/S/N plotting, theory prediction, comparison, and HPC dispatch. Minor gaps remain, such as catalogue-measured covariance generation and more explicit scale-cut handling, but agents can mostly work around them.