ensembl_regulatory
Retrieve regulatory features, binding matrices, and annotations from Ensembl genomic data to analyze gene regulation mechanisms.
Instructions
Get regulatory features, binding matrices, and regulatory annotations. Covers regulatory overlap endpoints and binding matrix data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | Genomic region in format 'chromosome:start-end' (e.g., '17:7565096-7590856', 'X:1000000-2000000', '6:25000000-35000000') | |
| protein_id | No | Protein ID for regulatory features affecting translation (e.g., 'ENSP00000288602', 'ENSP00000350283') | |
| binding_matrix_id | No | Binding matrix stable ID (e.g., 'ENSPFM0001', 'ENSPFM0123') | |
| species | No | Species name (e.g., 'homo_sapiens', 'mus_musculus') | homo_sapiens |
| feature_type | No | Type of regulatory feature (e.g., 'RegulatoryFeature', 'MotifFeature', 'TF_binding_site') |
Implementation Reference
- src/utils/ensembl-api.ts:101-132 (handler)Core implementation that performs the actual API calls to Ensembl REST endpoints for regulatory features, handling different input types (region, protein_id, binding_matrix_id).async getRegulatoryFeatures(args: any): Promise<any> { const { region, protein_id, binding_matrix_id, species = "homo_sapiens", feature_type, } = args; const params: Record<string, string> = {}; if (feature_type) { params.feature = feature_type; } if (region) { return this.makeRequest(`/overlap/region/${species}/${region}`, { ...params, feature: "RegulatoryFeature", }); } else if (protein_id) { return this.makeRequest(`/overlap/translation/${protein_id}`, params); } else if (binding_matrix_id) { return this.makeRequest( `/species/${species}/binding_matrix/${binding_matrix_id}`, params ); } throw new Error( "Either region, protein_id, or binding_matrix_id must be provided" ); }
- src/handlers/tools.ts:453-463 (handler)Direct MCP tool handler function that normalizes user inputs and delegates to the EnsemblApiClient's getRegulatoryFeatures method.export async function handleRegulatory(args: any) { try { const normalizedArgs = normalizeEnsemblInputs(args); return await ensemblClient.getRegulatoryFeatures(normalizedArgs); } catch (error) { return { error: error instanceof Error ? error.message : "Unknown error", success: false, }; } }
- src/handlers/tools.ts:47-86 (schema)Tool definition including name, description, and detailed input schema with validation rules (anyOf requiring one of region, protein_id, or binding_matrix_id).{ name: "ensembl_regulatory", description: "Get regulatory features, binding matrices, and regulatory annotations. Covers regulatory overlap endpoints and binding matrix data.", inputSchema: { type: "object", properties: { region: { type: "string", description: "Genomic region in format 'chromosome:start-end' (e.g., '17:7565096-7590856', 'X:1000000-2000000', '6:25000000-35000000')", }, protein_id: { type: "string", description: "Protein ID for regulatory features affecting translation (e.g., 'ENSP00000288602', 'ENSP00000350283')", }, binding_matrix_id: { type: "string", description: "Binding matrix stable ID (e.g., 'ENSPFM0001', 'ENSPFM0123')", }, species: { type: "string", description: "Species name (e.g., 'homo_sapiens', 'mus_musculus')", default: "homo_sapiens", }, feature_type: { type: "string", description: "Type of regulatory feature (e.g., 'RegulatoryFeature', 'MotifFeature', 'TF_binding_site')", }, }, anyOf: [ { required: ["region"] }, { required: ["protein_id"] }, { required: ["binding_matrix_id"] }, ], }, },
- index.ts:75-83 (registration)Registration and dispatch logic in the MCP server's CallToolRequest handler switch statement, invoking the tool's handler function.case "ensembl_regulatory": return { content: [ { type: "text", text: JSON.stringify(await handleRegulatory(args), null, 2), }, ], };