Skip to main content
Glama

get_linkedin_email_user

Retrieve LinkedIn user details and profile information by entering an email address to identify professional contacts and connections.

Instructions

Get LinkedIn user details by email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoMax results
emailYesEmail address
timeoutNoTimeout in seconds

Implementation Reference

  • Primary handler implementation for the 'get_linkedin_email_user' tool. Registers the tool with MCP server, defines Zod input schema, performs API request to LinkedIn email endpoint via makeRequest, handles response and errors.
    server.tool( "get_linkedin_email_user", "Get LinkedIn user details by email", { email: z.string().describe("Email address"), count: z.number().default(5).describe("Max results"), timeout: z.number().default(300).describe("Timeout in seconds") }, async ({ email, count, timeout }) => { const requestData = { timeout, email, count }; log("Starting LinkedIn email lookup for:", email); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_EMAIL, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn email lookup error:", error); return { content: [{ type: "text", text: `LinkedIn email API error: ${formatError(error)}` }], isError: true }; } } );
  • TypeScript interface defining the input parameters for the Linkedin email user tool (though Zod schema is used inline in implementation).
    export interface LinkedinEmailUserArgs { email: string; count?: number; timeout?: number; }
  • Runtime type validation function for LinkedinEmailUserArgs input.
    export function isValidLinkedinEmailUserArgs( args: unknown ): args is LinkedinEmailUserArgs { if (typeof args !== "object" || args === null) return false; const obj = args as Record<string, unknown>; if (typeof obj.email !== "string" || !obj.email.trim()) return false; if (obj.count !== undefined && typeof obj.count !== "number") return false; if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false; return true; }
  • API endpoint configuration constant used by the tool handler for the backend request path.
    LINKEDIN_EMAIL: "/api/linkedin/email/user",
  • Shared HTTP request utility function used by the tool to call the AnySite API backend.
    const makeRequest = (endpoint: string, data: any, method: string = "POST"): Promise<any> => { return new Promise((resolve, reject) => { const url = new URL(endpoint, API_CONFIG.BASE_URL); const postData = JSON.stringify(data); const options = { hostname: url.hostname, port: url.port || 443, path: url.pathname, method: method, headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(postData), "access-token": API_KEY, ...(ACCOUNT_ID && { "x-account-id": ACCOUNT_ID }) } }; const req = https.request(options, (res) => { let responseData = ""; res.on("data", (chunk) => { responseData += chunk; }); res.on("end", () => { try { const parsed = JSON.parse(responseData); if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) { resolve(parsed); } else { reject(new Error(`API error ${res.statusCode}: ${JSON.stringify(parsed)}`)); } } catch (e) { reject(new Error(`Failed to parse response: ${responseData}`)); } }); }); req.on("error", (error) => { reject(error); }); req.write(postData); req.end(); }); };

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

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