Skip to main content
Glama

get_hierarchy

Retrieve the full taxonomic hierarchy for a specific Taxonomic Serial Number (TSN) using the ITIS MCP Server, enabling detailed classification and navigation of species relationships.

Instructions

Get the complete taxonomic hierarchy for a given TSN.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tsnYesTaxonomic Serial Number (TSN) to get hierarchy for

Implementation Reference

  • The main MCP tool handler for 'get_hierarchy'. Extracts the 'tsn' parameter, calls itisClient.getHierarchy(tsn), formats the hierarchy from response.docs, and returns 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), }, ], }; }
  • Input schema definition for the get_hierarchy tool, requiring a 'tsn' string parameter.
    inputSchema: { type: 'object', properties: { tsn: { type: 'string', description: 'Taxonomic Serial Number (TSN) to get hierarchy for', }, }, required: ['tsn'], },
  • src/tools.ts:261-265 (registration)
    Registration of the tool list handler that exposes the get_hierarchy tool (among others) via MCP listTools request.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools, }; });
  • Helper method in ITISClient that performs the actual ITIS API search for hierarchy by TSN, selecting relevant taxonomic 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'] }); }
  • src/index.ts:22-23 (registration)
    Final server registration call that sets up all tool handlers including get_hierarchy via setupToolHandlers.
    setupToolHandlers(server, itisClient); setupPromptHandlers(server);

Other Tools

Related Tools

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/knustx/itis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server