Skip to main content
Glama
hlydecker
by hlydecker

list_chromosomes

Retrieve chromosome lists from UCSC Genome Browser assemblies, hubs, or databases to identify available genomic sequences for analysis.

Instructions

List chromosomes in an assembly hub, track hub, or UCSC database genome. Optionally filter by specific track.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genomeYesGenome assembly name
hub_urlNoURL of track/assembly hub (optional)
trackNoSpecific track name to list chromosomes from (optional)

Implementation Reference

  • Registration of the 'list_chromosomes' tool, including its description and input schema.
    Tool( name="list_chromosomes", description="List chromosomes in an assembly hub, track hub, or UCSC database genome. Optionally filter by specific track.", inputSchema={ "type": "object", "properties": { "genome": { "type": "string", "description": "Genome assembly name" }, "hub_url": { "type": "string", "description": "URL of track/assembly hub (optional)" }, "track": { "type": "string", "description": "Specific track name to list chromosomes from (optional)" } }, "required": ["genome"] } ),
  • Handler implementation for 'list_chromosomes' tool. Constructs parameters from arguments and makes an API request to the UCSC Genome Browser's /list/chromosomes endpoint.
    elif name == "list_chromosomes": params = { "genome": arguments["genome"], "hubUrl": arguments.get("hub_url"), "track": arguments.get("track") } url = build_api_url("/list/chromosomes", params) result = await make_api_request(url)
  • Helper function to build the UCSC API URL used by the list_chromosomes 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 requests to UCSC API, used by the list_chromosomes 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