Skip to main content
Glama
MailboxValidator

MailboxValidator Email Validation MCP Server

Official

check_free_email

Verify whether an email address is from a free email provider. Filter free emails to improve validation and reduce risk.

Instructions

Checks if an email address is a free email using MailboxValidator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailAddressYesEmail address to check.

Implementation Reference

  • The handler function for 'check_free_email' tool. It takes an emailAddress, calls the MailboxValidator /email/free API, formats the response, and returns text content. Handles errors by catching them.
    async ({ emailAddress }) => {
      try {
        const params = new URLSearchParams({
          email: emailAddress,
          key: apiKey,
          format: "json",
        });
    
        const freeUrl = `${MBV_API_BASE}/email/free?${params.toString()}`;
        const freeData = await makeMBVRequest<FreeResponse>(freeUrl);
    
        if (freeData.error) {
          return {
            content: [
              {
                type: "text",
                text: `MailboxValidator API error ${freeData.error.error_code ?? ""}: ${freeData.error.error_message ?? "Unknown error"}`,
              },
            ],
          };
        }
    
        const formattedFree = formatFree(freeData);
        const freeText = `Free email result for ${emailAddress}:\n\n${formattedFree}`;
    
        return {
          content: [
            {
              type: "text",
              text: freeText,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Failed to retrieve free email data: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
        };
      }
    }
  • Input schema for 'check_free_email'. Defines a single required parameter 'emailAddress' validated as a Zod email string.
    {
      description: "Checks if an email address is a free email using MailboxValidator.",
      inputSchema: {
        emailAddress: z.string().email().describe("Email address to check."),
      },
  • src/index.ts:252-306 (registration)
    Registration of the 'check_free_email' tool via server.registerTool(). Includes description, inputSchema, and the async handler.
    server.registerTool(
      "check_free_email",
      {
        description: "Checks if an email address is a free email using MailboxValidator.",
        inputSchema: {
          emailAddress: z.string().email().describe("Email address to check."),
        },
      },
      async ({ emailAddress }) => {
        try {
          const params = new URLSearchParams({
            email: emailAddress,
            key: apiKey,
            format: "json",
          });
    
          const freeUrl = `${MBV_API_BASE}/email/free?${params.toString()}`;
          const freeData = await makeMBVRequest<FreeResponse>(freeUrl);
    
          if (freeData.error) {
            return {
              content: [
                {
                  type: "text",
                  text: `MailboxValidator API error ${freeData.error.error_code ?? ""}: ${freeData.error.error_message ?? "Unknown error"}`,
                },
              ],
            };
          }
    
          const formattedFree = formatFree(freeData);
          const freeText = `Free email result for ${emailAddress}:\n\n${formattedFree}`;
    
          return {
            content: [
              {
                type: "text",
                text: freeText,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to retrieve free email data: ${
                  error instanceof Error ? error.message : String(error)
                }`,
              },
            ],
          };
        }
      }
    );
  • formatFree helper function that formats the FreeResponse data (email_address, is_free, credits_available) into a display string.
    function formatFree(data: FreeResponse): string {
      return [
        `Email Address: ${formatValue(data.email_address)}`,
        `Is Free: ${formatValue(data.is_free)}`,
        `Credits Available: ${formatValue(data.credits_available)}`,
      ].join("\n");
    }
  • FreeResponse interface defining the shape of the API response for the free email check.
    interface FreeResponse {
      email_address?: string;
      is_free?: boolean | null;
      credits_available?: number;
      error?: {
        error_code?: number;
        error_message?: string;
      };
    }
Behavior2/5

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

No annotations provided; description only says 'checks' without disclosing if it's a read-only API call, potential side effects, or response details.

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

Conciseness4/5

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

Single sentence, front-loaded with the action, no fluff. However, it could be slightly more informative without losing conciseness.

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

Completeness2/5

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

No output schema, but description fails to explain the return value or what 'free email' means, leaving an agent without full context.

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 covers 100% of the single parameter with a description, so baseline is 3; description adds no extra meaning beyond what schema already provides.

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 tool checks if an email address is a free email using MailboxValidator, which distinguishes it from siblings like check_disposable_email and validate_email.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus siblings (check_disposable_email, validate_email) or context about prerequisites.

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/MailboxValidator/mcp-mailboxvalidator'

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