AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { clearoutphoneAuth } from '../common/auth';
export const validatePhoneNumber = createAction({
auth: clearoutphoneAuth,
name: 'validatePhoneNumber',
classification: 'READ',
displayName: 'Validate Phone Number',
description:
'Validate a phone number and retrieve comprehensive information using ClearoutPhone API',
audience: 'both',
aiMetadata: { description: 'Validate a single phone number via ClearoutPhone and retrieve comprehensive details including validity, line type, carrier, location, country, timezone, and formatted representations (international, local, E.164). Use this as the broadest lookup when an agent needs full number metadata rather than just carrier or mobile status. Requires the number in international format (e.g. +447766733573); this is a read-only lookup and is idempotent.', idempotent: true },
props: {
phoneNumber: Property.ShortText({
displayName: 'Phone Number',
description: 'The phone number to validate (e.g., +447766733573 )',
required: true,
}),
},
async run({ auth, propsValue }) {
const headers: Record<string, string> = {
Authorization: `Bearer:${auth.secret_text}`,
'Content-Type': 'application/json',
};
const body: any = {
number: propsValue.phoneNumber,
};
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.clearoutphone.io/v1/phonenumber/validate',
headers,
body,
});
const result = response.body as any;
if (result.status === 'success' && result.data) {
return {
isValid: result.data.status === 'valid',
status: result.data.status,
lineType: result.data.line_type,
carrier: result.data.carrier,
location: result.data.location,
countryName: result.data.country_name,
countryTimezone: result.data.country_timezone,
countryUtcOffset: result.data.country_utcoffset,
countryDstObservedHours: result.data.country_dstobservedhrs,
countryCode: result.data.country_code,
internationalFormat: result.data.international_format,
localFormat: result.data.local_format,
e164Format: result.data.e164_format,
canBeInternationallyDialled: result.data.can_be_internationally_dialled,
validatedOn: result.data.validated_on,
timeTaken: result.data.time_taken,
};
}
return result;
},
});