get_conversation
Retrieve LinkedIn message conversations with specific contacts by providing their profile URL. Optionally filter messages by date to access relevant communication history.
Instructions
Allows you to get a conversation with a LinkedIn person using standard LinkedIn 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/get-conversation.ts:17-33 (handler)Core handler function that executes the 'get_conversation' tool logic: polls for conversations, syncs if necessary, and returns the result.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.syncConversation.execute({ personUrl }); await linkedapi.syncConversation.result(workflowId); return await this.getConversation(linkedapi, personUrl, since); }
- src/tools/get-conversation.ts:58-73 (schema)Input schema definition for the 'get_conversation' tool, specifying parameters personUrl (required) and since (optional).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'], },
- src/linked-api-tools.ts:38-38 (registration)Registration of the GetConversationTool instance in the LinkedApiTools constructor's tools array.new GetConversationTool(progressCallback),
- src/tools/get-conversation.ts:35-51 (helper)Helper function that performs the actual conversation polling using linkedapi.pollConversations.private async getConversation( linkedapi: LinkedApi, personUrl: string, since?: string, ): Promise<TMappedResponse<TConversationPollResult>> { const conversations = await linkedapi.pollConversations([ { personUrl: personUrl, type: 'st', since: since, }, ]); return { data: conversations.data ? conversations.data[0] : undefined, errors: conversations.errors, }; }
- src/linked-api-tools.ts:9-9 (registration)Import statement for GetConversationTool used in registration.import { GetConversationTool } from './tools/get-conversation.js';