Geolocation Utilities

Is Valid Coordinates

Validates latitude/longitude coordinates against standard geographic bounds (-90 to 90 for latitude, -180 to 180 for longitude). Available via MCP in Cursor and other AI editors, or GET /v1/geo/is-valid-coordinates. Returns boolean validation with detailed error messages for invalid ranges. Essential for geospatial applications before processing location data.

API Endpoint

GET /v1/geo/is-valid-coordinates

Code Examples

curl "https://tinyfn.io/v1/geo/is-valid-coordinates" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/is-valid-coordinates', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/geo/is-valid-coordinates',
    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 geolocation tools:

{
  "mcpServers": {
    "tinyfn-geo": {
      "url": "https://tinyfn.io/mcp/geo",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What coordinate ranges does the validator accept?

Latitude must be between -90 and 90 degrees, longitude between -180 and 180 degrees. These are standard WGS84 geographic coordinate system bounds.

How can AI agents use this for location validation in MCP?

AI agents can validate user-provided coordinates before geocoding or mapping operations, preventing API errors and ensuring data quality in location-based workflows.

Does it handle edge cases like exactly 180° longitude?

Yes, boundary values like 90°, -90°, 180°, and -180° are considered valid. The validator uses inclusive ranges for both latitude and longitude limits.

What response format does the validation return?

Returns a boolean indicating validity plus descriptive error messages for invalid coordinates, helping identify whether latitude or longitude is out of range.

Can I validate coordinate pairs or individual values?

The tool validates complete coordinate pairs (lat/lng together) to ensure both values fall within their respective valid geographic ranges.

Try Is Valid Coordinates Now

Get your free API key and start using Is Valid Coordinates in seconds.

Get Free API Key