Skip to main content
Glama
pickleton89

cBioPortal MCP Server

by pickleton89

get_genes

Retrieve detailed information about cancer-related genes by providing Hugo symbols or Entrez IDs, enabling analysis of genomic data from cBioPortal studies.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idsYes
gene_id_typeNoENTREZ_GENE_ID
projectionNoSUMMARY

Implementation Reference

  • MCP tool handler for 'get_genes' that delegates execution 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 for fetching gene information via cBioPortal's batch genes/fetch API endpoint.
    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)}"}
  • Registration of MCP tools including 'get_genes' via FastMCP.add_tool in the tool_methods list.
    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")

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