Skip to main content
Glama

get_regulatory_features

Retrieve regulatory elements like enhancers, promoters, and TFBS for a specified genomic region and species using the Ensembl MCP Server. Optional filters include feature type and cell type context.

Instructions

Get regulatory elements (enhancers, promoters, TFBS) in genomic region

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cell_typeNoCell type context (optional)
feature_typeNoRegulatory feature type (optional)
regionYesGenomic region (chr:start-end)
speciesNoSpecies name (default: homo_sapiens)

Implementation Reference

  • The handler function implementing the core logic for the 'get_regulatory_features' tool. It validates input, queries the Ensembl REST API /overlap/region endpoint for regulatory features, and handles fallbacks with JSON output.
    private async handleGetRegulatoryFeatures(args: any) { if (!isValidRegulatoryArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid regulatory feature arguments'); } try { const species = this.getDefaultSpecies(args.species); const region = this.formatGenomicRegion(args.region); // Try overlap endpoint for regulatory features try { const response = await this.apiClient.get(`/overlap/region/${species}/${region}`, { params: { feature: 'regulatory' } }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (overlapError) { // Alternative: try the overlap endpoint with different feature types const features = ['gene', 'transcript']; const results = []; for (const feature of features) { try { const response = await this.apiClient.get(`/overlap/region/${species}/${region}`, { params: { feature } }); results.push({ feature, data: response.data }); } catch (e) { // Continue to next feature } } return { content: [ { type: 'text', text: JSON.stringify({ message: 'Regulatory features not available, showing overlapping genomic features', features: results }, null, 2), }, ], }; } } catch (error) { return this.handleError(error, 'fetching regulatory features'); } }
  • src/index.ts:859-860 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement within setupToolHandlers().
    case 'get_regulatory_features': return this.handleGetRegulatoryFeatures(args);
  • Type guard function for validating input arguments to the get_regulatory_features tool.
    const isValidRegulatoryArgs = ( args: any ): args is { region: string; species?: string; feature_type?: string; cell_type?: string } => { return ( typeof args === 'object' && args !== null && typeof args.region === 'string' && args.region.length > 0 && (args.species === undefined || typeof args.species === 'string') && (args.feature_type === undefined || typeof args.feature_type === 'string') && (args.cell_type === undefined || typeof args.cell_type === 'string') ); };
  • Tool schema and description registered in ListToolsRequestSchema handler, defining input parameters and documentation.
    name: 'get_regulatory_features', description: 'Get regulatory elements (enhancers, promoters, TFBS) in genomic region', inputSchema: { type: 'object', properties: { region: { type: 'string', description: 'Genomic region (chr:start-end)' }, species: { type: 'string', description: 'Species name (default: homo_sapiens)' }, feature_type: { type: 'string', description: 'Regulatory feature type (optional)' }, cell_type: { type: 'string', description: 'Cell type context (optional)' }, }, required: ['region'], },
  • TypeScript interface defining the structure of Ensembl regulatory feature data.
    interface EnsemblRegulatoryFeature { id: string; feature_type: string; start: number; end: number; strand: number; bound_start: number; bound_end: number; description: string; cell_type?: string[]; activity?: string; }

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