Skip to main content
Glama

validate_species_name

Verify and correct scientific species names using FishBase marine biology data to ensure accurate species identification and data consistency.

Instructions

Validate and correct species scientific names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
species_nameYesScientific name to validate

Implementation Reference

  • The core handler function implementing the validation logic: checks for exact species match using getSpecies, falls back to search for suggestions.
    async validateSpeciesName(speciesName: string): Promise<{ valid: boolean; suggestions?: string[]; match?: SpeciesData }> { try { const exactMatch = await this.getSpecies(speciesName); if (exactMatch.length > 0) { return { valid: true, match: exactMatch[0] }; } const searchResults = await this.searchSpecies(speciesName, 5); return { valid: false, suggestions: searchResults.map(s => `${s.Genus} ${s.Species}`), }; } catch (error) { throw new Error(`Failed to validate species name: ${error}`); } }
  • src/index.ts:110-123 (registration)
    Tool registration in the MCP ListTools response, defining name, description, and input schema.
    { name: "validate_species_name", description: "Validate and correct species scientific names", inputSchema: { type: "object", properties: { species_name: { type: "string", description: "Scientific name to validate", }, }, required: ["species_name"], }, },
  • JSON schema defining the input parameters for the tool.
    inputSchema: { type: "object", properties: { species_name: { type: "string", description: "Scientific name to validate", }, }, required: ["species_name"], },
  • Dispatch handler in MCP CallToolRequestHandler that calls the validateSpeciesName method with parsed arguments and formats response.
    case "validate_species_name": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.validateSpeciesName(args.species_name as string), null, 2 ), }, ], };

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/lundgrenalex/mcp-fishbase'

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