Skip to main content
Glama
pickleton89

cBioPortal MCP Server

by pickleton89

get_genes

Retrieve detailed information about specific genes using Hugo symbols or Entrez IDs through a batch endpoint on the cBioPortal MCP Server, supporting cancer genomics research.

Instructions

Get information about specific genes by their Hugo symbol or Entrez ID using batch endpoint.

Input Schema

NameRequiredDescriptionDefault
gene_id_typeNoENTREZ_GENE_ID
gene_idsYes
projectionNoSUMMARY

Input Schema (JSON Schema)

{ "additionalProperties": false, "properties": { "gene_id_type": { "default": "ENTREZ_GENE_ID", "title": "Gene Id Type", "type": "string" }, "gene_ids": { "items": { "type": "string" }, "title": "Gene Ids", "type": "array" }, "projection": { "default": "SUMMARY", "title": "Projection", "type": "string" } }, "required": [ "gene_ids" ], "type": "object" }

Implementation Reference

  • Registers 'get_genes' (line 111) and other methods as MCP tools using FastMCP.add_tool
    def _register_tools(self): """Register tool methods as MCP tools.""" # List of methods to register as tools (explicitly defined) tool_methods = [ # Pagination utilities "paginate_results", "collect_all_results", # Studies endpoints "get_cancer_studies", "get_cancer_types", "search_studies", "get_study_details", "get_multiple_studies", # Genes endpoints "search_genes", "get_genes", "get_multiple_genes", "get_mutations_in_gene", # Samples endpoints "get_samples_in_study", "get_sample_list_id", # Molecular profiles endpoints "get_molecular_profiles", "get_clinical_data", "get_gene_panels_for_study", "get_gene_panel_details", ] for method_name in tool_methods: if hasattr(self, method_name): method = getattr(self, method_name) self.mcp.add_tool(method) logger.debug(f"Registered tool: {method_name}") else: logger.warning(f"Method {method_name} not found for tool registration")
  • The registered MCP tool handler for 'get_genes', which delegates to the GenesEndpoints implementation.
    async def get_genes( self, gene_ids: List[str], gene_id_type: str = "ENTREZ_GENE_ID", projection: str = "SUMMARY", ) -> Dict: """Get information about specific genes by their Hugo symbol or Entrez ID using batch endpoint.""" return await self.genes.get_genes(gene_ids, gene_id_type, projection)
  • Core handler logic in GenesEndpoints class: performs the API POST request to 'genes/fetch' to retrieve batch gene information.
    @handle_api_errors("get genes") async def get_genes( self, gene_ids: List[str], gene_id_type: str = "ENTREZ_GENE_ID", projection: str = "SUMMARY", ) -> Dict: """ Get information about specific genes by their Hugo symbol or Entrez ID using batch endpoint. Args: gene_ids: List of gene IDs (Entrez IDs or Hugo symbols) gene_id_type: Type of gene ID provided (ENTREZ_GENE_ID or HUGO_GENE_SYMBOL) projection: Level of detail to return (ID, SUMMARY, DETAILED) Returns: Dictionary with gene information """ try: params = {"geneIdType": gene_id_type, "projection": projection} gene_data = await self.api_client.make_api_request( "genes/fetch", method="POST", params=params, json_data=gene_ids ) return {"genes": gene_data} except Exception as e: return {"error": f"Failed to get gene information: {str(e)}"}

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/pickleton89/cbioportal-mcp'

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