get_hierarchy
Retrieve the complete taxonomic hierarchy for a specified Taxonomic Serial Number (TSN) from the Integrated Taxonomic Information System database.
Instructions
Get the complete taxonomic hierarchy for a given TSN.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tsn | Yes | Taxonomic Serial Number (TSN) to get hierarchy for |
Implementation Reference
- src/tools.ts:360-374 (handler)The MCP tool handler for 'get_hierarchy'. Extracts 'tsn' argument, invokes ITISClient.getHierarchy(tsn), and formats the response as JSON text content.case 'get_hierarchy': { const { tsn } = args as any; const result = await itisClient.getHierarchy(tsn); return { content: [ { type: 'text', text: JSON.stringify({ tsn, hierarchy: result.response.docs, }, null, 2), }, ], }; }
- src/tools.ts:127-140 (registration)Tool registration definition including name, description, and input schema for 'get_hierarchy' in the tools array used by ListToolsRequestHandler.{ name: 'get_hierarchy', description: 'Get the complete taxonomic hierarchy for a given TSN.', inputSchema: { type: 'object', properties: { tsn: { type: 'string', description: 'Taxonomic Serial Number (TSN) to get hierarchy for', }, }, required: ['tsn'], }, },
- src/itis-client.ts:187-192 (helper)Core helper method in ITISClient that implements getHierarchy by performing a targeted SOLR search for the TSN with hierarchy-relevant fields.async getHierarchy(tsn: string): Promise<ITISResponse> { return this.search({ query: `tsn:${tsn}`, fields: ['tsn', 'nameWInd', 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species', 'rank', 'phyloSort'] }); }