Skip to main content
Glama

map_coordinates

Convert genomic coordinates between different assemblies for accurate data mapping, supporting species-specific genome analysis in the Ensembl MCP Server.

Instructions

Convert coordinates between genome assemblies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionYesGenomic region (chr:start-end)
speciesNoSpecies name (default: homo_sapiens)
target_assemblyYesTarget assembly name

Implementation Reference

  • The handler function that executes the map_coordinates tool. It validates input implicitly through execution, formats the region and species, calls the Ensembl REST API endpoint `/map/coords/{species}/{target_assembly}/{region}` to convert genomic coordinates between assemblies, and returns the result as JSON.
    private async handleMapCoordinates(args: any) { try { const species = this.getDefaultSpecies(args.species); const region = this.formatGenomicRegion(args.region); const response = await this.apiClient.get(`/map/coords/${species}/${args.target_assembly}/${region}`); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleError(error, 'mapping coordinates'); } }
  • The input schema definition for the map_coordinates tool, registered in the ListTools response, defining parameters: region (required), species (optional), target_assembly (required).
    name: 'map_coordinates', description: 'Convert coordinates between genome assemblies', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Genomic region (chr:start-end)' }, species: { type: 'string', description: 'Species name (default: homo_sapiens)' }, target_assembly: { type: 'string', description: 'Target assembly name' }, }, required: ['region', 'target_assembly'], }, },
  • src/index.ts:867-867 (registration)
    The switch case in the CallToolRequestSchema handler that registers and dispatches to the map_coordinates tool handler.
    return this.handleMapCoordinates(args);
  • Type guard function for validating input arguments to the map_coordinates tool.
    const isValidMapCoordinatesArgs = ( args: any ): args is { region: string; species?: string; target_assembly: string } => { return ( typeof args === 'object' && args !== null && typeof args.region === 'string' && args.region.length > 0 && (args.species === undefined || typeof args.species === 'string') && typeof args.target_assembly === 'string' && args.target_assembly.length > 0 ); };

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/Augmented-Nature/Ensembl-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server