list_public_hubs
Retrieve all publicly available track hubs from the UCSC Genome Browser to access organized genomic datasets for research and analysis.
Instructions
List all available public track hubs in the UCSC Genome Browser.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- ucsc-genome-mcp.py:354-356 (handler)Handler code within the @app.call_tool() dispatcher that constructs the UCSC API URL for /list/publicHubs and fetches the list of public track hubs.elif name == "list_public_hubs": url = build_api_url("/list/publicHubs", {}) result = await make_api_request(url)
- ucsc-genome-mcp.py:97-104 (registration)Tool registration in @app.list_tools(), defining the tool name, description, and empty input schema.Tool( name="list_public_hubs", description="List all available public track hubs in the UCSC Genome Browser.", inputSchema={ "type": "object", "properties": {} } ),
- ucsc-genome-mcp.py:100-103 (schema)Input schema definition for the tool, which requires no parameters.inputSchema={ "type": "object", "properties": {} }
- ucsc-genome-mcp.py:27-37 (helper)Helper function to construct UCSC API URLs, used by the list_public_hubs 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-45 (helper)Helper function to perform HTTP GET requests to UCSC API and parse JSON response, used by the 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()