percentage_change
Calculate percentage change between two numbers. Enter the initial and final values to get the percent increase or decrease.
Instructions
Percentage change from A to B. e.g., 50→80 = +60%
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | ||
| to | Yes |
Implementation Reference
- cruncher.js:69-77 (registration)Tool name listed in the 'standard' tool tier, making it available by default.
standard: [ "evaluate_expression", "add", "subtract", "multiply", "divide", "sqrt", "power", "absolute", "modulo", "factorial", "logarithm", "natural_log", "get_constant", "sine", "cosine", "tangent", "asin", "acos", "atan", "set_angle_mode", "get_angle_mode", "sum", "avg", "min", "max", "count", "variance", "std_dev", "percentage_of", "percentage_change", "percentage_reverse", - cruncher.js:817-836 (schema)Input schema/tool definition for percentage_change: accepts 'from' and 'to' (both numbers, both required).
{ name: "percentage_change", annotations: { title: "Percentage Change", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, description: "Percentage change from A to B. e.g., 50→80 = +60%", inputSchema: { type: "object", properties: { from: { type: "number" }, to: { type: "number" }, }, required: ["from", "to"], }, }, - cruncher.js:1688-1693 (handler)Handler function that computes percentage change from 'from' to 'to': ((to - from) / from) * 100. Throws if 'from' is zero.
percentage_change: ({ from, to }) => { // % change from A to B: ((to - from) / from) * 100 if (from === 0) throw new Error("Cannot calculate percentage change from zero."); return ((to - from) / from) * 100; }, - cruncher.js:140-149 (helper)Listed in MAIN_THREAD_TOOLS set, meaning it runs synchronously on the main thread without worker overhead.
"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", ]);