search_genome
Search for genomic data across tracks, documentation, and public hubs within UCSC Genome Browser assemblies to locate specific biological information.
Instructions
Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | Yes | Search term | |
| genome | Yes | Genome assembly to search in | |
| categories | No | Restrict search to specific categories |
Implementation Reference
- ucsc-genome-mcp.py:437-445 (handler)Handler logic in call_tool function that handles the 'search_genome' tool by constructing parameters, building the API URL for '/search' endpoint, and making the API request.elif name == "search_genome": params = { "search": arguments["search"], "genome": arguments["genome"], "categories": arguments.get("categories") } url = build_api_url("/search", params) result = await make_api_request(url)
- ucsc-genome-mcp.py:312-330 (schema)Input schema defining parameters for the search_genome tool: required 'search' and 'genome', optional 'categories'.inputSchema={ "type": "object", "properties": { "search": { "type": "string", "description": "Search term" }, "genome": { "type": "string", "description": "Genome assembly to search in" }, "categories": { "type": "string", "enum": ["helpDocs", "publicHubs", "trackDb"], "description": "Restrict search to specific categories" } }, "required": ["search", "genome"] }
- ucsc-genome-mcp.py:309-331 (registration)Registration of the 'search_genome' tool in the list_tools() function, including name, description, and input schema.Tool( name="search_genome", description="Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.", inputSchema={ "type": "object", "properties": { "search": { "type": "string", "description": "Search term" }, "genome": { "type": "string", "description": "Genome assembly to search in" }, "categories": { "type": "string", "enum": ["helpDocs", "publicHubs", "trackDb"], "description": "Restrict search to specific categories" } }, "required": ["search", "genome"] } )
- ucsc-genome-mcp.py:27-37 (helper)Helper function used by search_genome handler to construct the API URL with filtered parameters using semicolon separation as per UCSC spec.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 used by search_genome handler to perform the asynchronous HTTP GET request to the UCSC API and parse the JSON response.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()