Skip to main content
Glama
lalrow

AI Makerspace MCP Demo Server

by lalrow

number_fact

Retrieve interesting facts about numbers or dates using the NumbersAPI. Enter a number or date to get a factual response.

Instructions

Get an interesting fact about a number or date using NumbersAPI.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:29-40 (handler)
    This is the handler function for the 'number_fact' tool. It fetches an interesting fact about a number or date from numbersapi.com using an HTTP request. The @mcp.tool() decorator registers it with the MCP server.
    def number_fact(query: str) -> str:
        """Get an interesting fact about a number or date using NumbersAPI."""
        try:
            # You can pass things like "42", "math/42", or "date/6/14"
            url = f"http://numbersapi.com/{query}"
            response = requests.get(url)
            if response.status_code == 200:
                return response.text
            else:
                return f"⚠️ API error: {response.status_code}"
        except Exception as e:
            return f"❌ Something went wrong: {e}"

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