get_variant_consequences
Predict how genetic variants affect genes and transcripts using Ensembl genomic data. Input variant IDs or HGVS notation to analyze biological consequences.
Instructions
Predict consequences of variants on genes and transcripts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variants | Yes | Variant IDs or HGVS notation | |
| species | No | Species name (default: homo_sapiens) |
Implementation Reference
- src/index.ts:1338-1360 (handler)The main execution logic for the 'get_variant_consequences' tool. It joins the variants array into a newline-separated string and POSTs it to the Ensembl VEP (Variant Effect Predictor) REST endpoint to retrieve consequences, then returns the JSON-formatted response.private async handleGetVariantConsequences(args: any) { try { const species = this.getDefaultSpecies(args.species); const variants = args.variants.join('\n'); const response = await this.apiClient.post(`/vep/species/${species}/region`, variants, { headers: { 'Content-Type': 'text/plain', }, }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleError(error, 'predicting variant consequences'); } }
- src/index.ts:697-708 (registration)Tool registration in the ListToolsRequestSchema response, defining the tool name, description, and input schema.{ name: 'get_variant_consequences', description: 'Predict consequences of variants on genes and transcripts', inputSchema: { type: 'object', properties: { variants: { type: 'array', items: { type: 'string' }, description: 'Variant IDs or HGVS notation' }, species: { type: 'string', description: 'Species name (default: homo_sapiens)' }, }, required: ['variants'], }, },
- src/index.ts:856-857 (registration)Handler dispatch in the CallToolRequestSchema switch statement.case 'get_variant_consequences': return this.handleGetVariantConsequences(args);
- src/index.ts:348-359 (schema)Input validation type guard for the tool's arguments.const isValidVariantConsequenceArgs = ( args: any ): args is { variants: string[]; species?: string } => { return ( typeof args === 'object' && args !== null && Array.isArray(args.variants) && args.variants.length > 0 && args.variants.every((v: any) => typeof v === 'string' && v.length > 0) && (args.species === undefined || typeof args.species === 'string') ); };