Skip to main content
Glama
hlydecker

UCSC Genome Browser MCP Server

by hlydecker

get_track_data

Retrieve genomic track data from UCSC Genome Browser or custom hubs, with optional filtering by chromosome and coordinates for targeted analysis.

Instructions

Retrieve data from a specified track in a hub or UCSC database genome. Can be filtered by chromosome and coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genomeYesGenome assembly name
trackYesTrack name
chromNoChromosome name (optional)
startNoStart coordinate (0-based, optional, requires end)
endNoEnd coordinate (1-based, optional, requires start)
hub_urlNoURL of track/assembly hub (optional)
max_itemsNoMaximum number of items to return (default: 1000000)
json_output_arraysNoReturn data as JSON arrays instead of objects

Implementation Reference

  • Handler function for get_track_data tool: maps input arguments to API parameters and calls the UCSC Genome API /getData/track endpoint.
    elif name == "get_track_data":
        params = {
            "genome": arguments["genome"],
            "track": arguments["track"],
            "chrom": arguments.get("chrom"),
            "start": arguments.get("start"),
            "end": arguments.get("end"),
            "hubUrl": arguments.get("hub_url"),
            "maxItemsOutput": arguments.get("max_items"),
            "jsonOutputArrays": 1 if arguments.get("json_output_arrays") else None
        }
        url = build_api_url("/getData/track", params)
        result = await make_api_request(url)
  • Schema definition for the get_track_data tool, including input parameters like genome, track, optional chrom, start, end, hub_url, max_items, and json_output_arrays.
    Tool(
        name="get_track_data",
        description="Retrieve data from a specified track in a hub or UCSC database genome. Can be filtered by chromosome and coordinates.",
        inputSchema={
            "type": "object",
            "properties": {
                "genome": {
                    "type": "string",
                    "description": "Genome assembly name"
                },
                "track": {
                    "type": "string",
                    "description": "Track name"
                },
                "chrom": {
                    "type": "string",
                    "description": "Chromosome name (optional)"
                },
                "start": {
                    "type": "integer",
                    "description": "Start coordinate (0-based, optional, requires end)"
                },
                "end": {
                    "type": "integer",
                    "description": "End coordinate (1-based, optional, requires start)"
                },
                "hub_url": {
                    "type": "string",
                    "description": "URL of track/assembly hub (optional)"
                },
                "max_items": {
                    "type": "integer",
                    "description": "Maximum number of items to return (default: 1000000)"
                },
                "json_output_arrays": {
                    "type": "boolean",
                    "description": "Return data as JSON arrays instead of objects"
                }
            },
            "required": ["genome", "track"]
        }
    ),
  • Helper function to construct the full UCSC API URL from endpoint and parameters, filtering None values and using semicolon separators.
    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 asynchronous HTTP GET request to UCSC API URL 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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions retrieval and filtering, it doesn't describe important behaviors like rate limits, authentication requirements, error conditions, response format details, or whether this is a read-only operation. The mention of 'max_items' in the schema suggests pagination/limiting behavior that should be explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized (two sentences) and front-loaded with the core purpose. The second sentence adds useful filtering context without redundancy. However, it could be slightly more structured by explicitly separating required vs optional parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 8 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what kind of data is returned (track data format), error handling, performance characteristics, or important behavioral constraints. The agent would struggle to understand the full context of using this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description adds minimal value beyond the schema by mentioning chromosome and coordinate filtering, but doesn't provide additional context about parameter interactions (like how hub_url relates to genome/track selection) or usage patterns that would help the agent understand the parameter relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('retrieve data') and target resource ('from a specified track in a hub or UCSC database genome'), with specific filtering capabilities mentioned. However, it doesn't explicitly differentiate from sibling tools like 'get_sequence' or 'search_genome' which might retrieve different types of genomic data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning filtering capabilities, but doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_sequence' (for sequence data) or 'search_genome' (for searching). No when-not-to-use scenarios or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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