Skip to main content
Glama
utils.ex728 B
defmodule TestRepo.Utils do @moduledoc """ Utility functions for TestRepo. """ @doc """ Converts a string to uppercase. ## Examples iex> TestRepo.Utils.upcase("hello") "HELLO" """ def upcase(string) when is_binary(string) do String.upcase(string) end @doc """ Calculates the factorial of a number. ## Examples iex> TestRepo.Utils.factorial(5) 120 """ def factorial(0), do: 1 def factorial(n) when n > 0 do n * factorial(n - 1) end @doc """ Checks if a number is even. ## Examples iex> TestRepo.Utils.even?(4) true iex> TestRepo.Utils.even?(3) false """ def even?(n) when is_integer(n) do rem(n, 2) == 0 end end

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/ryota-murakami/serena'

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