Skip to main content
Glama
hlydecker

UCSC Genome Browser MCP Server

by hlydecker

search_genome

Search UCSC Genome Browser assemblies to find genomic tracks, help documentation, and public data hubs using specific terms.

Instructions

Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesSearch term
genomeYesGenome assembly to search in
categoriesNoRestrict search to specific categories

Implementation Reference

  • Executes the search_genome tool by building parameters for the UCSC API /search endpoint (search term, genome, optional categories) and fetching the results via make_api_request.
    elif name == "search_genome":
        params = {
            "search": arguments["search"],
            "genome": arguments["genome"],
            "categories": arguments.get("categories")
        }
        url = build_api_url("/search", params)
        result = await make_api_request(url)
  • Defines the Tool schema for search_genome, including input parameters: search (required string), genome (required string), categories (optional enum: helpDocs, publicHubs, trackDb).
    Tool(
        name="search_genome",
        description="Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.",
        inputSchema={
            "type": "object",
            "properties": {
                "search": {
                    "type": "string",
                    "description": "Search term"
                },
                "genome": {
                    "type": "string",
                    "description": "Genome assembly to search in"
                },
                "categories": {
                    "type": "string",
                    "enum": ["helpDocs", "publicHubs", "trackDb"],
                    "description": "Restrict search to specific categories"
                }
            },
            "required": ["search", "genome"]
        }
    )
  • Registers the search_genome tool within the list_tools() function returned by the @app.list_tools() decorator, making it available to the MCP server.
    @app.list_tools()
    async def list_tools() -> list[Tool]:
        """List all available tools for UCSC Genome Browser API."""
        return [
            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"]
                }
            ),
            Tool(
                name="list_public_hubs",
                description="List all available public track hubs in the UCSC Genome Browser.",
                inputSchema={
                    "type": "object",
                    "properties": {}
                }
            ),
            Tool(
                name="list_ucsc_genomes",
                description="List all UCSC Genome Browser database genomes available on the database host.",
                inputSchema={
                    "type": "object",
                    "properties": {}
                }
            ),
            Tool(
                name="list_genark_genomes",
                description="List UCSC Genome Browser database genomes from assembly hub host (GenArk). Can also test for existence of a specific genome.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "genome": {
                            "type": "string",
                            "description": "Specific genome to test for existence (optional)"
                        },
                        "max_items": {
                            "type": "integer",
                            "description": "Maximum number of items to return (default: 1000000)"
                        }
                    }
                }
            ),
            Tool(
                name="list_hub_genomes",
                description="List all genomes available in a specified track or assembly hub.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "hub_url": {
                            "type": "string",
                            "description": "URL of the track hub or assembly hub"
                        }
                    },
                    "required": ["hub_url"]
                }
            ),
            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"]
                }
            ),
            Tool(
                name="list_tracks",
                description="List all data tracks available in a specified hub or UCSC database genome.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "genome": {
                            "type": "string",
                            "description": "Genome assembly name"
                        },
                        "hub_url": {
                            "type": "string",
                            "description": "URL of track/assembly hub (optional, required with genome for hub tracks)"
                        },
                        "track_leaves_only": {
                            "type": "boolean",
                            "description": "Only show tracks without composite container information"
                        }
                    },
                    "required": ["genome"]
                }
            ),
            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"]
                }
            ),
            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"]
                }
            ),
            Tool(
                name="get_sequence",
                description="Retrieve DNA sequence from a specified genome assembly. Can retrieve entire chromosome or specific coordinates.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "genome": {
                            "type": "string",
                            "description": "Genome assembly name (e.g., 'hg38')"
                        },
                        "chrom": {
                            "type": "string",
                            "description": "Chromosome name (e.g., 'chr1', 'chrM')"
                        },
                        "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 assembly hub (optional)"
                        },
                        "reverse_complement": {
                            "type": "boolean",
                            "description": "Return reverse complement of sequence"
                        }
                    },
                    "required": ["genome", "chrom"]
                }
            ),
            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"]
                }
            ),
            Tool(
                name="search_genome",
                description="Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "search": {
                            "type": "string",
                            "description": "Search term"
                        },
                        "genome": {
                            "type": "string",
                            "description": "Genome assembly to search in"
                        },
                        "categories": {
                            "type": "string",
                            "enum": ["helpDocs", "publicHubs", "trackDb"],
                            "description": "Restrict search to specific categories"
                        }
                    },
                    "required": ["search", "genome"]
                }
            )
        ]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs a search operation, implying it's read-only, but doesn't cover critical aspects like authentication needs, rate limits, pagination, error handling, or what the search results look like. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves in practice.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. It uses clear terminology and avoids redundancy, making it easy to parse quickly. Every word contributes to understanding the tool's scope, earning a top score for conciseness.

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?

Given the tool's complexity (searching across multiple categories in a genome assembly) and lack of annotations and output schema, the description is incomplete. It doesn't explain what the search returns, how results are formatted, or any behavioral constraints. For a tool with three parameters and no structured output information, more context is needed to guide effective use.

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?

The description adds minimal value beyond the input schema, which has 100% coverage. It mentions searching 'across tracks, help docs, and public hubs,' which loosely relates to the 'categories' parameter with enum values like 'trackDb' and 'publicHubs', but doesn't explain the semantics of these categories or how they affect the search. Since the schema already documents all parameters well, the baseline score of 3 is appropriate.

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 tool's purpose: 'Search for matches within a UCSC Genome Browser genome assembly across tracks, help docs, and public hubs.' It specifies the verb ('Search'), resource ('UCSC Genome Browser genome assembly'), and scope ('across tracks, help docs, and public hubs'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'find_genome' or 'list_tracks', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'find_genome', 'list_tracks', and 'list_public_hubs', it's unclear if this tool is for broad searches or specific scenarios. There's no mention of prerequisites, exclusions, or comparative contexts, leaving the agent to infer usage based on the name and parameters alone.

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