Skip to main content
Glama
adamanz

Apollo.io MCP Server

by adamanz

employees_of_company

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

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 handler function that implements the employees_of_company tool logic: searches for company by name/URL, retrieves company ID, then searches for employees in that organization using Apollo.io API.
    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 including name, description, and input schema for 'employees_of_company'.
    {
      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']
      }
    }
  • MCP server request handler that delegates execution of 'employees_of_company' tool to ApolloClient instance.
    case 'employees_of_company': {
      const result = await this.apollo.employeesOfCompany(args as any);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
  • TypeScript interface defining the input query parameters for the employeesOfCompany method.
    export interface EmployeesOfCompanyQuery {
      company: string;
      website_url?: string;
      linkedin_url?: string;
      [key: string]: any;
    }
  • Helper function used to normalize URLs for company matching by stripping protocol, www, trailing slash, and lowercasing.
    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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't cover critical aspects like whether it's a read-only operation, potential rate limits, authentication needs, or what the output format might be (e.g., list of employees with details). This leaves significant gaps for an agent to understand how to handle the tool effectively.

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 directly states the tool's function and input options without any unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., employee names, roles, contact info) or any behavioral traits, leaving the agent with insufficient information to use the tool confidently in varied contexts.

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?

The schema description coverage is 100%, so the input schema already documents all parameters clearly. The description adds minimal value by mentioning the input types (company name or URLs), but it doesn't provide additional context like format examples or usage tips beyond what's in the schema, aligning with the baseline score for high schema coverage.

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 with a specific verb ('Find') and resource ('employees of a company'), and it specifies the input types (company name or URLs). However, it 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 the input types but doesn't specify scenarios or exclusions, leaving the agent to infer usage based on context alone.

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

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