get_assembly_info
Retrieve detailed genome assembly data and statistics for specified species, including optional chromosome banding patterns, using the Ensembl REST API.
Instructions
Get genome assembly information and statistics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bands | No | Include chromosome banding patterns (default: false) | |
| species | No | Species name (default: homo_sapiens) |
Implementation Reference
- src/index.ts:1524-1551 (handler)The handler function for the 'get_assembly_info' tool. Validates arguments, fetches assembly information from the Ensembl REST API endpoint `/info/assembly/{species}`, and returns the JSON response.private async handleGetAssemblyInfo(args: any) { if (!isValidAssemblyArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid assembly info arguments'); } try { const species = this.getDefaultSpecies(args.species); const params: any = {}; if (args.bands) { params.bands = 1; } const response = await this.apiClient.get(`/info/assembly/${species}`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleError(error, 'fetching assembly info'); } }
- src/index.ts:871-872 (registration)Registration of the 'get_assembly_info' tool handler in the CallToolRequestSchema switch statement.case 'get_assembly_info': return this.handleGetAssemblyInfo(args);
- src/index.ts:777-788 (schema)Tool registration including name, description, and input schema definition in the ListToolsRequestSchema response.{ name: 'get_assembly_info', description: 'Get genome assembly information and statistics', inputSchema: { type: 'object', properties: { species: { type: 'string', description: 'Species name (default: homo_sapiens)' }, bands: { type: 'boolean', description: 'Include chromosome banding patterns (default: false)' }, }, required: [], }, },
- src/index.ts:272-281 (schema)Type guard function for validating input arguments to the 'get_assembly_info' tool.const isValidAssemblyArgs = ( args: any ): args is { species?: string; bands?: boolean } => { return ( typeof args === 'object' && args !== null && (args.species === undefined || typeof args.species === 'string') && (args.bands === undefined || typeof args.bands === 'boolean') ); };
- src/index.ts:138-152 (schema)TypeScript interface defining the structure of the assembly information returned by the Ensembl API.interface EnsemblAssemblyInfo { assembly_name: string; assembly_date: string; assembly_accession: string; genebuild_last_geneset_update: string; genebuild_initial_release_date: string; genebuild_start_date: string; genebuild_version: string; genebuild_method: string; golden_path_length: number; total_coding_sequence_length: number; total_genome_length: number; coord_system_versions: string[]; karyotype: string[]; }