Skip to main content
Glama

check_gene

Verify the presence of genes in adata.var_names to ensure accurate gene expression visualizations and color-coding in single-cell RNA sequencing analysis.

Instructions

Check if genes exist in adata.var_names. This tool should be called before gene expression visualizations or color by genes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
var_namesNogene names.

Implementation Reference

  • The core handler function implementing the check_gene tool logic. It checks if each provided gene name exists in the AnnData object's var_names and returns a dictionary mapping gene to boolean existence.
    def check_gene(adata, var_names): return {v: v in adata.var_names for v in var_names}
  • Pydantic model defining the input schema for check_gene tool, requiring a list of var_names (gene names). Used in the tool's inputSchema.
    class VarNamesModel(JSONParsingModel): """ListObsModel""" var_names: List[str] = Field( default=None, description="gene names." )
  • MCP Tool registration defining the check_gene tool with name, description, and input schema reference.
    check_gene_tool = types.Tool( name="check_gene", description="Check if genes exist in adata.var_names. This tool should be called before gene expression visualizations or color by genes.", inputSchema=VarNamesModel.model_json_schema(), )
  • Registration of the handler function in the util_func dictionary, used by run_util_func to dispatch tool calls to the implementation.
    util_func = { "mark_var": mark_var, "list_var": list_var, "list_obs": list_obs, "check_gene": check_gene, "merge_adata": merge_adata, }
  • Registration of the Tool object in util_tools dictionary, exposed via tool/__init__.py for higher-level MCP server integration.
    util_tools = { "mark_var": mark_var_tool, "list_var": list_var_tool, "list_obs": list_obs_tool, "check_gene": check_gene_tool, "merge_adata": merge_adata_tool, }

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/huang-sh/scmcp'

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