get_person_activity
Retrieve engagement history and activity data for Apollo.io contacts to analyze interactions and track communication patterns.
Instructions
Get activity history and engagement data for a specific person/contact.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Person/Contact ID |
Implementation Reference
- src/index.ts:1205-1229 (handler)The core handler function that fetches the person's activity history from the Apollo.io API endpoint `/people/{id}/activities`, processes the activities array, formats a textual summary with type, date, and details for each activity, handles empty results, and returns a standardized MCP content response.private async getPersonActivity(args: any) { const response = await this.axiosInstance.get(`/people/${args.id}/activities`); const activities = response.data.activities || []; let result = `Activity History:\n\n`; activities.forEach((activity: any, index: number) => { result += `${index + 1}. ${activity.type}\n`; result += ` Date: ${activity.created_at ? new Date(activity.created_at).toLocaleDateString() : "N/A"}\n`; result += ` Details: ${activity.note || "N/A"}\n\n`; }); if (activities.length === 0) { result += "No activity found for this contact.\n"; } return { content: [ { type: "text", text: result, }, ], }; }
- src/index.ts:588-597 (schema)Defines the input validation schema for the tool, requiring a single 'id' property of type string representing the Person/Contact ID.inputSchema: { type: "object", properties: { id: { type: "string", description: "Person/Contact ID", }, }, required: ["id"], },
- src/index.ts:584-598 (registration)Registers the tool in the getTools() method with its name, description, and input schema for the MCP server.{ name: "get_person_activity", description: "Get activity history and engagement data for a specific person/contact.", inputSchema: { type: "object", properties: { id: { type: "string", description: "Person/Contact ID", }, }, required: ["id"], }, },
- src/index.ts:98-99 (registration)The switch case dispatcher in the main tool handling method that routes calls to the specific getPersonActivity handler.case "get_person_activity": return await this.getPersonActivity(args);