Skip to main content
Glama

get_linkedin_company_employees

Retrieve employee data from LinkedIn companies using search filters like keywords, first name, last name, and company identifiers to find specific professionals.

Instructions

Get employees of a LinkedIn company

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companiesYesCompany URNs (example: ['company:14064608'])
countYesMaximum number of results
first_nameNoSearch for exact first name
keywordsNoAny keyword for searching employees
last_nameNoSearch for exact last name
timeoutNoTimeout in seconds

Implementation Reference

  • The async handler function that prepares the request data and calls the AnySite API to fetch LinkedIn company employees, returning JSON response or error.
    async ({ companies, keywords, first_name, last_name, count, timeout }) => {
      const requestData: any = { timeout, companies, count };
      if (keywords) requestData.keywords = keywords;
      if (first_name) requestData.first_name = first_name;
      if (last_name) requestData.last_name = last_name;
      log(`Starting LinkedIn company employees lookup for companies: ${companies.join(', ')}`);
      try {
        const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_COMPANY_EMPLOYEES, requestData);
        return {
          content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
        };
      } catch (error) {
        log("LinkedIn company employees lookup error:", error);
        return {
          content: [{ type: "text", text: `LinkedIn company employees API error: ${formatError(error)}` }],
          isError: true
        };
      }
    }
  • Zod input schema defining parameters for the get_linkedin_company_employees tool.
      companies: z.array(z.string()).describe("Company URNs or aliases"),
      keywords: z.string().optional().describe("Search keywords"),
      first_name: z.string().optional().describe("First name filter"),
      last_name: z.string().optional().describe("Last name filter"),
      count: z.number().default(10).describe("Max employees"),
      timeout: z.number().default(300).describe("Timeout in seconds")
    },
  • src/index.ts:603-633 (registration)
    Registration of the tool using McpServer.tool() method, specifying name, description, input schema, and handler.
    server.tool(
      "get_linkedin_company_employees",
      "Get LinkedIn company employees",
      {
        companies: z.array(z.string()).describe("Company URNs or aliases"),
        keywords: z.string().optional().describe("Search keywords"),
        first_name: z.string().optional().describe("First name filter"),
        last_name: z.string().optional().describe("Last name filter"),
        count: z.number().default(10).describe("Max employees"),
        timeout: z.number().default(300).describe("Timeout in seconds")
      },
      async ({ companies, keywords, first_name, last_name, count, timeout }) => {
        const requestData: any = { timeout, companies, count };
        if (keywords) requestData.keywords = keywords;
        if (first_name) requestData.first_name = first_name;
        if (last_name) requestData.last_name = last_name;
        log(`Starting LinkedIn company employees lookup for companies: ${companies.join(', ')}`);
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_COMPANY_EMPLOYEES, requestData);
          return {
            content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
          };
        } catch (error) {
          log("LinkedIn company employees lookup error:", error);
          return {
            content: [{ type: "text", text: `LinkedIn company employees API error: ${formatError(error)}` }],
            isError: true
          };
        }
      }
    );
  • TypeScript interface defining the input arguments for the tool.
    export interface GetLinkedinCompanyEmployeesArgs {
      companies: string[];
      keywords?: string;
      first_name?: string;
      last_name?: string;
      count?: number;
      timeout?: number;
    }
  • Helper function makeRequest used by the handler to perform HTTPS POST requests to the AnySite API endpoints.
    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();
      });
    };
  • API endpoint path constant used in the handler for company employees request.
    LINKEDIN_COMPANY_EMPLOYEES: "/api/linkedin/company/employees",
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. 'Get employees' implies a read operation, but it doesn't disclose rate limits, authentication requirements, data freshness, pagination behavior, or what happens when companies parameter contains invalid URNs. For a tool with 6 parameters and no output schema, this leaves significant behavioral questions unanswered.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a tool with clear naming and good schema documentation, though its brevity contributes to gaps in other dimensions.

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?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain what the tool returns (employee profiles? basic info?), how results are structured, whether all parameters work together, or any limitations. For a data retrieval tool with multiple filtering options and no output schema, users need more context about what to expect.

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 all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond implying the tool operates on LinkedIn company data. It doesn't explain relationships between parameters (e.g., how keywords interacts with first_name/last_name) or provide context about the companies parameter beyond what's in the schema. Baseline 3 is appropriate when 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 verb ('Get') and resource ('employees of a LinkedIn company'), making the purpose immediately understandable. It distinguishes this tool from siblings like get_linkedin_company (which gets company info) or get_linkedin_user_connections (which gets personal connections). However, it doesn't specify whether this retrieves current employees, all employees, or includes filtering capabilities beyond what the parameters imply.

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. With siblings like search_linkedin_users (which might search across LinkedIn) and get_linkedin_user_connections (which gets connections for a specific user), there's no indication whether this tool is for company-specific employee lookup, how it differs from broader searches, or any prerequisites for accessing company employee data.

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