Skip to main content
Glama

search_species

Find marine species by entering common names or partial scientific names to retrieve detailed biological information from FishBase data.

Instructions

Search for species by common name or partial scientific name

Input Schema

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

Implementation Reference

  • MCP tool handler for 'search_species': calls fishbaseAPI.searchSpecies with query and limit parameters, stringifies the result as JSON text response.
    case "search_species": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.searchSpecies(args.query as string, (args.limit as number) || 20), null, 2 ), }, ], };
  • src/index.ts:49-67 (registration)
    Registration of the 'search_species' tool in ListToolsRequestHandler, including name, description, and input schema definition.
    { 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"], }, },
  • Core implementation of species search: filters species data from 'species' table by matching query against scientific or common names, limits results.
    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}`); } }

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