Skip to main content
Glama
lkm1developer

Apollo.io MCP Server

employees_of_company

Find employees of a company by entering the company name, website URL, or LinkedIn URL to access contact information and organizational details.

Instructions

Find employees of a company using company name or website/LinkedIn URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyYesCompany name
website_urlNoCompany website URL
linkedin_urlNoCompany LinkedIn URL

Implementation Reference

  • Core implementation of the employees_of_company tool: searches for the company by name (optionally filtering by URL), retrieves company ID, then searches for people/employees in that organization.
    async employeesOfCompany(query: EmployeesOfCompanyQuery): Promise<any> {
      try {
        const { company, website_url, linkedin_url } = query;
        
        if (!company) {
          throw new Error('Company name is required');
        }
    
        const strippedWebsiteUrl = stripUrl(website_url);
        const strippedLinkedinUrl = stripUrl(linkedin_url);
        
        // First search for the company
        const companySearchPayload = {
          q_organization_name: company,
          page: 1,
          limit: 100
        };
        
        const mixedCompaniesResponse = await axios.post(
          'https://api.apollo.io/v1/mixed_companies/search', 
          companySearchPayload, 
          {
            headers: {
              'Content-Type': 'application/json',
              'X-Api-Key': this.apiKey
            }
          }
        );
        
        if (!mixedCompaniesResponse.data) {
          throw new Error('No data received from Apollo API');
        }
        
        let organizations = mixedCompaniesResponse.data.organizations;
        if (organizations.length === 0) {
          throw new Error('No organizations found');
        }
        
        // Filter companies by website or LinkedIn URL if provided
        const companyObjs = organizations.filter((item: any) => {
          const companyLinkedin = stripUrl(item.linkedin_url);
          const companyWebsite = stripUrl(item.website_url);
          
          if (strippedLinkedinUrl && companyLinkedin && companyLinkedin === strippedLinkedinUrl) {
            return true;
          } else if (strippedWebsiteUrl && companyWebsite && companyWebsite === strippedWebsiteUrl) {
            return true;
          }
          return false;
        });
        
        // If we have filtered results, use the first one, otherwise use the first from the original search
        const companyObj = companyObjs.length > 0 ? companyObjs[0] : organizations[0];
        const companyId = companyObj.id;
        
        if (!companyId) {
          throw new Error('Could not determine company ID');
        }
        
        // Now search for employees
        const peopleSearchPayload: any = {
          organization_ids: [companyId],
          page: 1,
          limit: 100
        };
        
        // Add optional filters if provided in the tool config
        if (query.person_seniorities) {
          peopleSearchPayload.person_titles = (query.person_seniorities ?? '').split(',').map((item: string) => item.trim());
        }
        
        if (query.contact_email_status) {
          peopleSearchPayload.contact_email_status_v2 = (query.contact_email_status ?? '').split(',').map((item: string) => item.trim());
        }
        
        const peopleResponse = await axios.post(
          'https://api.apollo.io/v1/mixed_people/search', 
          peopleSearchPayload, 
          {
            headers: {
              'Content-Type': 'application/json',
              'X-Api-Key': this.apiKey
            }
          }
        );
        
        if (!peopleResponse.data) {
          throw new Error('No data received from Apollo API');
        }
        
        return peopleResponse.data.people || [];
      } catch (error: any) {
        console.error(`Error finding employees: ${error.message}`);
        return null;
      }
    }
  • src/index.ts:200-221 (registration)
    MCP tool registration in the list of available tools, including name, description, and input schema.
    {
      name: 'employees_of_company',
      description: 'Find employees of a company using company name or website/LinkedIn URL',
      inputSchema: {
        type: 'object',
        properties: {
          company: {
            type: 'string',
            description: 'Company name'
          },
          website_url: {
            type: 'string',
            description: 'Company website URL'
          },
          linkedin_url: {
            type: 'string',
            description: 'Company LinkedIn URL'
          }
        },
        required: ['company']
      }
    }
  • TypeScript interface defining the input parameters for the employeesOfCompany method.
    export interface EmployeesOfCompanyQuery {
      company: string;
      website_url?: string;
      linkedin_url?: string;
      [key: string]: any;
    }
  • MCP server request handler for call_tool requests, which delegates execution to ApolloClient.employeesOfCompany.
    case 'employees_of_company': {
      const result = await this.apollo.employeesOfCompany(args as any);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Utility function to normalize (strip protocol, www, trailing slash, lowercase) URLs for matching company website and LinkedIn URLs.
    const stripUrl = (url?: string): string | undefined => {
      if (!url) return undefined;
      
      try {
        // Remove protocol (http://, https://)
        let stripped = url.replace(/^https?:\/\//, '');
        
        // Remove www.
        stripped = stripped.replace(/^www\./, '');
        
        // Remove trailing slash
        stripped = stripped.replace(/\/$/, '');
        
        // Convert to lowercase
        stripped = stripped.toLowerCase();
        
        return stripped;
      } catch (error) {
        console.error('Error stripping URL:', error);
        return url;
      }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('Find employees') but lacks behavioral details such as what data is returned (e.g., employee names, roles, contact info), whether it's a read-only operation, potential rate limits, authentication needs, or error handling. This leaves significant gaps for an agent to understand 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 a single, efficient sentence that front-loads the core purpose ('Find employees of a company') and specifies input methods. There is no wasted text, making it highly concise and well-structured for quick understanding.

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 complexity of a search tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of employees, details), behavioral traits, or usage context relative to siblings. This leaves the agent under-informed for effective tool selection and invocation.

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 already documents all parameters (company, website_url, linkedin_url) with descriptions. The description adds minimal value by mentioning input options but doesn't provide additional semantics like format examples, constraints, or how parameters interact (e.g., if multiple are provided). Baseline 3 is appropriate as 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 tool's purpose: 'Find employees of a company' with specific input options (company name or website/LinkedIn URL). It uses a clear verb ('Find') and resource ('employees of a company'), but doesn't explicitly differentiate from sibling tools like 'people_search' or 'organization_search', which might have overlapping functionality.

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 like 'people_search' or 'organization_search'. It mentions input options but doesn't specify scenarios, prerequisites, or exclusions for usage, leaving the agent to guess about context.

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/lkm1developer/apollo-io-mcp-server'

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