common_to_scientific
Convert fish common names to scientific names using the MCP FishBase Server. Input a fish’s common name to retrieve its precise scientific nomenclature for research or identification.
Instructions
Convert common name to scientific name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| common_name | Yes | Common name of the fish |
Implementation Reference
- src/index.ts:243-255 (handler)MCP tool handler for 'common_to_scientific': calls fishbaseAPI.commonToScientific with the provided common_name argument and returns the result as formatted JSON text content.case "common_to_scientific": return { content: [ { type: "text", text: JSON.stringify( await fishbaseAPI.commonToScientific(args.common_name as string), null, 2 ), }, ], };
- src/fishbase-api.ts:137-149 (helper)Core implementation of common name to scientific name lookup: filters species data by matching FBname (common name) against input, returns top 10 matches using mock data via queryTable.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}`); } }
- src/index.ts:124-137 (registration)Tool registration in ListTools response, including name, description, and input schema requiring 'common_name' string.{ 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"], }, },
- src/index.ts:127-136 (schema)Input schema definition for the 'common_to_scientific' tool, specifying 'common_name' as required string.inputSchema: { type: "object", properties: { common_name: { type: "string", description: "Common name of the fish", }, }, required: ["common_name"], },