Calculate percentage change between two values with precise arithmetic. Access via MCP in Cursor, Claude Code, or other AI tools, or REST API at `/v1/finance/percentage-change`. Pass original and new values to get accurate percentage change — useful for financial analysis, performance metrics, or data comparison without floating-point errors.
curl "https://tinyfn.io/v1/finance/percentage-change" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/finance/percentage-change', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/finance/percentage-change',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's finance tools:
{
"mcpServers": {
"tinyfn-finance": {
"url": "https://tinyfn.io/mcp/finance",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Pass the original value and new value as parameters. The tool returns the percentage change using the formula: ((new - original) / original) × 100.
Division by zero returns an error or infinity depending on implementation. Use a small epsilon value or handle zero baseline cases separately in your application logic.
Yes, AI agents can call this tool directly through MCP to calculate stock price changes, revenue growth, or any metric comparison without manual percentage calculations.
Yes, decreases return negative percentages. For example, going from 100 to 80 returns -20%, while 80 to 100 returns +25%.
Percentage change uses the original value as the denominator and shows directional change. Percentage difference typically uses the average of both values as the denominator.
Get your free API key and start using Percentage Change in seconds.
Get Free API Key