GnistAI GnistAI
Log in

Phone Number Validation

Phone number validation and parsing — country detection, number type, formatting.

Overview   |   MCP   |   REST API   |   OpenAPI   |   CLI   |   Tutorial   |   Toolkits   |   Home
status: healthy status status healthy healthy tools: 5 tools tools 5 5 type: validation enrichment type type validation enrichment validation enrichment lifecycle: maintained lifecycle lifecycle maintained maintained Utilities

Data source: Curated dataset (ITU numbering plans)

MCP Endpoint (Streamable HTTP) https://context.gnist.ai/mcp/phone-validation/
Authentication

All requests require a Gnist-API-Key header (or api_key query parameter).

Free tier: 100 calls/day. Get your API key.

Tools (5)

validate_phone_number

Validate and parse a phone number.

Returns country, number type (mobile/landline/toll_free/premium), and formatted versions (E.164, international, national).

ParameterTypeRequiredDescription
numberstringrequiredPhone number to validate (E.164, international, or national format, e.g. +14155551234, 00441234567890).
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "validate_phone_number",
    "arguments": {
      "number": "123456789"
    }
  }
}
format_phone_number

Format a phone number in the specified style.

Returns the number formatted as E.164 (+1234567890), international (+1 234 567 890), or national (0234 567 890).

ParameterTypeRequiredDescription
numberstringrequiredPhone number to format.
fmtstringoptionalOutput format: e164, international, or national. (default: "e164")
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "format_phone_number",
    "arguments": {
      "number": "123456789"
    }
  }
}
list_calling_codes

List all known country calling codes with metadata.

Returns calling code, country name, trunk prefix, number length ranges, and example numbers for ~50 countries.

JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "list_calling_codes",
    "arguments": {}
  }
}
get_calling_code

Get calling code details for a specific country.

Returns calling code, trunk prefix, number length, example numbers, and known prefix patterns for mobile/landline.

ParameterTypeRequiredDescription
country_codestringrequiredISO 3166-1 alpha-2 country code (e.g. US, GB, NO, DE).
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "get_calling_code",
    "arguments": {
      "country_code": "NO"
    }
  }
}
report_feedback

Report a bug, feature request, or general feedback for this data source.

Use this when something doesn't work as expected, when you'd like
a new feature, or when you have suggestions for improvement.

Args:
feedback: Describe the issue or suggestion.
feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: "general")
JSON-RPC Request
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "report_feedback",
    "arguments": {
      "feedback": "example"
    }
  }
}

Quick Start

Shell
curl -X POST "https://context.gnist.ai/mcp/phone-validation/" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "validate_phone_number", "arguments": {"number": "example"}}}'
Python
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/phone-validation/",
    headers={"Gnist-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "validate_phone_number",
    "arguments": {
      "number": "example"
    }
  }
},
)
print(resp.json())

Related Toolkits (Utilities)

Resources