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")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the 'batch endpoint' which implies handling multiple genes at once, but doesn't describe rate limits, error handling for invalid IDs, response format, or whether this is a read-only operation. The description is minimal and leaves critical behavioral traits unspecified for a tool with 3 parameters.

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 a single, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for a straightforward retrieval tool and front-loads the essential information about what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, 0% schema description coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what information is returned about genes, how results are structured, error conditions, or usage constraints. The description leaves too many gaps given the tool's complexity and lack of supporting documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds minimal parameter context. It mentions 'Hugo symbol or Entrez ID' which relates to 'gene_id_type' and 'gene_ids', but doesn't explain the 'projection' parameter at all or provide format examples for gene IDs. The description doesn't adequately compensate for the complete lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get information') and target resource ('specific genes'), specifying the lookup method ('by their Hugo symbol or Entrez ID') and endpoint type ('batch endpoint'). It distinguishes from siblings like 'search_genes' by focusing on batch retrieval of specific identifiers rather than search functionality. However, it doesn't explicitly contrast with 'get_multiple_genes' which might be a similar batch operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_genes' or 'get_multiple_genes'. It mentions the 'batch endpoint' but doesn't explain when batch retrieval is preferable over individual queries or other methods. No exclusions, prerequisites, or comparative context are provided.

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

Install Server

Other Tools

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