Validates credit card numbers using the Luhn algorithm checksum to verify mathematical validity. Available via MCP in Cursor and other AI editors, or REST API at `/v1/validate/credit-card`. Pass any card number like `4532015112830366` and get deterministic validation results. Catches typos and invalid sequences but doesn't verify if the card is active or real.
curl "https://tinyfn.io/v1/validate/credit-card" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/validate/credit-card', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/validate/credit-card',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's validation tools:
{
"mcpServers": {
"tinyfn-validation": {
"url": "https://tinyfn.io/mcp/validation",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
The Luhn algorithm uses a checksum calculation where digits are doubled in alternating positions, summed with adjustments for two-digit results, and the total must be divisible by 10 to be valid.
Yes, tools like Cursor and Claude Code can call this validation directly during development, useful for form validation logic or payment processing workflows.
It only checks mathematical validity using Luhn algorithm. A number can pass validation but still be fake, expired, or inactive.
Works with all major card types (Visa, MasterCard, American Express, Discover) since Luhn algorithm is universal across card networks.
Strip formatting before validation. The tool expects clean numeric strings like `4532015112830366` rather than `4532-0151-1283-0366`.
Get your free API key and start using Validate Credit Card in seconds.
Get Free API Key