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
| Name | Required | Description | Default |
|---|---|---|---|
| numbers | Yes | Array of numbers to find the maximum of |
Implementation Reference
- src/Classes/Statistics.ts:95-99 (handler)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}` }] } })
- src/index.ts:200-200 (schema)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")