Skip to main content
Glama

get_species

Retrieve detailed species information from FishBase marine biology database using scientific names. Access ecological data, distribution records, morphological details, and validate species names.

Instructions

Get species information from FishBase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
species_nameYesScientific name of the species (e.g., 'Salmo trutta')
fieldsNoOptional list of specific fields to return

Implementation Reference

  • Core implementation of get_species tool: queries the species table, matches by scientific name (genus + species), filters optional fields, and returns matching SpeciesData.
    async getSpecies(speciesName: string, fields?: string[]): Promise<SpeciesData[]> { try { const speciesData = await this.queryTable('species'); const [genus, species] = speciesName.split(' '); const filtered = speciesData.filter((row: any) => row.Genus?.toLowerCase() === genus?.toLowerCase() && row.Species?.toLowerCase() === species?.toLowerCase() ); if (fields && fields.length > 0) { return filtered.map((row: any) => { const result: any = {}; fields.forEach(field => { if (row[field] !== undefined) { result[field] = row[field]; } }); return result; }); } return filtered; } catch (error) { throw new Error(`Failed to get species data: ${error}`); } }
  • MCP CallToolRequest handler dispatches 'get_species' calls to FishBaseAPI.getSpecies and returns JSON-formatted response.
    case "get_species": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.getSpecies(args.species_name as string, args.fields as string[]), null, 2 ), }, ], };
  • Registration and input schema definition for the 'get_species' tool in ListTools response.
    { name: "get_species", description: "Get species information from FishBase", inputSchema: { type: "object", properties: { species_name: { type: "string", description: "Scientific name of the species (e.g., 'Salmo trutta')", }, fields: { type: "array", items: { type: "string" }, description: "Optional list of specific fields to return", }, }, required: ["species_name"], }, },
  • TypeScript interface defining the structure of species data returned by getSpecies.
    interface SpeciesData { SpecCode?: number; Genus?: string; Species?: string; FBname?: string; Length?: number; CommonLength?: number; MaxLengthRef?: number; Weight?: number; [key: string]: any; }

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