Skip to main content
Glama
lalrow

AI Makerspace MCP Demo Server

by lalrow

animal_fact

Retrieve interesting facts about animals by specifying a species name. This tool provides educational information for learning about wildlife characteristics and behaviors.

Instructions

Get a fun fact about a given animal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
animalNodog

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:69-78 (handler)
    The main handler function for the 'animal_fact' tool. It takes an optional animal name (default 'dog'), fetches a fun fact from 'https://some-random-api.com/facts/{animal}', and returns the fact or an error message.
    def animal_fact(animal: str = "dog") -> str:
        """Get a fun fact about a given animal."""
        try:
            url = f"https://some-random-api.com/facts/{animal.lower()}"
            r = requests.get(url)
            if r.status_code == 200:
                return r.json().get("fact", "No fact found.")
            return f"⚠️ API error: {r.status_code}"
        except Exception as e:
            return f"❌ Something went wrong: {e}"
  • server.py:68-68 (registration)
    The @mcp.tool() decorator registers the 'animal_fact' function as an MCP tool.
    @mcp.tool()
  • Tool schema defined via function signature (input: animal str default 'dog', output: str) and docstring.
    def animal_fact(animal: str = "dog") -> str:
        """Get a fun fact about a given animal."""

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other 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/lalrow/AIE8-MCP-Session'

If you have feedback or need assistance with the MCP directory API, please join our Discord server