Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/tools/generated/tool-ids.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/sim/tools/generated/tool-metadata.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/sim/tools/generated/tool-outputs.ts

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions apps/sim/tools/presend/email_verify.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import type { PresendEmailVerifyParams, PresendEmailVerifyResponse } from '@/tools/presend/types'
import type { ToolConfig } from '@/tools/types'

export const emailVerifyTool: ToolConfig<PresendEmailVerifyParams, PresendEmailVerifyResponse> = {
id: 'presend_email_verify',
name: 'Presend Email Verify',
description:
'Free, no-signup, no-key single-address email verification: syntax, MX record, disposable-domain, and role-account checks in one call.',
version: '1.0.0',

params: {
email: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'The email address to verify',
},
},

request: {
url: (params) => {
const url = new URL('https://presend.pages.dev/api/email-verify')
url.searchParams.append('email', params.email)

return url.toString()
},
method: 'GET',
headers: () => ({
'Content-Type': 'application/json',
}),
},

transformResponse: async (response: Response) => {
const data = await response.json()

return {
success: true,
output: {
email: data?.email ?? '',
valid: data?.valid ?? null,
syntaxValid: data?.syntax_valid ?? false,
domain: data?.domain ?? '',
mxFound: data?.has_mx ?? null,
mxCount: data?.mx_count ?? 0,
disposable: data?.disposable ?? false,
roleAccount: data?.role_account ?? false,
reason: data?.reason ?? null,
},
}
},

outputs: {
email: {
type: 'string',
description: 'The verified email address',
},
valid: {
type: 'boolean',
description:
'Whether the email address is valid overall. Null if it could not be checked (e.g. MX lookup failed); retry later',
nullable: true,
},
syntaxValid: {
type: 'boolean',
description: 'Whether the email address is correctly formatted (RFC syntax)',
},
domain: {
type: 'string',
description: 'The domain part of the email address',
},
mxFound: {
type: 'boolean',
description:
"Whether the domain's MX records were found. Null if the MX lookup itself failed",
nullable: true,
},
mxCount: {
type: 'number',
description: 'Number of MX records found for the domain',
},
disposable: {
type: 'boolean',
description: 'Whether the email uses a disposable/temporary domain',
},
roleAccount: {
type: 'boolean',
description: 'Whether the address is a role account (e.g. info@, support@)',
},
reason: {
type: 'string',
description:
'Why the address is not valid: invalid_syntax, no_mx_record, disposable_domain, or mx_lookup_failed. Null when the address is valid',
nullable: true,
},
},
}
3 changes: 3 additions & 0 deletions apps/sim/tools/presend/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { emailVerifyTool } from '@/tools/presend/email_verify'

export const presendEmailVerifyTool = emailVerifyTool
24 changes: 24 additions & 0 deletions apps/sim/tools/presend/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { ToolResponse } from '@/tools/types'

/** Parameters for the Presend email verify tool. */
export interface PresendEmailVerifyParams {
email: string
}

/** Response from the Presend email verify tool. */
export interface PresendEmailVerifyResponse extends ToolResponse {
output: {
email: string
/** `null` when the address could not be checked (e.g. MX lookup failed); retry later. */
valid: boolean | null
syntaxValid: boolean
domain: string
/** `null` when the MX lookup itself failed. */
mxFound: boolean | null
mxCount: number
disposable: boolean
roleAccount: boolean
/** One of `invalid_syntax`, `no_mx_record`, `disposable_domain`, `mx_lookup_failed`, or `null` when valid. */
reason: string | null
}
}
2 changes: 2 additions & 0 deletions apps/sim/tools/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,7 @@ import {
posthogUpdatePropertyDefinitionTool,
posthogUpdateSurveyTool,
} from '@/tools/posthog'
import { presendEmailVerifyTool } from '@/tools/presend'
import {
profoundBotLogsTool,
profoundBotsReportTool,
Expand Down Expand Up @@ -10847,6 +10848,7 @@ export const tools: Record<string, ExecutableToolConfig> = {
hunter_email_verifier: hunterEmailVerifierTool,
hunter_companies_find: hunterCompaniesFindTool,
hunter_email_count: hunterEmailCountTool,
presend_email_verify: presendEmailVerifyTool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Tool missing from catalog Registering presend_email_verify here does not add it to the generated tool IDs that the catalog uses. Users therefore cannot discover or select the new tool, and the metadata synchronization check will fail. Regenerate and commit the tool metadata alongside this registration.

prospeo_account_information: prospeoAccountInformationTool,
prospeo_enrich_person: prospeoEnrichPersonTool,
prospeo_enrich_company: prospeoEnrichCompanyTool,
Expand Down