Skip to content

Commit cadf3ba

Browse files
committed
fix(tools): address review feedback for presend email verify
1 parent f2067e2 commit cadf3ba

5 files changed

Lines changed: 23 additions & 14 deletions

File tree

‎apps/sim/tools/generated/tool-ids.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/generated/tool-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/presend/email_verify.ts‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ export const emailVerifyTool: ToolConfig<PresendEmailVerifyParams, PresendEmailV
3737
success: true,
3838
output: {
3939
email: data?.email ?? '',
40-
valid: data?.valid ?? false,
40+
valid: data?.valid ?? null,
4141
syntaxValid: data?.syntax_valid ?? false,
4242
domain: data?.domain ?? '',
43-
mxFound: data?.has_mx ?? false,
43+
mxFound: data?.has_mx ?? null,
4444
mxCount: data?.mx_count ?? 0,
4545
disposable: data?.disposable ?? false,
4646
roleAccount: data?.role_account ?? false,
47-
reason: data?.reason ?? '',
47+
reason: data?.reason ?? null,
4848
},
4949
}
5050
},
@@ -56,7 +56,9 @@ export const emailVerifyTool: ToolConfig<PresendEmailVerifyParams, PresendEmailV
5656
},
5757
valid: {
5858
type: 'boolean',
59-
description: 'Whether the email address is valid overall',
59+
description:
60+
'Whether the email address is valid overall. Null if it could not be checked (e.g. MX lookup failed); retry later',
61+
nullable: true,
6062
},
6163
syntaxValid: {
6264
type: 'boolean',
@@ -68,7 +70,9 @@ export const emailVerifyTool: ToolConfig<PresendEmailVerifyParams, PresendEmailV
6870
},
6971
mxFound: {
7072
type: 'boolean',
71-
description: "Whether the domain's MX records were found",
73+
description:
74+
"Whether the domain's MX records were found. Null if the MX lookup itself failed",
75+
nullable: true,
7276
},
7377
mxCount: {
7478
type: 'number',
@@ -84,7 +88,9 @@ export const emailVerifyTool: ToolConfig<PresendEmailVerifyParams, PresendEmailV
8488
},
8589
reason: {
8690
type: 'string',
87-
description: 'Explanation when the address is invalid, otherwise null',
91+
description:
92+
'Why the address is not valid: invalid_syntax, no_mx_record, disposable_domain, or mx_lookup_failed. Null when the address is valid',
93+
nullable: true,
8894
},
8995
},
9096
}

‎apps/sim/tools/presend/types.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
// Common types for Presend tools
21
import type { ToolResponse } from '@/tools/types'
32

4-
// Email Verify tool types
3+
/** Parameters for the Presend email verify tool. */
54
export interface PresendEmailVerifyParams {
65
email: string
76
}
87

8+
/** Response from the Presend email verify tool. */
99
export interface PresendEmailVerifyResponse extends ToolResponse {
1010
output: {
1111
email: string
12-
valid: boolean
12+
/** `null` when the address could not be checked (e.g. MX lookup failed); retry later. */
13+
valid: boolean | null
1314
syntaxValid: boolean
1415
domain: string
15-
mxFound: boolean
16+
/** `null` when the MX lookup itself failed. */
17+
mxFound: boolean | null
1618
mxCount: number
1719
disposable: boolean
1820
roleAccount: boolean
19-
reason: string
21+
/** One of `invalid_syntax`, `no_mx_record`, `disposable_domain`, `mx_lookup_failed`, or `null` when valid. */
22+
reason: string | null
2023
}
2124
}

0 commit comments

Comments
 (0)