get_sample_list_id
Retrieve detailed sample list information for a specific study and sample list ID using the cBioPortal MCP Server. Simplify access to cancer genomics data for analysis and exploration.
Instructions
Get sample list information for a specific study and sample list ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sample_list_id | Yes | ||
| study_id | Yes |
Implementation Reference
- Core handler implementation of the get_sample_list_id tool. Makes an API request to retrieve sample list information for the specified study_id and sample_list_id.@handle_api_errors("get sample list id") async def get_sample_list_id(self, study_id: str, sample_list_id: str) -> Dict: """ Get sample list information for a specific study and sample list ID. Args: study_id: The ID of the cancer study sample_list_id: The ID of the sample list Returns: Dictionary containing sample list information """ return await self.api_client.make_api_request( f"studies/{study_id}/sample_lists/{sample_list_id}" )
- cbioportal_mcp/server.py:288-290 (handler)Wrapper handler in the main server class that delegates the get_sample_list_id call to the SamplesEndpoints instance.async def get_sample_list_id(self, study_id: str, sample_list_id: str) -> Dict: """Get sample list information for a specific study and sample list ID.""" return await self.samples.get_sample_list_id(study_id, sample_list_id)
- cbioportal_mcp/server.py:99-122 (registration)The tool_methods list in _register_tools() that explicitly includes "get_sample_list_id" for registration as an MCP tool.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", ]
- cbioportal_mcp/server.py:124-131 (registration)The registration loop in _register_tools() that adds each method from tool_methods, including get_sample_list_id, to the FastMCP instance.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")