Skip to main content
Glama
calculator.py822 B
"""Simple calculator module for testing.""" class Calculator: """A basic calculator class.""" def add(self, a: float, b: float) -> float: """Add two numbers.""" return a + b def subtract(self, a: float, b: float) -> float: """Subtract b from a.""" return a - b def multiply(self, a: float, b: float) -> float: """Multiply two numbers.""" return a * b def divide(self, a: float, b: float) -> float: """Divide a by b.""" if b == 0: raise ValueError("Cannot divide by zero") return a / b def factorial(n: int) -> int: """Calculate factorial of n.""" if n < 0: raise ValueError("Factorial not defined for negative numbers") if n == 0 or n == 1: return 1 return n * factorial(n - 1)

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/mhalder/qdrant-mcp-server'

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