Skip to main content
Glama
lundgrenalex

MCP FishBase Server

by lundgrenalex

get_morphology

Retrieve morphological and physiological data for marine species from FishBase to analyze physical characteristics and biological traits.

Instructions

Get morphological and physiological data for a species

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
species_nameYesScientific name of the species

Implementation Reference

  • src/index.ts:96-109 (registration)
    Registration of the 'get_morphology' MCP tool in the server's listTools response, including its input schema definition.
    {
      name: "get_morphology",
      description: "Get morphological and physiological data for a species",
      inputSchema: {
        type: "object",
        properties: {
          species_name: {
            type: "string",
            description: "Scientific name of the species",
          },
        },
        required: ["species_name"],
      },
    },
  • Handler for the 'get_morphology' tool in the MCP server's CallToolRequestSchema, which calls FishBaseAPI.getMorphology and returns the result as formatted JSON text content.
    case "get_morphology":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await fishbaseAPI.getMorphology(args.species_name as string),
              null,
              2
            ),
          },
        ],
      };
  • Core implementation of getMorphology method in FishBaseAPI class. Retrieves the species SpecCode and filters the 'morphdat' table data for morphological information.
    async getMorphology(speciesName: string): Promise<any[]> {
      try {
        const speciesData = await this.getSpecies(speciesName);
        if (speciesData.length === 0) {
          throw new Error(`Species not found: ${speciesName}`);
        }
        
        const specCode = speciesData[0].SpecCode;
        const morphData = await this.queryTable('morphdat');
        
        return morphData.filter((row: any) => row.SpecCode === specCode);
      } catch (error) {
        throw new Error(`Failed to get morphology data: ${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