Skip to main content
Glama

Email Validation

validate_email
Read-onlyIdempotent

Check email deliverability, format validity, and risk level to verify contact information quality for sales outreach.

Instructions

Validate an email address to check if it's deliverable, has valid format, and assess its risk level. Returns detailed validation results including deliverability, catch-all status, and mail server information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesThe email address to validate

Implementation Reference

  • Core handler function in LeadFuzeClient that makes the API request to validate the email address.
    async validateEmail(params: EmailValidationParams): Promise<ValidationResponse> {
      return this.request<ValidationResponse>("/verification/email", {
        email: params.email,
        cache_ttl: params.cache_ttl ?? 600,
      });
    }
  • src/index.ts:175-222 (registration)
    MCP tool registration for 'validate_email', including input schema and wrapper handler that calls the client.
    server.registerTool(
      "validate_email",
      {
        title: "Email Validation",
        description:
          "Validate an email address to check if it's deliverable, has valid format, and assess its risk level. Returns detailed validation results including deliverability, catch-all status, and mail server information.",
        inputSchema: {
          email: z.string().email().describe("The email address to validate"),
        },
        annotations: {
          title: "Email Validation",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async ({ email }) => {
        try {
          const client = getClient();
          const response = await client.validateEmail({ email });
    
          const formattedResponse = formatValidationResponse(response);
    
          return {
            content: [
              {
                type: "text" as const,
                text: formattedResponse,
              },
            ],
          };
        } catch (error) {
          const errorMessage =
            error instanceof Error ? error.message : "An unknown error occurred";
    
          return {
            content: [
              {
                type: "text" as const,
                text: `Error validating email: ${errorMessage}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Zod input schema for the validate_email tool.
    inputSchema: {
      email: z.string().email().describe("The email address to validate"),
    },
  • TypeScript interface for email validation parameters.
    export interface EmailValidationParams {
      email: string;
      cache_ttl?: number;
    }
  • Helper function to format the validation response into human-readable text for the MCP tool output.
    export function formatValidationResponse(response: ValidationResponse): string {
      if (!response.success) {
        return "Error: The validation request was not successful.";
      }
    
      const data = response.data;
      const result = data.result;
      const lines: string[] = [];
    
      // Status summary with emoji
      const statusEmoji = data.status === "valid" ? "✅" : data.status === "invalid" ? "❌" : "⚠️";
      lines.push(`${statusEmoji} Email: ${data.email}`);
      lines.push(`Status: ${data.status.toUpperCase()}`);
      lines.push(`Risk Level: ${data.risk_level}`);
    
      lines.push("");
      lines.push("Validation Details:");
      lines.push(`- Valid Format: ${result.valid_format ? "Yes" : "No"}`);
      lines.push(`- Deliverable: ${result.deliverable ? "Yes" : "No"}`);
      lines.push(`- Host Exists: ${result.host_exists ? "Yes" : "No"}`);
      lines.push(`- Catch-All: ${result.catch_all ? "Yes" : "No"}`);
      lines.push(`- Full Inbox: ${result.full_inbox ? "Yes" : "No"}`);
    
      lines.push("");
      lines.push("Email Info:");
      lines.push(`- Username: ${data.username}`);
      lines.push(`- Domain: ${data.domain}`);
    
      lines.push("");
      lines.push(`Credits Used: ${response.credits.used} | Remaining: ${response.credits.remaining}`);
    
      // Add raw data for completeness
      lines.push("");
      lines.push("--- Raw Data ---");
      lines.push(JSON.stringify(response.data, null, 2));
    
      return lines.join("\n");
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only, open-world, idempotent, and non-destructive behavior. The description adds valuable context by specifying what is validated (deliverability, format, risk level) and what details are returned (catch-all status, mail server info), enhancing transparency beyond the annotations without contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and efficiently lists key validation aspects and return details in two sentences. Every sentence adds value without redundancy, making it appropriately sized and structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, rich annotations, and no output schema, the description provides sufficient context on what the tool does and returns. However, it could improve by detailing output structure or error handling to fully compensate for the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'email' well-documented in the schema. The description does not add significant meaning beyond the schema, such as format examples or validation specifics, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('validate an email address') and the resources involved ('deliverable, valid format, risk level'). It distinguishes from sibling tools like 'enrich_by_email' by focusing on validation rather than enrichment, making the purpose explicit and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for email validation purposes but does not explicitly state when to use this tool versus alternatives like 'enrich_by_email' or 'enrich_by_linkedin'. No guidance on prerequisites or exclusions is provided, leaving usage context somewhat vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/leadfuze/mcp-server'

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