Skip to main content
Glama
hlydecker
by hlydecker

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
NameRequiredDescriptionDefault
searchYesSearch term
genomeYesGenome assembly to search in
categoriesNoRestrict search to specific categories

Implementation Reference

  • 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)
  • 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"] }
  • 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"] } )
  • 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}"
  • 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()

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/hlydecker/ucsc-genome-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server