ensembl_ontotax
Search and explore ontology terms (GO, EFO, HP, MP) or traverse NCBI taxonomy classifications. Retrieve related terms by relationships like ancestors, descendants, or parents for genomic data analysis.
Instructions
Ontology term search and NCBI taxonomy traversal. Search GO terms, phenotype ontologies, and taxonomic classifications.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ontology | No | Ontology to search in | |
| relation | No | Relationship to explore in ontology | |
| species | No | Species for taxonomy search (e.g., 'homo_sapiens', 'mus_musculus', 'drosophila_melanogaster') | |
| term | No | Ontology term or taxonomy term to search (e.g., 'protein binding', 'cell cycle', 'mitochondrion', 'Homo sapiens') | |
| term_id | No | Specific ontology term ID (e.g., 'GO:0008150', 'GO:0005515', 'HP:0000001', 'MP:0000001') |
Implementation Reference
- src/handlers/tools.ts:549-559 (handler)The direct handler function for the 'ensembl_ontotax' tool. Normalizes inputs and delegates to EnsemblApiClient.getOntologyTaxonomy for execution.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/handlers/tools.ts:393-433 (schema)Tool schema definition including input validation schema for 'ensembl_ontotax' within the ensemblTools array used for tool listing.{ 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)Registration in the MCP server's CallToolRequest handler 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), }, ], };
- src/utils/ensembl-api.ts:464-492 (handler)Core implementation of the tool logic in EnsemblApiClient.getOntologyTaxonomy, handling ontology term searches and NCBI taxonomy queries via Ensembl REST API endpoints.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" ); }