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

compute_cluster_counts

Compute per-catalogue cluster count histograms by redshift and cumulative mass or richness thresholds, outputting CSVs and a plot to compare survey depths or LCDM predictions.

Instructions

Histogram cluster counts: N(z) per redshift bin and cumulative N(>M500) (or N(>richness)), per catalogue.

Use to compare survey depths or as the observed side of predict_cluster_counts_lcdm.
Writes counts_nz.csv and counts_nm.csv (+ a PNG with both panels). Optical catalogues
without masses (des_y6_wazp) get N(>richness) rows in counts_nrich.csv instead of
N(>M500); m500_min is not applied to them (use richness_min).

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>",
      "catalogs": "<catalogs>"
    },
    "name": "compute_cluster_counts"
  }
}

Input Schema

NameRequiredDescriptionDefault
m_gridNoM500 thresholds [1e14 Msun] for N(>M) (default log 0.5..30).
z_edgesNoRedshift bin edges (default 0..1.6 step 0.1).
catalogsYesHarmonised CSVs from fetch_cluster_catalog and/or dataset keys (full catalogue).
m500_minNoMass threshold for N(z) in 1e14 Msun (None = all with z).
zmax_areaNodes_y6_wazp: divide each z bin by the footprint area whose ZMAX exceeds z (averaged over the bin; the depth-limited area where richness is complete), instead of the full 4544.7 deg^2. Pair with in_cosmo clusters.
output_dirYesDirectory for output files (created if missing).
richness_minNoRichness threshold for N(z) of optical catalogues (des_y6_wazp NGALS); ignored for SZ/X-ray.
richness_gridNoRichness thresholds for N(>richness) of optical catalogues (default log 5..300).
normalise_by_areaNoAlso give counts per deg^2 using each dataset's area.

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 supplied, the description carries the full burden and does disclose write side effects with concrete filenames (counts_nz.csv, counts_nm.csv, counts_nrich.csv, plus a two-panel PNG) and a non-obvious conditional branch where optical catalogues without masses get richness-based rows instead of M500 rows. It does not say whether existing files are overwritten or how long a run may take, which are the remaining behavioral gaps.

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?

Four sentences, front-loaded with the core operation before the routing hint and the file outputs. It is dense with abbreviations (N(z), N(>M500), ZMAX) but none are unexplained for this domain, and no sentence is filler.

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 9-parameter computation tool, the description covers what it computes, what it writes, and the one catalogue-specific exception that would otherwise cause a silent misuse of m500_min. An output schema exists so return values need not be explained, and the remaining omission is only overwrite/idempotency behavior.

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 baseline is 3. The description does add genuine cross-parameter meaning: m500_min is not applied to des_y6_wazp and richness_min should be used instead, which the schema does not state. That interaction knowledge is valuable but limited to one special case, so it does not push the score higher.

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 opening clause names a specific operation and its outputs: 'Histogram cluster counts: N(z) per redshift bin and cumulative N(>M500) (or N(>richness)), per catalogue.' The scope (per catalogue, two histogram types) is precise enough that an agent can distinguish this from predict_cluster_counts_lcdm and from plotting siblings without opening 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 clear positive guidance: 'Use to compare survey depths or as the observed side of predict_cluster_counts_lcdm,' which explicitly routes the agent to a named sibling for the predicted side. There is no explicit when-not guidance or prerequisite ordering (e.g. requiring fetch_cluster_catalog to run first), which keeps it short of a 5.

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