LinkedIn Enrichment
enrich_by_linkedinExtract verified business contact details from LinkedIn profiles to enrich lead data with emails, job titles, company information, and phone numbers.
Instructions
Look up detailed person and company information using a LinkedIn profile URL. Returns verified business data including email, job title, company details, and phone numbers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | The LinkedIn profile URL (e.g., linkedin.com/in/johndoe or https://www.linkedin.com/in/johndoe) | ||
| include_company | No | Include company data in response | |
| include_social | No | Include social profile data in response |
Implementation Reference
- src/index.ts:109-172 (registration)MCP server registration of the 'enrich_by_linkedin' tool, including input schema, annotations, and execution handler that delegates to LeadFuzeClient
server.registerTool( "enrich_by_linkedin", { title: "LinkedIn Enrichment", description: "Look up detailed person and company information using a LinkedIn profile URL. Returns verified business data including email, job title, company details, and phone numbers.", inputSchema: { linkedin: z .string() .describe( "The LinkedIn profile URL (e.g., linkedin.com/in/johndoe or https://www.linkedin.com/in/johndoe)" ), 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: "LinkedIn Enrichment", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async ({ linkedin, include_company, include_social }) => { try { const client = getClient(); const response = await client.enrichByLinkedIn({ linkedin, 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 LinkedIn profile: ${errorMessage}`, }, ], isError: true, }; } } ); - src/api/leadfuze-client.ts:74-86 (handler)Core handler function in LeadFuzeClient that normalizes the LinkedIn URL and makes the POST request to LeadFuze /enrichment/linkedin API endpoint
async enrichByLinkedIn(params: LinkedInEnrichmentParams): Promise<EnrichmentResponse> { // Normalize LinkedIn URL - strip protocol and www const normalizedLinkedIn = normalizeLinkedInUrl(params.linkedin); return this.request<EnrichmentResponse>("/enrichment/linkedin", { linkedin_url: normalizedLinkedIn, include_company: params.include_company ?? true, include_social: params.include_social ?? true, limit: 100, page: 1, cache_ttl: 600, }); } - src/index.ts:115-129 (schema)Zod input schema validation for the enrich_by_linkedin tool parameters
inputSchema: { linkedin: z .string() .describe( "The LinkedIn profile URL (e.g., linkedin.com/in/johndoe or https://www.linkedin.com/in/johndoe)" ), 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"), }, - src/types/enrichment.ts:108-112 (schema)TypeScript interface defining parameters for LinkedIn enrichment
export interface LinkedInEnrichmentParams { linkedin: string; include_company?: boolean; include_social?: boolean; } - src/api/leadfuze-client.ts:104-117 (helper)Helper function to normalize LinkedIn URLs by stripping protocol, www prefix, and trailing slash for API compatibility
function normalizeLinkedInUrl(url: string): string { let normalized = url.trim(); // Remove protocol normalized = normalized.replace(/^https?:\/\//, ""); // Remove www. normalized = normalized.replace(/^www\./, ""); // Remove trailing slash normalized = normalized.replace(/\/$/, ""); return normalized; }