list_files
Retrieve available download files for a specific UCSC genome assembly to access genomic data resources.
Instructions
List download files available for a specified UCSC genome assembly.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genome | Yes | Genome assembly name (e.g., 'hg38', 'mm10') | |
| format | No | Output format (default: json) | |
| max_items | No | Maximum number of items to return |
Implementation Reference
- ucsc-genome-mcp.py:375-382 (handler)Handler implementation for the 'list_files' tool. Constructs parameters from input arguments and makes an API request to the UCSC Genome Browser's /list/files endpoint.elif name == "list_files": params = { "genome": arguments["genome"], "format": arguments.get("format"), "maxItemsOutput": arguments.get("max_items") } url = build_api_url("/list/files", params) result = await make_api_request(url)
- ucsc-genome-mcp.py:144-166 (registration)Registration of the 'list_files' tool in the list_tools() function, including name, description, and input schema.Tool( name="list_files", description="List download files available for a specified UCSC genome assembly.", inputSchema={ "type": "object", "properties": { "genome": { "type": "string", "description": "Genome assembly name (e.g., 'hg38', 'mm10')" }, "format": { "type": "string", "enum": ["json", "text"], "description": "Output format (default: json)" }, "max_items": { "type": "integer", "description": "Maximum number of items to return" } }, "required": ["genome"] } ),
- ucsc-genome-mcp.py:147-165 (schema)Input schema definition for the 'list_files' tool, specifying parameters like genome (required), format, and max_items.inputSchema={ "type": "object", "properties": { "genome": { "type": "string", "description": "Genome assembly name (e.g., 'hg38', 'mm10')" }, "format": { "type": "string", "enum": ["json", "text"], "description": "Output format (default: json)" }, "max_items": { "type": "integer", "description": "Maximum number of items to return" } }, "required": ["genome"] }
- ucsc-genome-mcp.py:27-37 (helper)Helper function build_api_url used by list_files handler to construct the API request URL.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 make_api_request used by list_files handler to perform the HTTP GET request and parse JSON.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()