get_linkedin_conversations
Retrieve LinkedIn messaging conversations from your account with optional filters for date range and conversation count to manage professional communications.
Instructions
Get list of LinkedIn conversations from the messaging interface. Account ID is taken from environment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connected_after | No | Filter conversations created after the specified date (timestamp) | |
| count | No | Max conversations to return | |
| timeout | No | Timeout in seconds |
Implementation Reference
- src/index.ts:1028-1057 (handler)Full MCP tool registration, schema, and handler implementation for 'get_linkedin_conversations'. Fetches LinkedIn conversations for the account via AnySite API, supports filtering by company and timestamp.server.tool( "get_linkedin_conversations", "Get LinkedIn conversations (requires ACCOUNT_ID)", { company: z.string().optional().describe("Company URN"), connected_after: z.number().optional().describe("Filter after timestamp"), count: z.number().default(20).describe("Max conversations"), timeout: z.number().default(300).describe("Timeout in seconds") }, async ({ company, connected_after, count, timeout }) => { const requestData: any = { timeout, account_id: ACCOUNT_ID, count }; if (company) requestData.company = company; if (connected_after != null) { requestData.connected_after = connected_after; } log("Starting LinkedIn conversations lookup"); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.CONVERSATIONS, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn conversations lookup error:", error); return { content: [{ type: "text", text: `LinkedIn conversations API error: ${formatError(error)}` }], isError: true }; } } );
- src/index.ts:1028-1057 (registration)MCP server.tool registration for the 'get_linkedin_conversations' tool.server.tool( "get_linkedin_conversations", "Get LinkedIn conversations (requires ACCOUNT_ID)", { company: z.string().optional().describe("Company URN"), connected_after: z.number().optional().describe("Filter after timestamp"), count: z.number().default(20).describe("Max conversations"), timeout: z.number().default(300).describe("Timeout in seconds") }, async ({ company, connected_after, count, timeout }) => { const requestData: any = { timeout, account_id: ACCOUNT_ID, count }; if (company) requestData.company = company; if (connected_after != null) { requestData.connected_after = connected_after; } log("Starting LinkedIn conversations lookup"); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.CONVERSATIONS, requestData); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } catch (error) { log("LinkedIn conversations lookup error:", error); return { content: [{ type: "text", text: `LinkedIn conversations API error: ${formatError(error)}` }], isError: true }; } } );
- src/index.ts:1031-1036 (schema)Zod input schema for the tool parameters.{ company: z.string().optional().describe("Company URN"), connected_after: z.number().optional().describe("Filter after timestamp"), count: z.number().default(20).describe("Max conversations"), timeout: z.number().default(300).describe("Timeout in seconds") },
- src/index.ts:46-46 (helper)API endpoint configuration referenced by the tool handler.CONVERSATIONS: "/api/linkedin/management/conversations",