list_schema
Retrieve field definitions and data structure details for specific genomic tracks in the UCSC Genome Browser to understand available data attributes and formats.
Instructions
List the schema (field definitions) for a specified data track.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genome | Yes | Genome assembly name | |
| track | Yes | Track name | |
| hub_url | No | URL of track/assembly hub (optional) |
Implementation Reference
- ucsc-genome-mcp.py:402-409 (handler)Handler for the 'list_schema' tool: constructs parameters from arguments, builds the UCSC API URL for the /list/schema endpoint, makes the API request, and returns the result.elif name == "list_schema": params = { "genome": arguments["genome"], "track": arguments["track"], "hubUrl": arguments.get("hub_url") } url = build_api_url("/list/schema", params) result = await make_api_request(url)
- ucsc-genome-mcp.py:211-232 (registration)Registration of the 'list_schema' tool in the list_tools() function, including name, description, and input schema.Tool( name="list_schema", description="List the schema (field definitions) for a specified data track.", inputSchema={ "type": "object", "properties": { "genome": { "type": "string", "description": "Genome assembly name" }, "track": { "type": "string", "description": "Track name" }, "hub_url": { "type": "string", "description": "URL of track/assembly hub (optional)" } }, "required": ["genome", "track"] } ),
- ucsc-genome-mcp.py:214-231 (schema)Input schema definition for the 'list_schema' tool, specifying required genome and track parameters, optional hub_url.inputSchema={ "type": "object", "properties": { "genome": { "type": "string", "description": "Genome assembly name" }, "track": { "type": "string", "description": "Track name" }, "hub_url": { "type": "string", "description": "URL of track/assembly hub (optional)" } }, "required": ["genome", "track"] }
- ucsc-genome-mcp.py:27-37 (helper)Shared helper function used by list_schema 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)Shared helper function used by list_schema handler to perform the HTTP GET request and parse 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()