Skip to main content
Glama

common_to_scientific

Convert fish common names to scientific names using FishBase marine biology data for accurate species identification and research.

Instructions

Convert common name to scientific name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
common_nameYesCommon name of the fish

Implementation Reference

  • Handler for the 'common_to_scientific' tool in the MCP CallToolRequestSchema. It invokes the FishBaseAPI method and returns the result as JSON text content.
    case "common_to_scientific": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.commonToScientific(args.common_name as string), null, 2 ), }, ], };
  • Input schema definition for the 'common_to_scientific' tool, specifying that 'common_name' (string) is required.
    inputSchema: { type: "object", properties: { common_name: { type: "string", description: "Common name of the fish", }, }, required: ["common_name"], },
  • src/index.ts:124-137 (registration)
    Registration of the 'common_to_scientific' tool in the MCP server's ListTools response, including name, description, and input schema.
    { name: "common_to_scientific", description: "Convert common name to scientific name", inputSchema: { type: "object", properties: { common_name: { type: "string", description: "Common name of the fish", }, }, required: ["common_name"], }, },
  • Helper method in FishBaseAPI that implements the core logic: queries the 'species' table and filters rows where FBname contains the given common name, returning up to 10 matches.
    async commonToScientific(commonName: string): Promise<SpeciesData[]> { try { const speciesData = await this.queryTable('species'); const filtered = speciesData.filter((row: any) => row.FBname?.toLowerCase().includes(commonName.toLowerCase()) ); return filtered.slice(0, 10); } catch (error) { throw new Error(`Failed to convert common name: ${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