Skip to main content
Glama
pickleton89

cBioPortal MCP Server

by pickleton89

collect_all_results

Retrieve complete paginated results from cBioPortal cancer genomics endpoints to access comprehensive mutation and clinical data.

Instructions

Delegate to utils.pagination.collect_all_results with api_client.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYes
paramsNo
methodNoGET
json_dataNo
max_pagesNo
limitNo

Implementation Reference

  • MCP tool handler for collect_all_results tool. Thin wrapper that injects the API client and delegates to the pagination utility.
    async def collect_all_results(
        self,
        endpoint: str,
        params: Optional[Dict[str, Any]] = None,
        method: str = "GET",
        json_data: Any = None,
        max_pages: Optional[int] = None,
        limit: Optional[int] = None,
    ) -> List[Dict[str, Any]]:
        """Delegate to utils.pagination.collect_all_results with api_client."""
        return await collect_all_results(
            self.api_client, endpoint, params, method, json_data, max_pages, limit
        )
  • Core utility implementation of collect_all_results. Uses paginate_results async generator to fetch and accumulate all pages of results, respecting limits.
    async def collect_all_results(
        api_client,
        endpoint: str,
        params: Optional[Dict[str, Any]] = None,
        method: str = "GET",
        json_data: Any = None,
        max_pages: Optional[int] = None,
        limit: Optional[int] = None,
    ) -> List[Dict[str, Any]]:
        """
        Collect all results from a paginated endpoint into a single list.
    
        Args:
            api_client: The APIClient instance to use for requests
            endpoint: API endpoint path
            params: Query parameters to include in the request
            method: HTTP method (GET or POST)
            json_data: JSON data for POST requests
            max_pages: Maximum number of pages to retrieve
            limit: Maximum number of total results to return
    
        Returns:
            List of all collected results (limited by max_pages and/or limit)
        """
        all_results = []
    
        async for page in paginate_results(
            api_client, endpoint, params, method, json_data, max_pages
        ):
            all_results.extend(page)
    
            # Stop if we've reached the specified limit
            if limit and len(all_results) >= limit:
                all_results = all_results[:limit]
                break
    
        return all_results
  • Registration of MCP tools including collect_all_results. The tool_methods list includes it, and self.mcp.add_tool registers the handler method.
    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 'Delegate to utils.pagination.collect_all_results' which hints at pagination behavior but doesn't explain what this means operationally - whether it makes multiple API calls, handles rate limits, manages authentication, or what happens on errors. For a tool with 6 parameters and no annotation coverage, this is inadequate behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that gets straight to the point. There's no wasted words or unnecessary elaboration. However, this conciseness comes at the cost of being under-specified for a tool with significant complexity. The structure is front-loaded but lacks the necessary detail.

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

Completeness1/5

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

Given the tool's complexity (6 parameters, no output schema, no annotations, 0% schema coverage), the description is completely inadequate. It doesn't explain what the tool returns, how pagination works, what errors might occur, or how to interpret the parameters. For a general-purpose pagination collection tool that likely makes multiple API calls, this description leaves the agent with insufficient information to use it correctly.

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

Parameters1/5

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

With 0% schema description coverage and 6 parameters, the description provides absolutely no information about what the parameters mean or how to use them. It doesn't explain what 'endpoint' should contain, what 'params' or 'json_data' should include, when to use 'method' other than GET, or how 'max_pages' and 'limit' interact. The description fails to compensate for the complete lack of schema documentation.

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

Purpose2/5

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

The description states 'Delegate to utils.pagination.collect_all_results with api_client' which is a tautology - it essentially restates the tool name 'collect_all_results' with implementation details. It doesn't specify what the tool actually does (e.g., 'collects all paginated results from an API endpoint') or what resource it operates on. While it mentions 'pagination', the purpose remains vague compared to what a clear description would provide.

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. Given the sibling tools include 'paginate_results' which likely handles pagination differently, there's no indication of when to choose 'collect_all_results' over 'paginate_results' or other data retrieval tools. The description doesn't mention prerequisites, appropriate contexts, or exclusions for usage.

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