JSON Utilities

Validate Json

Validates JSON syntax and returns a boolean result plus detailed error information. Use via MCP in Cursor or Windsurf, or call GET /v1/json/validate directly. Pass any string to check if it's valid JSON — handles malformed brackets, trailing commas, and syntax errors that break parsers.

API Endpoint

GET /v1/json/validate

Code Examples

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

response = requests.get('https://tinyfn.io/v1/json/validate',
    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 json tools:

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

Learn more about MCP setup →

FAQ

How do I validate JSON syntax in my AI workflow?

Use the validate_json MCP tool in your AI editor, or call GET /v1/json/validate with your JSON string. Returns true/false plus specific error details if invalid.

What JSON validation errors does this catch?

Catches all standard JSON syntax errors: missing quotes, trailing commas, unclosed brackets, invalid escape sequences, and malformed numbers or booleans.

Does JSON validation work with nested objects and arrays?

Yes, it validates deeply nested JSON structures and reports the exact line/position of syntax errors in complex documents.

Can I validate empty strings or null values as JSON?

Empty strings return false (invalid JSON). The string 'null' returns true (valid JSON literal), while actual null/undefined values depend on your implementation.

What's the difference between this and JSON.parse() error handling?

This tool provides structured validation results without throwing exceptions, making it safer for batch processing and AI agent workflows that need clean boolean responses.

Try Validate Json Now

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

Get Free API Key