Skip to main content
Glama

Email Enrichment

enrich_by_email
Read-onlyIdempotent

Look up detailed person and company information using an email address. Returns verified business data including job title, company details, phone numbers, and social profiles.

Instructions

Look up detailed person and company information using an email address. Returns verified business data including job title, company details, phone numbers, and social profiles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesThe email address to enrich
include_companyNoInclude company data in response
include_socialNoInclude social profile data in response

Implementation Reference

  • The MCP tool handler function for 'enrich_by_email' that calls LeadFuzeClient.enrichByEmail, formats the response, and handles errors.
    async ({ email, include_company, include_social }) => {
      try {
        const client = getClient();
        const response = await client.enrichByEmail({
          email,
          include_company,
          include_social,
        });
    
        const formattedResponse = formatEnrichmentResponse(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 enriching email: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:47-106 (registration)
    Registration of the 'enrich_by_email' MCP tool, including name, input schema, annotations, and handler.
    server.registerTool(
      "enrich_by_email",
      {
        title: "Email Enrichment",
        description:
          "Look up detailed person and company information using an email address. Returns verified business data including job title, company details, phone numbers, and social profiles.",
        inputSchema: {
          email: z.string().email().describe("The email address to enrich"),
          include_company: z
            .boolean()
            .default(true)
            .describe("Include company data in response"),
          include_social: z
            .boolean()
            .default(true)
            .describe("Include social profile data in response"),
        },
        annotations: {
          title: "Email Enrichment",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async ({ email, include_company, include_social }) => {
        try {
          const client = getClient();
          const response = await client.enrichByEmail({
            email,
            include_company,
            include_social,
          });
    
          const formattedResponse = formatEnrichmentResponse(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 enriching email: ${errorMessage}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Zod-based input schema for the enrich_by_email tool parameters.
    inputSchema: {
      email: z.string().email().describe("The email address to enrich"),
      include_company: z
        .boolean()
        .default(true)
        .describe("Include company data in response"),
      include_social: z
        .boolean()
        .default(true)
        .describe("Include social profile data in response"),
    },
  • LeadFuzeClient method implementing the core HTTP API call for email enrichment.
    async enrichByEmail(params: EmailEnrichmentParams): Promise<EnrichmentResponse> {
      return this.request<EnrichmentResponse>("/enrichment/email", {
        email: params.email,
        include_company: params.include_company ?? true,
        include_social: params.include_social ?? true,
        limit: 100,
        page: 1,
        cache_ttl: 600,
      });
    }
  • Utility function to format the raw API enrichment response into human-readable markdown text for the MCP tool output.
    export function formatEnrichmentResponse(response: EnrichmentResponse): string {
      if (!response.success) {
        return "Error: The enrichment request was not successful.";
      }
    
      if (!response.data || (Array.isArray(response.data) && response.data.length === 0)) {
        return `No match found for: ${response.meta.input}\n\nNo credits were consumed for this lookup.\nTry searching with a different email or LinkedIn URL.`;
      }
    
      // Handle both single object and array responses
      const person = Array.isArray(response.data) ? response.data[0] : response.data;
      const lines: string[] = [];
    
      // Build display name from available data
      const displayName = person.full_name || 
        [person.first_name, person.last_name].filter(Boolean).join(" ") ||
        person.business_email ||
        "Unknown";
      
      // Person details
      lines.push(`Found: ${displayName}`);
      
      if (person.business_email) {
        const validationStatus = person.business_email_validation_status 
          ? ` (${person.business_email_validation_status})`
          : "";
        lines.push(`- Email: ${person.business_email}${validationStatus}`);
      }
    
      if (person.job_title && person.company?.name) {
        lines.push(`- Title: ${person.job_title} at ${person.company.name}`);
      } else if (person.job_title) {
        lines.push(`- Title: ${person.job_title}`);
      }
    
      if (person.seniority_level) {
        lines.push(`- Seniority: ${person.seniority_level}`);
      }
    
      if (person.department) {
        lines.push(`- Department: ${person.department}`);
      }
    
      // Location
      const location = person.full_address || 
        [person.personal_city, person.personal_state].filter(Boolean).join(", ");
      if (location) {
        lines.push(`- Location: ${location}`);
      }
    
      // Phone numbers
      if (person.mobile_phone) {
        lines.push(`- Mobile: ${person.mobile_phone}`);
      }
      if (person.direct_number) {
        lines.push(`- Direct: ${person.direct_number}`);
      }
    
      // LinkedIn
      if (person.linkedin_url) {
        lines.push(`- LinkedIn: ${person.linkedin_url}`);
      }
    
      // Company details
      if (person.company) {
        const company = person.company;
        lines.push("");
        lines.push(`Company: ${company.name || "Unknown"}`);
        
        if (company.primary_industry) {
          lines.push(`- Industry: ${company.primary_industry}`);
        }
        if (company.employee_count) {
          lines.push(`- Size: ${company.employee_count} employees`);
        }
        if (company.revenue) {
          lines.push(`- Revenue: ${company.revenue}`);
        }
        if (company.domain) {
          lines.push(`- Website: ${company.domain}`);
        }
        
        const companyLocation = [company.city, company.state, company.country]
          .filter(Boolean)
          .join(", ");
        if (companyLocation) {
          lines.push(`- Location: ${companyLocation}`);
        }
    
        if (company.phone && company.phone.length > 0) {
          lines.push(`- Phone: ${company.phone[0]}`);
        }
    
        if (company.linkedin_url) {
          lines.push(`- LinkedIn: ${company.linkedin_url}`);
        }
      }
    
      // 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?

The description adds valuable context about what data is returned (verified business data, job title, company details, phone numbers, social profiles) that goes beyond the annotations. While annotations cover read-only, open-world, idempotent, and non-destructive properties, the description provides concrete information about the type and scope of data returned, which is helpful for understanding the tool's behavior.

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 perfectly concise with just two sentences that efficiently communicate the tool's purpose and return data. Every word earns its place, and the information is front-loaded with the core functionality stated immediately.

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 comprehensive annotations (read-only, open-world, idempotent, non-destructive) and 100% schema coverage, the description provides good contextual completeness by detailing the return data. However, without an output schema, the description could benefit from more specific information about response structure or format to be fully complete.

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?

With 100% schema description coverage, the input schema already fully documents all three parameters. The description mentions email-based lookup and the types of data returned, but doesn't add specific parameter semantics beyond what the schema provides. This meets the baseline expectation when schema coverage is complete.

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 ('Look up detailed person and company information'), the resource ('using an email address'), and distinguishes from siblings by specifying email-based enrichment rather than LinkedIn-based or validation approaches. It provides a comprehensive overview of what the tool does.

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

Usage Guidelines4/5

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

The description implies when to use this tool (for email-based enrichment) and mentions what data it returns, but doesn't explicitly state when to choose it over 'enrich_by_linkedin' or 'validate_email'. It provides clear context about the tool's function but lacks explicit alternative guidance.

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