nv_get_conversation
Retrieve LinkedIn Sales Navigator conversation history with a specific person using their profile URL. Optionally filter messages by date to focus on recent interactions.
Instructions
Allows you to get a conversation with a LinkedIn person using Sales Navigator messaging.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| personUrl | Yes | The LinkedIn URL of the person whose conversation you want to poll (e.g., 'https://www.linkedin.com/in/john-doe') | |
| since | No | Optional ISO 8601 timestamp to only retrieve messages since this date (e.g., '2024-01-15T10:30:00Z'). If not provided, the entire conversation history will be returned. |
Implementation Reference
- src/tools/nv-get-conversation.ts:17-33 (handler)The overridden execute method that implements the core logic of the 'nv_get_conversation' tool. It polls conversations for the given person URL, syncs the conversation if there are errors, and returns the mapped response.public override async execute({ linkedapi, args: { personUrl, since }, }: { linkedapi: LinkedApi; args: { personUrl: string; since?: string }; workflowTimeout: number; progressToken?: string | number; }): Promise<TMappedResponse<TConversationPollResult>> { const conversations = await this.getConversation(linkedapi, personUrl, since); if (conversations.errors.length === 0) { return conversations; } const workflowId = await linkedapi.nvSyncConversation.execute({ personUrl }); await linkedapi.nvSyncConversation.result(workflowId); return await this.getConversation(linkedapi, personUrl, since); }
- Zod schema defining the input parameters for the tool: personUrl (required string) and since (optional string). Used for input validation.protected readonly schema = z.object({ personUrl: z.string(), since: z.string().optional(), });
- The getTool method returns the MCP Tool definition, including name, description, and detailed inputSchema for the 'nv_get_conversation' tool.public override getTool(): Tool { return { name: this.name, description: 'Allows you to get a conversation with a LinkedIn person using Sales Navigator messaging.', inputSchema: { type: 'object', properties: { personUrl: { type: 'string', description: "The LinkedIn URL of the person whose conversation you want to poll (e.g., 'https://www.linkedin.com/in/john-doe')", }, since: { type: 'string', description: "Optional ISO 8601 timestamp to only retrieve messages since this date (e.g., '2024-01-15T10:30:00Z'). If not provided, the entire conversation history will be returned.", }, }, required: ['personUrl'], }, }; }
- Private helper method that polls conversations using the LinkedApi pollConversations method for Sales Navigator (type 'nv') and maps the response.private async getConversation( linkedapi: LinkedApi, personUrl: string, since?: string, ): Promise<TMappedResponse<TConversationPollResult>> { const conversations = await linkedapi.pollConversations([ { personUrl: personUrl, type: 'nv', since: since, }, ]); return { data: conversations.data ? conversations.data[0] : undefined, errors: conversations.errors, }; }
- src/linked-api-tools.ts:58-58 (registration)The NvGetConversationTool is instantiated and added to the array of available tools in the LinkedApiTools class constructor.new NvSearchCompaniesTool(progressCallback),