get_person_email
Retrieve email addresses for individuals using their Apollo.io person ID to enable direct communication and outreach.
Instructions
Get email address for a person using their Apollo ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apollo_id | Yes | Apollo.io person ID |
Implementation Reference
- src/index.ts:282-290 (handler)MCP CallTool handler for get_person_email: extracts apollo_id argument, calls ApolloClient.getPersonEmail, and returns JSON-formatted result.case 'get_person_email': { const result = await this.apollo.getPersonEmail(args.apollo_id as string); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:189-198 (schema)Input schema for get_person_email tool: requires 'apollo_id' string.inputSchema: { type: 'object', properties: { apollo_id: { type: 'string', description: 'Apollo.io person ID' } }, required: ['apollo_id'] }
- src/index.ts:186-199 (registration)Tool registration in ListTools response: defines name, description, and inputSchema for get_person_email.{ name: 'get_person_email', description: 'Get email address for a person using their Apollo ID', inputSchema: { type: 'object', properties: { apollo_id: { type: 'string', description: 'Apollo.io person ID' } }, required: ['apollo_id'] } },
- src/apollo-client.ts:203-235 (helper)ApolloClient.getPersonEmail method: makes POST request to Apollo API's add_to_my_prospects endpoint to retrieve email(s) for the given person ID, extracts emails from contacts array.async getPersonEmail(apolloId: string): Promise<any> { try { if (!apolloId) { throw new Error('Apollo ID is required'); } const baseUrl = `https://app.apollo.io/api/v1/mixed_people/add_to_my_prospects`; const payload = { entity_ids: [apolloId], analytics_context: 'Searcher: Individual Add Button', skip_fetching_people: true, cta_name: 'Access email', cacheKey: Date.now() }; const response = await axios.post(baseUrl, payload, { headers: { 'X-Api-Key': this.apiKey, 'Content-Type': 'application/json' } }); if (!response.data) { throw new Error('No data received from Apollo API'); } const emails = (response?.data?.contacts ?? []).map((item: any) => item.email); return emails; } catch (error: any) { console.error(`Error getting person email: ${error.message}`); return null; } }