Skip to main content
Glama

abstractapi-mcp-server

validate_phone

Validate phone numbers globally with Abstract API's tool, checking validity, format, country, location, type, and carrier details for numbers from over 190 countries.

Instructions

Validates a phone number using Abstract API's Phone Validation service.
This function checks the validity and other details of phone numbers from over 190 countries. It returns detailed information about the phone number including format, country, location, type, and carrier information.
Args: phone (str): The phone number to validate and verify. country (str, optional): The country's ISO code to indicate the phone number's country. This helps the API append the corresponding country code to its analysis. For example, use "US" for United States numbers.
Returns: dict[str, Any]: A dictionary containing detailed validation results. The dictionary includes the following keys:
- "phone" (str): The phone number submitted for validation. - "valid" (bool): True if the phone number is valid, False otherwise. - "format" (dict): Object containing international and local formats. - "international" (str): International format with country code and "+" prefix. - "local" (str): Local/national format without international formatting. - "country" (dict): Object containing country details. - "code" (str): Two-letter ISO 3166-1 alpha-2 country code. - "name" (str): Name of the country where the phone number is registered. - "prefix" (str): Country's calling code prefix. - "location" (str): Location details (region, state/province, sometimes city). - "type" (str): Type of phone number. Possible values: "Landline", "Mobile", "Satellite", "Premium", "Paging", "Special", "Toll_Free", "Unknown". - "carrier" (str): The carrier that the number is registered with.
Example: >>> await validate_phone("14152007986") { "phone": "14152007986", "valid": true, "format": { "international": "+14152007986", "local": "(415) 200-7986" }, "country": { "code": "US", "name": "United States", "prefix": "+1" }, "location": "California", "type": "mobile", "carrier": "T-Mobile USA, Inc." }
>>> await validate_phone("2007986", "US") # Will validate with US country context
Raises: ValueError: If the API key is not found in the environment variables. requests.exceptions.HTTPError: If the API request fails (e.g., 4xx or 5xx error). Exception: For any other unexpected errors.

Input Schema

NameRequiredDescriptionDefault
countryNo
phoneYes

Input Schema (JSON Schema)

{ "properties": { "country": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Country" }, "phone": { "title": "Phone", "type": "string" } }, "required": [ "phone" ], "title": "validate_phoneArguments", "type": "object" }

Other Tools from abstractapi-mcp-server

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/avivshafir/abstractapi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server