Validation Utilities

Validate Date

Validates date strings and returns structured results including validity status, parsed components, and error details. Access via MCP in Cursor/Claude Code or GET /v1/validate/date. Returns true/false validity plus extracted year, month, day when valid. Handles multiple formats including ISO 8601, US format, and European format automatically.

API Endpoint

GET /v1/validate/date

Code Examples

curl "https://tinyfn.io/v1/validate/date" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/validate/date', {
  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/date',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What date formats does the validate date tool recognize?

Supports ISO 8601 (2024-03-15), US format (03/15/2024), European format (15/03/2024), and common variations with different separators like dashes, slashes, and dots.

How can I use date validation in my MCP-enabled AI workflow?

AI agents in Cursor or Windsurf can validate user-provided dates before processing them in databases, APIs, or calculations, preventing downstream errors from malformed date strings.

Does the date validator check for leap years and month boundaries?

Yes, it validates actual calendar dates including leap year February 29th and prevents invalid dates like February 30th or June 31st.

What does the API return for invalid date strings?

Returns validity: false with specific error messages like 'Invalid month value' or 'Day out of range for month', plus null values for parsed components.

Can I validate partial dates or date ranges with this tool?

This tool validates complete date strings only. For partial dates or ranges, you'd need to parse them first or use separate validation logic.

Try Validate Date Now

Get your free API key and start using Validate Date in seconds.

Get Free API Key