min
Calculates the minimum value from a list of numbers. Provide an array of numbers to get the smallest one.
Instructions
Minimum of numbers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| numbers | Yes |
Implementation Reference
- cruncher.js:591-627 (registration)Tool 'min' registration in the master tool catalog (toolsAll array). Defines name, annotations, description, and inputSchema requiring an array of numbers.
{ name: "median", annotations: { title: "Median", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Median of numbers.", inputSchema: { type: "object", properties: { numbers: { type: "array", items: { type: "number" } }, timeout: { type: "number", minimum: 100, maximum: 60000, description: "Custom timeout in ms (100-60000, default: 3000)" }, }, required: ["numbers"], }, }, { name: "min", annotations: { title: "Minimum", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Minimum of numbers.", inputSchema: { type: "object", properties: { numbers: { type: "array", items: { type: "number" } }, }, required: ["numbers"], }, }, - cruncher.js:620-626 (schema)Input schema for the 'min' tool: requires an array of numbers.
inputSchema: { type: "object", properties: { numbers: { type: "array", items: { type: "number" } }, }, required: ["numbers"], }, - cruncher.js:1562-1570 (handler)Handler function for the 'min' tool. Iterates over numbers array to find and return the minimum value. Throws error for empty array.
min: ({ numbers }) => { if (numbers.length === 0) throw new Error("Cannot find the minimum of an empty list."); let minVal = Infinity; for (let i = 0; i < numbers.length; i++) { if (numbers[i] < minVal) minVal = numbers[i]; } return minVal; }, - cruncher.js:82-82 (registration)'min' listed in the standard tool tier (TOOL_TIERS.standard) — enabled by default.
"sum", "avg", "min", "max", "count", "variance", "std_dev", - cruncher.js:136-155 (helper)'min' listed in MAIN_THREAD_TOOLS set, meaning it runs in the main thread without worker overhead for performance.
const MAIN_THREAD_TOOLS = new Set([ // Angle management "set_angle_mode", "get_angle_mode", // Trigonometry (instant Math calls) "sine", "cosine", "tangent", "asin", "acos", "atan", // Cache management "cache_clear", "cache_info", // Simple stats (zero-cost) "count", "min", "max", "variance", "std_dev", // Percentage "percentage_of", "percentage_change", "percentage_reverse", // Math one-liners "power", "sqrt", "logarithm", "natural_log", "absolute", // Constant lookup "get_constant", // Memory recall (single variable read) "memory_recall", // Unit conversion "convert_unit", ]);