Skip to main content
Glama
knustx

ITIS MCP Server

by knustx

explore_taxonomy

Find related organisms at different taxonomic levels using scientific names to explore biological classifications and relationships.

Instructions

Explore taxonomic relationships by finding related organisms at different taxonomic levels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scientificNameYesScientific name to explore (e.g., "Homo sapiens")
levelYesTaxonomic level to explore: "siblings" (same genus), "family" (same family), "order" (same order), "class" (same class)
rowsNoNumber of results to return (default: 10)

Implementation Reference

  • The handler function that implements the core logic of the 'explore_taxonomy' tool. It retrieves the target organism, constructs a SOLR query based on the specified taxonomic level, searches for related species, and formats the response with target details and related results.
    case 'explore_taxonomy': {
      const { scientificName, level, rows } = args as any;
      
      // First, get the target organism's details
      const targetResult = await itisClient.searchByScientificName(scientificName);
      if (targetResult.response.numFound === 0) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                error: `No organism found with scientific name: ${scientificName}`,
              }, null, 2),
            },
          ],
        };
      }
      
      const target = targetResult.response.docs[0];
      let searchQuery = '';
      let description = '';
      
      switch (level) {
        case 'siblings':
          if (target.unit1) {
            searchQuery = `unit1:"${target.unit1}" AND rank:Species`;
            description = `Other species in genus ${target.unit1}`;
          }
          break;
        case 'family':
          if (target.hierarchySoFarWRanks && target.hierarchySoFarWRanks[0]) {
            const hierarchy = target.hierarchySoFarWRanks[0];
            const familyMatch = hierarchy.match(/Family:([^$]+)/);
            if (familyMatch) {
              const family = familyMatch[1];
              searchQuery = `hierarchySoFarWRanks:*Family\\:${family}* AND rank:Species`;
              description = `Other species in family ${family}`;
            }
          }
          break;
        case 'order':
          if (target.hierarchySoFarWRanks && target.hierarchySoFarWRanks[0]) {
            const hierarchy = target.hierarchySoFarWRanks[0];
            const orderMatch = hierarchy.match(/Order:([^$]+)/);
            if (orderMatch) {
              const order = orderMatch[1];
              searchQuery = `hierarchySoFarWRanks:*Order\\:${order}* AND rank:Species`;
              description = `Other species in order ${order}`;
            }
          }
          break;
        case 'class':
          if (target.hierarchySoFarWRanks && target.hierarchySoFarWRanks[0]) {
            const hierarchy = target.hierarchySoFarWRanks[0];
            const classMatch = hierarchy.match(/Class:([^$]+)/);
            if (classMatch) {
              const cls = classMatch[1];
              searchQuery = `hierarchySoFarWRanks:*Class\\:${cls}* AND rank:Species`;
              description = `Other species in class ${cls}`;
            }
          }
          break;
      }
      
      if (!searchQuery) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                error: `Unable to find taxonomic information for level: ${level}`,
                target: target,
              }, null, 2),
            },
          ],
        };
      }
      
      const relatedResult = await itisClient.search({
        query: searchQuery,
        rows: rows || 10,
        sort: 'nameWInd asc'
      });
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              target: {
                name: target.nameWInd,
                tsn: target.tsn,
                rank: target.rank,
              },
              exploration: {
                level: level,
                description: description,
                totalResults: relatedResult.response.numFound,
                results: relatedResult.response.docs.map((doc: any) => ({
                  tsn: doc.tsn,
                  name: doc.nameWInd,
                  kingdom: doc.kingdom,
                  rank: doc.rank,
                  commonNames: processVernacularNames(doc.vernacular, 'English'),
                  usage: doc.usage,
                })),
              },
            }, null, 2),
          },
        ],
      };
    }
  • Input schema for the 'explore_taxonomy' tool, defining required parameters scientificName and level (with enum), and optional rows.
    inputSchema: {
      type: 'object',
      properties: {
        scientificName: {
          type: 'string',
          description: 'Scientific name to explore (e.g., "Homo sapiens")',
        },
        level: {
          type: 'string',
          description: 'Taxonomic level to explore: "siblings" (same genus), "family" (same family), "order" (same order), "class" (same class)',
          enum: ['siblings', 'family', 'order', 'class']
        },
        rows: {
          type: 'number',
          description: 'Number of results to return (default: 10)',
        },
      },
      required: ['scientificName', 'level'],
    },
  • src/tools.ts:189-211 (registration)
    Registration of the 'explore_taxonomy' tool in the tools array, which is used for listing tools and validation.
    {
      name: 'explore_taxonomy',
      description: 'Explore taxonomic relationships by finding related organisms at different taxonomic levels.',
      inputSchema: {
        type: 'object',
        properties: {
          scientificName: {
            type: 'string',
            description: 'Scientific name to explore (e.g., "Homo sapiens")',
          },
          level: {
            type: 'string',
            description: 'Taxonomic level to explore: "siblings" (same genus), "family" (same family), "order" (same order), "class" (same class)',
            enum: ['siblings', 'family', 'order', 'class']
          },
          rows: {
            type: 'number',
            description: 'Number of results to return (default: 10)',
          },
        },
        required: ['scientificName', 'level'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'finding related organisms' but lacks details on permissions, rate limits, data sources, or response format (e.g., list of species with attributes). For a tool with 3 parameters and no output schema, this leaves significant gaps in understanding how it behaves and what to expect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Explore taxonomic relationships') and adds key context ('by finding related organisms at different taxonomic levels'). There is zero waste, and every word contributes to understanding the tool's function, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no annotations, no output schema), the description is incomplete. It lacks behavioral details (e.g., what 'related organisms' means in practice), usage guidelines, and output expectations. While concise, it doesn't provide enough context for an agent to fully understand how to invoke and interpret results, especially without structured support from annotations or output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond the schema's details (e.g., it doesn't explain how 'level' affects results or provide examples beyond the enum). With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Explore taxonomic relationships by finding related organisms at different taxonomic levels.' It specifies the verb ('explore') and resource ('taxonomic relationships'), and distinguishes it from siblings like 'get_hierarchy' or 'search_by_scientific_name' by focusing on related organisms rather than hierarchical or search functions. However, it doesn't explicitly contrast with all siblings (e.g., 'search_by_rank'), keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'different taxonomic levels' but doesn't specify contexts or exclusions, such as when to prefer 'get_hierarchy' for full lineage or 'search_by_rank' for broader queries. Without explicit when/when-not instructions or named alternatives, it offers minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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