search_by_kingdom
Query the ITIS database to find organisms within a specified taxonomic kingdom, such as Animalia, Plantae, or Fungi, with options for pagination and result limits.
Instructions
Search for organisms within a specific kingdom in ITIS database.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kingdom | Yes | Kingdom name (e.g., "Animalia", "Plantae", "Fungi", "Bacteria") | |
| rows | No | Number of results to return (default: 10) | |
| start | No | Starting index for pagination (default: 0) |
Implementation Reference
- src/tools.ts:324-340 (handler)The MCP tool handler for 'search_by_kingdom'. Extracts input parameters (kingdom, rows, start), calls the ITIS client method, and returns formatted JSON response with search results.case 'search_by_kingdom': { const { kingdom, rows, start } = args as any; const result = await itisClient.searchByKingdom(kingdom, { rows, start }); return { content: [ { type: 'text', text: JSON.stringify({ kingdom, totalResults: result.response.numFound, start: result.response.start, results: result.response.docs, }, null, 2), }, ], }; }
- src/tools.ts:83-104 (registration)Registration of the 'search_by_kingdom' tool in the tools array, including name, description, and input schema. This is returned by ListToolsRequestHandler.{ name: 'search_by_kingdom', description: 'Search for organisms within a specific kingdom in ITIS database.', inputSchema: { type: 'object', properties: { kingdom: { type: 'string', description: 'Kingdom name (e.g., "Animalia", "Plantae", "Fungi", "Bacteria")', }, rows: { type: 'number', description: 'Number of results to return (default: 10)', }, start: { type: 'number', description: 'Starting index for pagination (default: 0)', }, }, required: ['kingdom'], }, },
- src/tools.ts:86-102 (schema)Input schema for the search_by_kingdom tool, validating kingdom (required string), optional rows and start (numbers).inputSchema: { type: 'object', properties: { kingdom: { type: 'string', description: 'Kingdom name (e.g., "Animalia", "Plantae", "Fungi", "Bacteria")', }, rows: { type: 'number', description: 'Number of results to return (default: 10)', }, start: { type: 'number', description: 'Starting index for pagination (default: 0)', }, }, required: ['kingdom'],
- src/itis-client.ts:167-175 (helper)Supporting helper method in ITISClient that performs the kingdom-filtered search by adding a kingdom filter to the general search method.async searchByKingdom(kingdom: string, options: Partial<ITISSearchOptions> = {}): Promise<ITISResponse> { return this.search({ ...options, filters: { ...options.filters, kingdom: `"${kingdom}"` } }); }