Validation Utilities

Validate Semver

Validates semantic version strings against the official SemVer 2.0.0 specification. Use via MCP in Cursor or Windsurf for instant validation, or call GET /v1/validate/semver directly. Returns true/false with detailed error messages for malformed versions. Catches common mistakes like missing patch numbers or invalid prerelease identifiers that break package managers.

API Endpoint

GET /v1/validate/semver

Code Examples

curl "https://tinyfn.io/v1/validate/semver" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/validate/semver', {
  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/semver',
    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 makes a valid semantic version string?

Must follow MAJOR.MINOR.PATCH format (e.g., 1.4.2) with optional prerelease (-alpha.1) and build metadata (+20240101). All parts must be numeric without leading zeros except 0 itself.

How do I validate package versions in my MCP-enabled editor?

Call the validate_semver tool with your version string. It returns boolean validity plus specific error details, perfect for CI scripts or package.json validation workflows.

Does this support prerelease and build metadata validation?

Yes, validates full SemVer spec including prerelease identifiers (-rc.1, -beta) and build metadata (+exp.sha.5114f85). Catches invalid characters and malformed syntax.

What's the difference between 1.0 and 1.0.0 for validation?

1.0 fails validation - SemVer requires all three version components. Only 1.0.0 is valid. This catches incomplete versions that break dependency resolution.

Can I validate version ranges or just single versions?

Only single version strings. For range validation (^1.2.3, ~2.1.0), you'll need a different tool. This validates exact semantic version format compliance.

Try Validate Semver Now

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

Get Free API Key