Skip to main content
Glama

get_species

Retrieve detailed species information from FishBase with 'get_species'. Input the scientific name to access data on ecology, distribution, morphology, and more, or specify fields for tailored results.

Instructions

Get species information from FishBase

Input Schema

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

Implementation Reference

  • Input schema and description for the get_species MCP tool, registered in ListToolsRequestHandler
    { 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"], }, },
  • Handler for the get_species tool in CallToolRequestHandler: extracts arguments, calls fishbaseAPI.getSpecies, stringifies and returns as text content
    case "get_species": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.getSpecies(args.species_name as string, args.fields as string[]), null, 2 ), }, ], };
  • Main logic for retrieving species data: loads species table, filters by exact genus+species match (case-insensitive), optionally projects specific fields
    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}`); } }

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

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