Skip to main content
Glama

max

Identify the maximum value from a list of numbers using a simple API for accurate numerical calculations, supported by the Math-MCP server.

Instructions

Finds the maximum value from a list of numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYesArray of numbers to find the maximum of

Implementation Reference

  • The static `max` method in Statistics class that executes the core tool logic: finds the maximum value in the input array using `Math.max(...numbers)`.
    static max(numbers: number[]) { const maxValue = Math.max(...numbers); return maxValue }
  • src/index.ts:199-210 (registration)
    Registers the "max" MCP tool, including input schema validation with Zod and the handler function that calls `Statistics.max` and formats the response.
    mathServer.tool("max", "Finds the maximum value from a list of numbers", { numbers: z.array(z.number()).describe("Array of numbers to find the maximum of") }, async ({ numbers }) => { const value = Statistics.max(numbers) return { content: [{ type: "text", text: `${value}` }] } })
  • Zod schema definition for the "max" tool input: an array of numbers.
    numbers: z.array(z.number()).describe("Array of numbers to find the maximum of")

Other Tools

Related 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/EthanHenrickson/math-mcp'

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