Skip to main content
Glama

search_species

Find marine species by common name or partial scientific name using natural language queries. Retrieve species information, ecological data, and distribution records from FishBase database.

Instructions

Search for species by common name or partial scientific name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (default: 20)
queryYesSearch term (common name or partial scientific name)

Implementation Reference

  • Input schema definition for the 'search_species' MCP tool, specifying query (required string) and optional limit (number, default 20).
    { name: "search_species", description: "Search for species by common name or partial scientific name", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search term (common name or partial scientific name)", }, limit: { type: "number", description: "Maximum number of results to return (default: 20)", default: 20, }, }, required: ["query"], }, },
  • MCP CallTool handler for 'search_species': extracts arguments, calls FishBaseAPI.searchSpecies, stringifies result as JSON text content.
    case "search_species": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.searchSpecies(args.query as string, (args.limit as number) || 20), null, 2 ), }, ], };
  • Core searchSpecies method in FishBaseAPI: queries 'species' table, filters by query matching scientific or common names (case-insensitive), limits results, returns SpeciesData array.
    async searchSpecies(query: string, limit: number = 20): Promise<SpeciesData[]> { try { const speciesData = await this.queryTable('species'); const lowerQuery = query.toLowerCase(); const filtered = speciesData.filter((row: any) => { const scientificName = `${row.Genus || ''} ${row.Species || ''}`.toLowerCase(); const commonName = (row.FBname || '').toLowerCase(); return scientificName.includes(lowerQuery) || commonName.includes(lowerQuery); }).slice(0, limit); return filtered; } catch (error) { throw new Error(`Failed to search species: ${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