hunter_verify_email
Check email validity and deliverability using domain and name data to ensure accurate communication and reduced bounce rates.
Instructions
Verify if an email address is valid and deliverable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | The email address to verify |
Input Schema (JSON Schema)
{
"properties": {
"email": {
"description": "The email address to verify",
"type": "string"
}
},
"required": [
"email"
],
"type": "object"
}
Implementation Reference
- src/index.ts:485-519 (handler)Handler function for 'hunter_verify_email' tool: validates input using isVerifyEmailParams, calls Hunter.io /email-verifier API endpoint with retry logic via withRetry, returns formatted JSON response or error message.case 'hunter_verify_email': { if (!isVerifyEmailParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for hunter_verify_email' ); } try { // Hunter.io API expects query parameters for email verification const response = await withRetry( async () => apiClient.get('/email-verifier', { params: args }), 'verify email' ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], isError: false, }; } catch (error) { const errorMessage = axios.isAxiosError(error) ? `API Error: ${error.response?.data?.message || error.message}` : `Error: ${error instanceof Error ? error.message : String(error)}`; return { content: [{ type: 'text', text: errorMessage }], isError: true, }; } }
- src/index.ts:50-63 (schema)Tool definition including name, description, and input schema (requires 'email' string). This is used for both documentation and validation.const VERIFY_EMAIL_TOOL: Tool = { name: 'hunter_verify_email', description: 'Verify if an email address is valid and deliverable.', inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'The email address to verify', } }, required: ['email'], }, };
- src/index.ts:423-431 (registration)Registers the 'hunter_verify_email' tool (as VERIFY_EMAIL_TOOL) in the list of available tools returned by the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ FIND_EMAIL_TOOL, VERIFY_EMAIL_TOOL, DOMAIN_SEARCH_TOOL, EMAIL_COUNT_TOOL, ACCOUNT_INFO_TOOL, ], }));
- src/index.ts:202-209 (helper)Type guard helper function used in the handler to validate that input arguments match the expected VerifyEmailParams shape (object with 'email' string).function isVerifyEmailParams(args: unknown): args is VerifyEmailParams { return ( typeof args === 'object' && args !== null && 'email' in args && typeof (args as { email: unknown }).email === 'string' ); }
- src/index.ts:134-136 (schema)TypeScript interface defining the input parameters for the 'hunter_verify_email' tool.interface VerifyEmailParams { email: string; }