Standardizes phone numbers into proper country-specific formats. Use via MCP in Cursor or Windsurf for contact processing, or call GET /v1/format/phone with raw number strings. Returns consistently formatted output like "+1 (555) 123-4567" for US numbers. Handles international prefixes and validates number structure automatically.
curl "https://tinyfn.io/v1/format/phone" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/phone', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/format/phone',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's formatting tools:
{
"mcpServers": {
"tinyfn-format": {
"url": "https://tinyfn.io/mcp/format",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Use the format_phone tool with the raw number as input. It automatically detects country codes and applies proper formatting conventions.
Accepts various formats: raw digits, numbers with spaces, dashes, parentheses, or international prefixes. Strips formatting before processing.
Yes, it checks number length and structure against country-specific rules. Invalid numbers return error messages instead of formatted output.
The tool auto-detects from country codes when present. For numbers without prefixes, it defaults to common regional formats based on digit patterns.
This tool understands international dialing rules, validates number structure, and applies country-specific conventions rather than simple pattern matching.
Get your free API key and start using Format Phone in seconds.
Get Free API Key