check_gene
Verify gene presence in single-cell RNA sequencing data before creating visualizations or coloring by genes, ensuring accurate analysis.
Instructions
Check if genes exist in adata.var_names. This tool should be called before gene expression visualizations or color by genes.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_gene"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| var_names | No | gene names. |
Implementation Reference
- src/scmcp/tool/util.py:80-82 (handler)The core handler function that implements the check_gene tool: returns a dictionary {gene: exists} for each gene in var_names against adata.var_names.
def check_gene(adata, var_names): return {v: v in adata.var_names for v in var_names} - src/scmcp/schema/util.py:45-51 (schema)Pydantic model defining the input schema for check_gene: expects a list of gene names (var_names).
class VarNamesModel(JSONParsingModel): """ListObsModel""" var_names: List[str] = Field( default=None, description="gene names." ) - src/scmcp/tool/util.py:34-38 (registration)MCP Tool object creation for 'check_gene', specifying name, description, and input schema. This tool is later included in util_tools dict used by the server.
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(), ) - src/scmcp/tool/util.py:98-104 (registration)util_tools dictionary that maps tool names to Tool instances, imported and used in server.py for MCP tool registration.
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, }