Skip to main content
Glama
Weak Lensing Surveys MCP Server

Weak Lensing Surveys MCP Server

measure_nz_from_catalog

Builds weighted photo-z n(z) histograms per tomographic bin from a shear catalogue to show which redshifts a selected subset probes.

Instructions

Weighted photo-z histogram n(z) per tomographic bin from a shear catalogue.

Use for 'what redshifts does my subset probe'. This is the naive
lensfit-weighted z_B histogram; by construction each bin is confined
to its z_B edges and lacks the outlier tails that the released,
SOM-calibrated n(z) (Hildebrandt+21, Wright+20) has - so its mean z
sits below the calibrated one for the high bins. Treat the release
n(z) as the analysis-grade product; this tool shows the selection.

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

Input Schema

NameRequiredDescriptionDefault
dzNoHistogram bin width.
z_columnNoPhoto-z column to histogram (BPZ z_B).z_b
output_dirYesDirectory where output files are written.
catalog_fitsYesSlim FITS from fetch_shear_catalog.
compare_releaseNoOverlay the released KiDS-1000 SOM n(z).

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
Behavior4/5

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

With no annotations, the description carries the full burden and delivers unusually rich behavioral context: the histogram is naive lensfit-weighted z_B, each bin is confined to its z_B edges, it lacks the outlier tails of the calibrated release, and its mean z is biased low for high bins. It is silent on runtime cost and only implicitly (via the schema) indicates that files are written to output_dir.

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 resource statement is front-loaded and every sentence carries scientific meaning about validity. The middle clause is somewhat dense and long, but the wording is not padding and the caveat ordering (what it is, then how it differs, then how to treat it) is logical.

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?

An output schema exists, so return values need no explanation, and the description covers purpose, usage, and interpretive limits well. The remaining gap is workflow context: it does not state that catalog_fits comes from fetch_shear_catalog, which the schema only hints at.

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 the parameters (dz, z_column, catalog_fits, output_dir, compare_release) are already documented. The description adds modest meaning by explaining that the comparison target is the SOM-calibrated released n(z), but it does not explain binning behavior or the implications of dz beyond what the schema states.

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 opens with a specific verb and resource: a weighted photo-z histogram n(z) per tomographic bin computed from a shear catalogue. It also names the consumer question it answers ('what redshifts does my subset probe') and distinguishes its output from the released SOM-calibrated n(z), so an agent can separate it from plotting or catalog-fetch siblings without reading the 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?

It gives an explicit when-to-use trigger ('what redshifts does my subset probe') and a clear when-not-to: treat the release n(z) as the analysis-grade product and use this only to show selection. The gap is that it never names the sibling tool or dataset that supplies the release n(z), leaving the agent to find it elsewhere.

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