Skip to main content
Glama

preprocess_data

Destructive

Run quality control, filtering, normalization, and highly variable gene selection on spatial transcriptomics data. Prepares datasets for downstream embedding and clustering workflows.

Instructions

Run QC, filtering, normalization, and highly variable gene selection.

This tool does not compute PCA, UMAP, clustering, or neighbor graphs. Run
compute_embeddings() afterward when downstream tools require those artifacts.

Args:
    data_id: Dataset ID
    params: Preprocessing parameters (all have sensible defaults)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNo
data_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
n_hvgsYes
data_idYes
n_cellsYes
n_genesYes
clustersYesClusters computed during preprocessing. This is zero because clustering is performed by compute_embeddings.
warningsNoNon-fatal conditions that may affect result interpretation.
qc_metricsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed10 schema fields changedv1.3.2
    • addedInput schema / $defs / PreprocessingParameters / additionalProperties
      Added value: +false
    • removedInput schema / $defs / PreprocessingParameters / properties / clustering_key
      Removed value: -{
      -  "default": "leiden",
      -  "description": "Key name for clustering results in obs.",
      -  "title": "Clustering Key",
      -  "type": "string"
      -}
    • removedInput schema / $defs / PreprocessingParameters / properties / clustering_resolution
      Removed value: -{
      -  "default": 1,
      -  "description": "Leiden clustering resolution. Higher (1.5-2.0) for more clusters, lower (0.2-0.5) for fewer.",
      -  "exclusiveMinimum": 0.1,
      -  "maximum": 2,
      -  "title": "Clustering Resolution",
      -  "type": "number"
      -}
    • removedInput schema / $defs / PreprocessingParameters / properties / n_neighbors
      Removed value: -{
      -  "default": 15,
      -  "description": "Neighbors for k-NN graph. Larger (20-50) for global structure, smaller (5-10) for local patterns.",
      -  "exclusiveMinimum": 2,
      -  "maximum": 100,
      -  "title": "N Neighbors",
      -  "type": "integer"
      -}
    • removedInput schema / $defs / PreprocessingParameters / properties / n_pcs
      Removed value: -{
      -  "default": 30,
      -  "description": "Number of principal components for PCA.",
      -  "exclusiveMinimum": 0,
      -  "maximum": 100,
      -  "title": "N Pcs",
      -  "type": "integer"
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • addedOutput schema / additionalProperties
      Added value: +false
    • addedOutput schema / properties / clusters / description
      Added value: +"Clusters computed during preprocessing. This is zero because clustering is performed by compute_embeddings."
    • changedOutput schema / properties / qc_metrics / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "string"
      +        }
      +      ]
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "description": "Non-fatal conditions that may affect result interpretation.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Warnings",
      +  "type": "array"
      +}
  2. First observedv1.2.7

TDQS

A3.7/5.0
Behavior2/5

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

Annotations indicate destructiveHint=true, but the description does not elaborate on what is destroyed or modified (e.g., whether it overwrites existing data, irreversibility, or side effects). The only behavioral note is a negative scope (not computing embeddings), which is more purpose-related than a behavioral disclosure. With a destructive hint, the description should warn about data overwrite or similar consequences.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: it opens with the primary purpose, then clarifies scope limits, and ends with a compact Args section. Every sentence adds value without redundancy, making it easy for an agent to quickly grasp the tool's core function.

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?

Given the tool's complexity (many parameters, destructive behavior) and the lack of output schema details, the description is somewhat minimal. It covers purpose and the boundary with compute_embeddings, but it omits prerequisites (e.g., data must already be loaded), side effects of the destructive operation, and what the function returns. This is adequate but with clear gaps.

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?

The input schema itself provides detailed descriptions for each parameter, so the baseline is 3. The description adds only minimal value by saying 'all have sensible defaults,' which helps convey that params can be omitted, but it does not explain any parameter semantics beyond that. The schema carries the heavy lifting for parameter understanding.

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 clearly states the tool's function with a specific verb and resource: 'Run QC, filtering, normalization, and highly variable gene selection.' It also explicitly differentiates itself from a sibling tool by stating it does not compute PCA, UMAP, clustering, or neighbor graphs, and directs users to compute_embeddings() when those artifacts are needed.

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?

The description provides clear context by stating that compute_embeddings() should be run afterward when downstream tools require those artifacts. This implies the tool's role in the analysis pipeline, but it does not explicitly mention when not to use this tool or list alternative preprocessors, so there is room for improvement.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cafferychen777/ChatSpatial'

If you have feedback or need assistance with the MCP directory API, please join our Discord server