Skip to main content
Glama

analyze_cnv

DestructiveIdempotent

Analyze copy number variations (CNVs) in spatial transcriptomics data.

Instructions

Analyze copy number variations (CNVs) in spatial transcriptomics data.

Args:
    data_id: Dataset identifier
    params: Required - reference_key, reference_categories, and optional method/thresholds.

Gene positions missing from adata.var are annotated from bundled Ensembl 110
tables (species: human GRCh38 or mouse GRCm39). exclude_gene_classes removes
immunoglobulin, ribosomal, mitochondrial or HLA genes from the CNV input;
query_categories restricts CNV clustering to those reference_key categories.

Input Schema

NameRequiredDescriptionDefault
paramsYes
data_idYes

Output Schema

NameRequiredDescriptionDefault
methodYes
data_idYes
warningsNoNon-fatal conditions that may affect result interpretation.
cnv_score_keyNo
n_chromosomesYes
n_query_cellsNoObservations clustered when query_categories restricts clustering.
reference_keyYes
gene_positionsNoSource of gene positions: 'adata.var', or the bundled table with the number of genes matched by Ensembl ID and by symbol.
n_genes_analyzedYes
n_genes_excludedNoGenes matched by each excluded gene class or name pattern.
reference_categoriesYes
visualization_availableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv1.6.0
    • addedInput schema / $defs / CNVParameters / properties / exclude_gene_classes
      Added value: +{
      +  "description": "Gene classes removed from the CNV input before inference: immunoglobulin (IGH/IGK/IGL V, D, J and constant genes, JCHAIN, IGLL1, IGLL5), ribosomal (RPL*/RPS* except RPS6K* and RPS19BP1), mitochondrial (MT-*), hla (HLA-*, mouse H2-*). Names match case-insensitively. infercnvpy only.",
      +  "items": {
      +    "enum": [
      +      "immunoglobulin",
      +      "ribosomal",
      +      "mitochondrial",
      +      "hla"
      +    ],
      +    "type": "string"
      +  },
      +  "title": "Exclude Gene Classes",
      +  "type": "array"
      +}
    • addedInput schema / $defs / CNVParameters / properties / exclude_gene_patterns
      Added value: +{
      +  "description": "Gene-name wildcard patterns removed from the CNV input before inference (case-sensitive, e.g. ['IGH*', 'MALAT1']). infercnvpy only.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Exclude Gene Patterns",
      +  "type": "array"
      +}
    • addedInput schema / $defs / CNVParameters / properties / gene_positions
      Added value: +{
      +  "default": "auto",
      +  "description": "Source of gene chromosome/start/end. 'provided': adata.var columns. 'annotate': bundled Ensembl 110 table for species (GRCh38 or GRCm39), matched on Ensembl gene ID when var has one, otherwise on gene symbol. 'auto': provided if all three columns exist, otherwise annotate. infercnvpy only.",
      +  "enum": [
      +    "auto",
      +    "provided",
      +    "annotate"
      +  ],
      +  "title": "Gene Positions",
      +  "type": "string"
      +}
    • addedInput schema / $defs / CNVParameters / properties / query_categories
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Categories of reference_key whose observations are clustered by CNV profile (cluster_cells=True), e.g. ['tumor_enriched']. Inference still uses every observation; others get no cnv_clusters label. None clusters all observations.",
      +  "title": "Query Categories"
      +}
    • addedInput schema / $defs / CNVParameters / properties / species
      Added value: +{
      +  "default": "human",
      +  "description": "Species of the bundled gene-position table used by gene_positions.",
      +  "enum": [
      +    "human",
      +    "mouse"
      +  ],
      +  "title": "Species",
      +  "type": "string"
      +}
    • addedOutput schema / properties / gene_positions
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Source of gene positions: 'adata.var', or the bundled table with the number of genes matched by Ensembl ID and by symbol.",
      +  "title": "Gene Positions"
      +}
    • addedOutput schema / properties / n_genes_excluded
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "integer"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Genes matched by each excluded gene class or name pattern.",
      +  "title": "N Genes Excluded"
      +}
    • addedOutput schema / properties / n_query_cells
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Observations clustered when query_categories restricts clustering.",
      +  "title": "N Query Cells"
      +}
  2. Changed6 schema fields changedv1.3.2
    • addedInput schema / $defs / CNVParameters / additionalProperties
      Added value: +false
    • changedInput schema / $defs / CNVParameters / properties / numbat_genome / enum
      Previous value: -[
      -  "hg38",
      -  "hg19",
      -  "mm10",
      -  "mm39"
      -]New value: +[
      +  "hg38",
      +  "hg19",
      +  "mm10"
      +]
    • addedInput schema / additionalProperties
      Added value: +false
    • addedOutput schema / additionalProperties
      Added value: +false
    • removedOutput schema / properties / statistics
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Statistics"
      -}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "description": "Non-fatal conditions that may affect result interpretation.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Warnings",
      +  "type": "array"
      +}
  3. First observedv1.2.7

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare destructiveHint=true and readOnlyHint=false, yet the description never says that the dataset is modified or what results get written (cnv_clusters labels are only mentioned in passing via query_categories). It does add real value on gene-position sourcing from bundled Ensembl 110 tables and on what exclude_gene_classes strips from the input, but the mutation surface remains undisclosed.

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?

One-sentence purpose up front, then a compact Args block, then behavior notes. A few sentences restate schema-level detail (gene_positions source, exclude_gene_classes contents) but nothing is filler.

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

Completeness3/5

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

An output schema exists and the nested params model is richly annotated, so return values need not be explained. The gap is behavioral: for a destructive, non-read-only operation, the description gives no warning that analysis results are persisted or that re-running may overwrite existing labels.

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?

Top-level schema coverage is 0% (data_id undocumented, params is a bare $ref), so the description must carry weight; it names the required fields and explains gene_positions fallback and query_categories filtering semantics. However, the nested CNVParameters schema already documents most of these in depth, so the description's marginal gain is modest.

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 — 'Analyze copy number variations (CNVs) in spatial transcriptomics data' — which is unique among the siblings (none of which touch CNV). An agent can distinguish it immediately from find_markers, deconvolve_data, or identify_spatial_domains.

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?

The Args block flags which params are required (reference_key, reference_categories) and which are optional, giving implied preconditions. But it never says when to choose this tool over alternatives, nor when CNV analysis is inappropriate (e.g. no reference labels, no allele data for numbat).

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