Calculates discounted prices from original amounts and percentage rates. Use via MCP in Cursor or Windsurf, or call GET /v1/finance/discount with original_price and discount_percentage parameters. Returns the final price after discount — if you pass $100 with 20% discount, you get $80. Essential for e-commerce calculations and financial modeling in AI agents.
curl "https://tinyfn.io/v1/finance/discount" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/finance/discount', {
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/discount',
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_price and discount_percentage to get the final amount. For $50 with 25% off: original_price=50, discount_percentage=25 returns $37.50.
This tool uses percentage-based discounts (e.g., 20% off). It calculates the final price after applying the percentage reduction to the original amount.
Yes, it works in Cursor, Claude Code, GitHub Copilot, Windsurf, Cline, OpenClaw, and Zed via MCP. Perfect for building pricing logic in e-commerce applications.
Yes. 0% discount returns the original price unchanged, while 100% discount returns $0. Handles fractional percentages accurately.
Returns JSON with the calculated discounted price as a numeric value, typically rounded to 2 decimal places for currency precision.
Get your free API key and start using Calculate Discount in seconds.
Get Free API Key