get_list_contacts
Retrieve comprehensive contact details from a specific Apollo.io list, including emails, titles, and company information for sales intelligence and outreach planning.
Instructions
Scrape/retrieve all contacts from a specific list with full details including emails, titles, companies, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | List ID | |
| page | No | Page number (default: 1) | |
| per_page | No | Results per page (default: 100) |
Implementation Reference
- src/index.ts:965-997 (handler)The main handler function for the 'get_list_contacts' tool. It fetches contacts from a specified Apollo contact list using the API, handles pagination, and formats a detailed text response with contact information including names, IDs, emails, titles, companies, phones, and LinkedIn URLs.private async getListContacts(args: any) { const page = args.page || 1; const perPage = args.per_page || 100; const response = await this.axiosInstance.get(`/contact_lists/${args.id}/contacts`, { params: { page, per_page: perPage }, }); const contacts = response.data.contacts || []; const pagination = response.data.pagination || {}; let result = `List Contacts (${pagination.total_entries || contacts.length} total)\n`; result += `Page ${pagination.page || 1} of ${pagination.total_pages || 1}\n\n`; contacts.forEach((contact: any, index: number) => { result += `${index + 1}. ${contact.first_name} ${contact.last_name}\n`; result += ` ID: ${contact.id}\n`; result += ` Email: ${contact.email || "N/A"}\n`; result += ` Title: ${contact.title || "N/A"}\n`; result += ` Company: ${contact.account?.name || "N/A"}\n`; result += ` Phone: ${contact.phone_numbers?.[0]?.raw_number || "N/A"}\n`; result += ` LinkedIn: ${contact.linkedin_url || "N/A"}\n\n`; }); return { content: [ { type: "text", text: result, }, ], }; }
- src/index.ts:408-424 (schema)The input schema for the 'get_list_contacts' tool, defining required 'id' parameter and optional pagination parameters.inputSchema: { type: "object", properties: { id: { type: "string", description: "List ID", }, page: { type: "number", description: "Page number (default: 1)", }, per_page: { type: "number", description: "Results per page (default: 100)", }, }, required: ["id"],
- src/index.ts:404-426 (registration)The tool registration in the getTools() method, including name, description, and input schema for listing tools.{ name: "get_list_contacts", description: "Scrape/retrieve all contacts from a specific list with full details including emails, titles, companies, etc.", inputSchema: { type: "object", properties: { id: { type: "string", description: "List ID", }, page: { type: "number", description: "Page number (default: 1)", }, per_page: { type: "number", description: "Results per page (default: 100)", }, }, required: ["id"], }, },
- src/index.ts:84-85 (registration)The switch case in the CallToolRequestSchema handler that routes calls to the getListContacts method.case "get_list_contacts": return await this.getListContacts(args);