get_study_details
Retrieve comprehensive data for a specific cancer study from cBioPortal MCP Server. Input a study ID to access detailed genomic and clinical information.
Instructions
Get detailed information for a specific cancer study.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| study_id | Yes |
Implementation Reference
- Core handler implementation for get_study_details tool: validates study_id, makes API request to cBioPortal studies/{study_id} endpoint, returns study details or error.async def get_study_details(self, study_id: str) -> Dict[str, Any]: """ Get detailed information for a specific cancer study. Args: study_id: The ID of the cancer study Returns: Dictionary containing study details """ # Input Validation validate_study_id(study_id) endpoint = f"studies/{study_id}" try: study = await self.api_client.make_api_request(endpoint) return {"study": study} except Exception as e: return {"error": f"Failed to get study details for {study_id}: {str(e)}"}
- cbioportal_mcp/server.py:96-131 (registration)Registers the get_study_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")
- cbioportal_mcp/server.py:207-209 (handler)MCP tool entry point handler for get_study_details, delegates to StudiesEndpoints instance.async def get_study_details(self, study_id: str) -> Dict[str, Any]: """Get detailed information for a specific cancer study.""" return await self.studies.get_study_details(study_id)
- cbioportal_mcp/server.py:47-47 (helper)Initializes the StudiesEndpoints instance used by the get_study_details handler.self.studies = StudiesEndpoints(self.api_client)