list_hub_genomes
Retrieve all genomes available in a specified track or assembly hub to identify compatible genomic datasets for analysis.
Instructions
List all genomes available in a specified track or assembly hub.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hub_url | Yes | URL of the track hub or assembly hub |
Implementation Reference
- ucsc-genome-mcp.py:370-373 (handler)Handler logic for 'list_hub_genomes' tool: constructs parameters from input, builds UCSC API URL for /list/hubGenomes endpoint, and makes the API request.elif name == "list_hub_genomes": params = {"hubUrl": arguments["hub_url"]} url = build_api_url("/list/hubGenomes", params) result = await make_api_request(url)
- ucsc-genome-mcp.py:133-142 (schema)Input schema definition for 'list_hub_genomes' tool: requires 'hub_url' string parameter.inputSchema={ "type": "object", "properties": { "hub_url": { "type": "string", "description": "URL of the track hub or assembly hub" } }, "required": ["hub_url"] }
- ucsc-genome-mcp.py:130-143 (registration)Registration of the 'list_hub_genomes' tool in the MCP server's list_tools() function, including name, description, and input schema.Tool( name="list_hub_genomes", description="List all genomes available in a specified track or assembly hub.", inputSchema={ "type": "object", "properties": { "hub_url": { "type": "string", "description": "URL of the track hub or assembly hub" } }, "required": ["hub_url"] } ),
- ucsc-genome-mcp.py:27-36 (helper)Helper function to build UCSC API URLs with semicolon-separated parameters, used by the tool handler.def build_api_url(endpoint: str, params: dict[str, Any]) -> str: """Build the complete API URL with parameters.""" # Filter out None values filtered_params = {k: v for k, v in params.items() if v is not None} # Convert parameters to URL format (using semicolons as per UCSC API spec) if filtered_params: param_str = ";".join(f"{k}={v}" for k, v in filtered_params.items()) return f"{BASE_URL}{endpoint}?{param_str}" return f"{BASE_URL}{endpoint}"
- ucsc-genome-mcp.py:39-44 (helper)Helper function to make asynchronous HTTP GET requests to UCSC API and parse JSON response, used by the tool handler.async def make_api_request(url: str) -> dict[str, Any]: """Make an HTTP request to the UCSC API and return JSON response.""" async with httpx.AsyncClient(timeout=30.0) as client: response = await client.get(url) response.raise_for_status() return response.json()