percentage_change
Calculate the percentage change between two numeric values to determine 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:823-842 (schema)Input schema definition for the percentage_change tool, defining two required params: 'from' (number) and 'to' (number), with a description 'Percentage change from A to B. e.g., 50→80 = +60%'.
{ 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:1706-1711 (handler)The actual handler function for percentage_change. Calculates percentage change from 'from' to 'to' using the formula ((to - from) / from) * 100. Throws an error 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:82-83 (registration)Registration of percentage_change in the 'standard' tool tier set, which determines which tools are exposed to the LLM.
"sum", "avg", "min", "max", "count", "variance", "std_dev", "percentage_of", "percentage_change", "percentage_reverse", - cruncher.js:144-146 (registration)Registration of percentage_change in MAIN_THREAD_TOOLS set, marking it as an instant tool that runs in the main thread without worker overhead.
"count", "min", "max", "variance", "std_dev", // Percentage "percentage_of", "percentage_change", "percentage_reverse",