Skip to main content
Glama
hlydecker
by hlydecker

find_genome

Search for genomes in the UCSC Genome Browser using flexible queries with inclusion, exclusion, and wildcard operators to locate specific genomic assemblies.

Instructions

Search for a genome in the UCSC browser using a search string. Supports advanced search with +word (force inclusion), -word (exclusion), and word* (wildcard).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch string to find genomes (e.g., 'dog', 'GRCh38', 'GCF_028858775.2')
browserNoFilter by browser availability (default: mustExist)
stats_onlyNoOnly show statistics about search results
yearNoFilter results by year
categoryNoFilter by NCBI category
statusNoFilter by NCBI status
levelNoFilter by NCBI assembly level
max_itemsNoMaximum number of items to return (default: 1000000, use -1 for max)

Implementation Reference

  • Handler logic for the 'find_genome' tool: constructs parameters from tool arguments, builds the API URL for /findGenome, and fetches the JSON response from UCSC API.
    if name == "find_genome": params = { "q": arguments["query"], "browser": arguments.get("browser"), "statsOnly": 1 if arguments.get("stats_only") else None, "year": arguments.get("year"), "category": arguments.get("category"), "status": arguments.get("status"), "level": arguments.get("level"), "maxItemsOutput": arguments.get("max_items") } url = build_api_url("/findGenome", params) result = await make_api_request(url)
  • Registration of the 'find_genome' tool in the list_tools() decorator, including its description and full input schema.
    Tool( name="find_genome", description="Search for a genome in the UCSC browser using a search string. Supports advanced search with +word (force inclusion), -word (exclusion), and word* (wildcard).", inputSchema={ "type": "object", "properties": { "query": { "type": "string", "description": "Search string to find genomes (e.g., 'dog', 'GRCh38', 'GCF_028858775.2')" }, "browser": { "type": "string", "enum": ["mustExist", "mayExist", "notExist"], "description": "Filter by browser availability (default: mustExist)" }, "stats_only": { "type": "boolean", "description": "Only show statistics about search results" }, "year": { "type": "integer", "description": "Filter results by year" }, "category": { "type": "string", "enum": ["reference", "representative"], "description": "Filter by NCBI category" }, "status": { "type": "string", "enum": ["reference", "representative"], "description": "Filter by NCBI status" }, "level": { "type": "string", "enum": ["complete", "chromosome", "scaffold", "contig"], "description": "Filter by NCBI assembly level" }, "max_items": { "type": "integer", "description": "Maximum number of items to return (default: 1000000, use -1 for max)" } }, "required": ["query"] } ),
  • Helper function to construct UCSC Genome API URLs from endpoint and parameters, used by the find_genome 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}"
  • Helper function to perform HTTP GET requests to UCSC API and parse JSON response, used by the find_genome 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()

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