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 to enhance learning and satisfy curiosity.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • server.py:28-40 (handler)
    The number_fact tool handler function, registered via @mcp.tool(). It fetches and returns an interesting fact about the provided number or date query from the NumbersAPI.
    @mcp.tool() 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}"
  • server.py:28-28 (registration)
    Registration of the number_fact tool using the @mcp.tool() decorator.
    @mcp.tool()

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