get_sequence
Retrieve DNA sequences from genome assemblies using chromosome coordinates. Specify genome, chromosome, and optional start/end positions to extract specific genomic regions.
Instructions
Retrieve DNA sequence from a specified genome assembly. Can retrieve entire chromosome or specific coordinates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| genome | Yes | Genome assembly name (e.g., 'hg38') | |
| chrom | Yes | Chromosome name (e.g., 'chr1', 'chrM') | |
| start | No | Start coordinate (0-based, optional, requires end) | |
| end | No | End coordinate (1-based, optional, requires start) | |
| hub_url | No | URL of assembly hub (optional) | |
| reverse_complement | No | Return reverse complement of sequence |
Implementation Reference
- ucsc-genome-mcp.py:411-421 (handler)Handler logic for the get_sequence tool: extracts arguments, builds parameters for the UCSC API /getData/sequence endpoint, constructs the URL, and fetches the sequence data via make_api_request.elif name == "get_sequence": params = { "genome": arguments["genome"], "chrom": arguments["chrom"], "start": arguments.get("start"), "end": arguments.get("end"), "hubUrl": arguments.get("hub_url"), "revComp": 1 if arguments.get("reverse_complement") else None } url = build_api_url("/getData/sequence", params) result = await make_api_request(url)
- ucsc-genome-mcp.py:236-264 (schema)Input schema defining the parameters for the get_sequence tool, including required genome and chrom, optional coordinates, hub URL, and reverse complement flag.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"]
- ucsc-genome-mcp.py:233-266 (registration)Registration of the get_sequence tool in the list_tools() function return value, specifying name, description, and input schema.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"] } ),