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();
      });
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), implying non-destructive behavior, but lacks details on permissions required, rate limits, error conditions, or what 'user details' specifically includes (e.g., profile fields, contact info). For a tool with no annotation coverage, this leaves significant gaps in understanding its 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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and uses clear, direct language. Every element ('Get', 'LinkedIn user details', 'by email') earns its place by conveying essential information.

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

Completeness3/5

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

Given no annotations and no output schema, the description is minimally adequate for a simple lookup tool but lacks depth. It covers the basic purpose and key parameter (email), but doesn't address behavioral aspects like what 'user details' returns, potential errors, or usage constraints. For a tool with 3 parameters and no structured output, more context would be helpful.

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%, so the schema fully documents all three parameters (email, count, timeout). The description mentions 'by email', which aligns with the required 'email' parameter, but adds no additional semantic context beyond what the schema provides, such as email format requirements or how 'count' affects results. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Get') and target resource ('LinkedIn user details'), with the specific lookup method 'by email' distinguishing it from other LinkedIn tools that might use different identifiers. However, it doesn't explicitly differentiate from similar sibling tools like 'get_linkedin_profile' or 'search_linkedin_users', which could also retrieve user information.

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?

The description provides no guidance on when to use this tool versus alternatives, such as 'get_linkedin_profile' (which might use a different identifier) or 'search_linkedin_users' (which might offer broader search capabilities). There's no mention of prerequisites, limitations, or typical use cases for email-based lookup.

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

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