Skip to main content
Glama
masridigital

Apollo.io MCP Server

by masridigital

analyze_list

Analyze Apollo.io contact lists to identify job title distributions, seniority levels, companies, locations, industries, and data completeness metrics for sales intelligence.

Instructions

Analyze a contact list with detailed breakdown: total contacts, job titles distribution, seniority levels, companies, locations, industries, and data completeness metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesList ID to analyze

Implementation Reference

  • The main handler function that implements the analyze_list tool. It fetches the contact list and its contacts via Apollo API, analyzes distributions of job titles, seniorities, companies, locations, and calculates data completeness percentages for emails, phones, and LinkedIn profiles. Returns a formatted markdown-style text report.
    private async analyzeList(args: any) {
      // Fetch list details
      const listResponse = await this.axiosInstance.get(`/contact_lists/${args.id}`);
      const list = listResponse.data.contact_list;
    
      // Fetch contacts
      const contactsResponse = await this.axiosInstance.get(
        `/contact_lists/${args.id}/contacts`,
        {
          params: { per_page: 1000 },
        }
      );
      const contacts = contactsResponse.data.contacts || [];
    
      let result = `List Analysis: ${list.name}\n\n`;
      result += `=== Overview ===\n`;
      result += `Total Contacts: ${list.num_contacts || contacts.length}\n`;
      result += `Created: ${list.created_at ? new Date(list.created_at).toLocaleDateString() : "N/A"}\n\n`;
    
      // Analyze job titles
      const titles: { [key: string]: number } = {};
      const seniorities: { [key: string]: number } = {};
      const companies: { [key: string]: number } = {};
      const locations: { [key: string]: number } = {};
      let emailCount = 0;
      let phoneCount = 0;
      let linkedinCount = 0;
    
      contacts.forEach((contact: any) => {
        if (contact.title) {
          titles[contact.title] = (titles[contact.title] || 0) + 1;
        }
        if (contact.seniority) {
          seniorities[contact.seniority] = (seniorities[contact.seniority] || 0) + 1;
        }
        if (contact.account?.name) {
          companies[contact.account.name] = (companies[contact.account.name] || 0) + 1;
        }
        if (contact.city) {
          const location = `${contact.city}, ${contact.state || contact.country || ""}`;
          locations[location] = (locations[location] || 0) + 1;
        }
        if (contact.email) emailCount++;
        if (contact.phone_numbers?.length > 0) phoneCount++;
        if (contact.linkedin_url) linkedinCount++;
      });
    
      result += `=== Data Completeness ===\n`;
      result += `Contacts with Email: ${emailCount} (${((emailCount / contacts.length) * 100).toFixed(1)}%)\n`;
      result += `Contacts with Phone: ${phoneCount} (${((phoneCount / contacts.length) * 100).toFixed(1)}%)\n`;
      result += `Contacts with LinkedIn: ${linkedinCount} (${((linkedinCount / contacts.length) * 100).toFixed(1)}%)\n\n`;
    
      result += `=== Top Job Titles ===\n`;
      Object.entries(titles)
        .sort((a, b) => b[1] - a[1])
        .slice(0, 10)
        .forEach(([title, count]) => {
          result += `${title}: ${count}\n`;
        });
    
      result += `\n=== Seniority Distribution ===\n`;
      Object.entries(seniorities)
        .sort((a, b) => b[1] - a[1])
        .forEach(([seniority, count]) => {
          result += `${seniority}: ${count}\n`;
        });
    
      result += `\n=== Top Companies ===\n`;
      Object.entries(companies)
        .sort((a, b) => b[1] - a[1])
        .slice(0, 10)
        .forEach(([company, count]) => {
          result += `${company}: ${count}\n`;
        });
    
      result += `\n=== Top Locations ===\n`;
      Object.entries(locations)
        .sort((a, b) => b[1] - a[1])
        .slice(0, 10)
        .forEach(([location, count]) => {
          result += `${location}: ${count}\n`;
        });
    
      return {
        content: [
          {
            type: "text",
            text: result,
          },
        ],
      };
    }
  • Input schema definition for the analyze_list tool, specifying that it requires a string 'id' parameter representing the List ID.
    inputSchema: {
      type: "object",
      properties: {
        id: {
          type: "string",
          description: "List ID to analyze",
        },
      },
      required: ["id"],
    },
  • src/index.ts:427-441 (registration)
    Tool registration object for 'analyze_list' in the getTools() method, including name, description, and input schema. This array is returned by the ListToolsRequestSchema handler.
    {
      name: "analyze_list",
      description:
        "Analyze a contact list with detailed breakdown: total contacts, job titles distribution, seniority levels, companies, locations, industries, and data completeness metrics.",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "List ID to analyze",
          },
        },
        required: ["id"],
      },
    },
  • src/index.ts:86-87 (registration)
    Switch case in the CallToolRequestSchema handler that routes 'analyze_list' tool calls to the analyzeList method.
    case "analyze_list":
      return await this.analyzeList(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the analysis output but doesn't cover critical behavioral traits: whether this is a read-only operation, if it requires specific permissions, potential rate limits, data freshness, or error handling. For an analysis tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves beyond the basic function.

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, well-structured sentence that efficiently lists all analysis components without unnecessary words. It's front-loaded with the core action ('Analyze a contact list') and details the breakdown metrics in a clear, comma-separated list. Every part of the sentence contributes directly to understanding the tool's function.

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 the tool's moderate complexity (analysis with multiple metrics), no annotations, and no output schema, the description is partially complete. It specifies what analysis is performed but lacks behavioral context (e.g., read-only status, permissions) and output details (e.g., format of results). For a tool with these gaps, it's adequate as a minimum viable description but could be more comprehensive.

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 input schema has 100% description coverage, with the single parameter 'id' documented as 'List ID to analyze'. The description doesn't add any parameter-specific details beyond what the schema provides (e.g., format of the ID, where to find it, or examples). With high schema coverage, the baseline score is 3, as the description doesn't compensate but also doesn't detract.

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: analyzing a contact list with specific breakdown metrics (total contacts, job titles distribution, seniority levels, etc.). It uses the verb 'analyze' with the resource 'contact list' and details what analysis is performed. However, it doesn't explicitly distinguish this from sibling tools like 'get_list_contacts' or 'get_lists', which might also retrieve list 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. It doesn't mention prerequisites (e.g., needing a valid list ID), compare it to siblings like 'get_list_contacts' (which might retrieve raw contacts without analysis) or 'get_lists' (which might list available lists), or specify scenarios where analysis is preferred over simple retrieval. Usage is implied but not explicitly stated.

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/masridigital/apollo.io-mcp'

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