Skip to main content
Glama
pickleton89

cBioPortal MCP Server

by pickleton89

get_gene_panel_details

Retrieve comprehensive details and gene lists for specific cancer genomics panels to support research and analysis.

Instructions

Get detailed information for a specific gene panel, including the list of genes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_panel_idYes
projectionNoDETAILED

Implementation Reference

  • Core handler function that implements the get_gene_panel_details tool logic, performing input validation, API request to cBioPortal's gene-panels/fetch endpoint, response processing, and comprehensive error handling.
    async def get_gene_panel_details(
        self,
        gene_panel_id: str,
        projection: str = "DETAILED",
    ) -> Dict[str, Any]:
        """
        Get detailed information for a specific gene panel, including the list of genes.
    
        Args:
            gene_panel_id: The ID of the gene panel (e.g., "IMPACT341").
            projection: Level of detail ("ID", "SUMMARY", "DETAILED", "META").
                        "DETAILED" includes the list of genes.
    
        Returns:
            A dictionary containing gene panel details, or an error dictionary.
        """
        if not gene_panel_id or not isinstance(gene_panel_id, str):
            return {"error": "gene_panel_id must be a non-empty string"}
        if projection.upper() not in ["ID", "SUMMARY", "DETAILED", "META"]:
            return {
                "error": "projection must be one of 'ID', 'SUMMARY', 'DETAILED', 'META'"
            }
    
        endpoint = "gene-panels/fetch"
        # API requires query param for projection, and POST body for IDs
        params = {"projection": projection.upper()}
        request_body = [gene_panel_id]  # API expects a list of gene panel IDs
    
        try:
            results = await self.api_client.make_api_request(
                endpoint, method="POST", params=params, json_data=request_body
            )
    
            # The API returns a list, even for a single ID request
            if isinstance(results, list):
                if len(results) > 0:
                    return results[
                        0
                    ]  # Return the first (and expected only) gene panel object
                else:
                    # Successfully queried, but no panel found for this ID
                    return {
                        "error": "Gene panel not found",
                        "gene_panel_id": gene_panel_id,
                    }
            else:
                # This case implies an unexpected API response format (not a list)
                logger.warning(
                    f"Unexpected response format for get_gene_panel_details {gene_panel_id}: {type(results)}"
                )
                return {
                    "error": "Unexpected response format from API",
                    "details": str(results),
                }
    
        except httpx.HTTPStatusError as e:
            logger.error(
                f"API error getting gene panel details for {gene_panel_id}: {e.response.status_code} - {e.response.text}"
            )
            return {
                "error": f"API error: {e.response.status_code}",
                "details": e.response.text,
            }
        except httpx.RequestError as e:
            logger.error(
                f"Request error getting gene panel details for {gene_panel_id}: {e}"
            )
            return {"error": "Request error", "details": str(e)}
        except Exception as e:
            logger.error(
                f"Unexpected error getting gene panel details for {gene_panel_id}: {e}",
                exc_info=True,
            )
            return {"error": "Unexpected server error", "details": str(e)}
  • Thin wrapper handler in the main server class that delegates to the MolecularProfilesEndpoints implementation.
    async def get_gene_panel_details(
        self,
        gene_panel_id: str,
        projection: str = "DETAILED",
    ) -> Dict[str, Any]:
        """Get detailed information for a specific gene panel, including the list of genes."""
        return await self.molecular_profiles.get_gene_panel_details(
            gene_panel_id, projection
        )
  • Registers the get_gene_panel_details method (and others) as an MCP tool using FastMCP's 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")
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves information, implying it's a read operation, but lacks details on permissions, rate limits, error handling, or response format. For a tool with no annotations, this is insufficient behavioral disclosure.

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 directly states the tool's function. It is front-loaded with the core purpose and includes essential details without unnecessary elaboration.

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?

Given no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks information on parameters, behavioral traits, and return values, making it inadequate for a tool with two parameters in a complex domain like gene panels.

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. It mentions 'specific gene panel' which hints at the 'gene_panel_id' parameter, but does not explain 'projection' or provide any details on parameter formats, constraints, or usage. This leaves key parameters undocumented.

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 tool's purpose with a specific verb ('Get') and resource ('gene panel'), specifying it provides 'detailed information' including 'the list of genes'. However, it does not explicitly differentiate from sibling tools like 'get_gene_panels_for_study', which might retrieve similar data in a different context.

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. It does not mention prerequisites, context, or exclusions, leaving the agent to infer usage based on tool name and parameters alone.

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