ensembl_ontotax
Search ontology terms and traverse NCBI taxonomy to find biological classifications, gene functions, and species relationships in genomic data.
Instructions
Ontology term search and NCBI taxonomy traversal. Search GO terms, phenotype ontologies, and taxonomic classifications.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Ontology term or taxonomy term to search (e.g., 'protein binding', 'cell cycle', 'mitochondrion', 'Homo sapiens') | |
| ontology | No | Ontology to search in | |
| term_id | No | Specific ontology term ID (e.g., 'GO:0008150', 'GO:0005515', 'HP:0000001', 'MP:0000001') | |
| species | No | Species for taxonomy search (e.g., 'homo_sapiens', 'mus_musculus', 'drosophila_melanogaster') | |
| relation | No | Relationship to explore in ontology |
Implementation Reference
- src/handlers/tools.ts:549-559 (handler)The main handler function for the 'ensembl_ontotax' tool. It normalizes the input arguments and calls the Ensembl API client to perform the ontology/taxonomy query.export async function handleOntoTax(args: any) { try { const normalizedArgs = normalizeEnsemblInputs(args); return await ensemblClient.getOntologyTaxonomy(normalizedArgs); } catch (error) { return { error: error instanceof Error ? error.message : "Unknown error", success: false, }; } }
- src/utils/ensembl-api.ts:464-492 (helper)Core helper function implementing the logic for ontology term search and NCBI taxonomy traversal by constructing appropriate Ensembl REST API requests.async getOntologyTaxonomy(args: any): Promise<any> { const { term, ontology, term_id, species, relation } = args; const params: Record<string, string> = {}; if (relation) { params.relation = relation; } if (term_id) { return this.makeRequest(`/ontology/id/${term_id}`, params); } if (ontology === "taxonomy") { if (species) { return this.makeRequest(`/taxonomy/id/${species}`, params); } else if (term) { return this.makeRequest(`/taxonomy/name/${term}`, params); } } else if (ontology && term) { return this.makeRequest(`/ontology/name/${term}`, { ...params, ontology, }); } throw new Error( "Invalid combination of parameters for ontology/taxonomy search" ); }
- src/handlers/tools.ts:393-432 (schema)The input schema definition for the 'ensembl_ontotax' tool, defining parameters, descriptions, enums, and validation rules.{ name: "ensembl_ontotax", description: "Ontology term search and NCBI taxonomy traversal. Search GO terms, phenotype ontologies, and taxonomic classifications.", inputSchema: { type: "object", properties: { term: { type: "string", description: "Ontology term or taxonomy term to search (e.g., 'protein binding', 'cell cycle', 'mitochondrion', 'Homo sapiens')", }, ontology: { type: "string", enum: ["GO", "EFO", "HP", "MP", "taxonomy"], description: "Ontology to search in", }, term_id: { type: "string", description: "Specific ontology term ID (e.g., 'GO:0008150', 'GO:0005515', 'HP:0000001', 'MP:0000001')", }, species: { type: "string", description: "Species for taxonomy search (e.g., 'homo_sapiens', 'mus_musculus', 'drosophila_melanogaster')", }, relation: { type: "string", enum: ["children", "parents", "ancestors", "descendants"], description: "Relationship to explore in ontology", }, }, anyOf: [ { required: ["term", "ontology"] }, { required: ["term_id"] }, { required: ["species"] }, ], }, },
- index.ts:159-167 (registration)Tool dispatch registration in the main server switch statement, routing 'ensembl_ontotax' calls to the handleOntoTax function.case "ensembl_ontotax": return { content: [ { type: "text", text: JSON.stringify(await handleOntoTax(args), null, 2), }, ], };