Fetch Linkedin Messages With Person
fetch_linkedin_messages_with_personQuery the local store with search_linkedin_message_history first. Reach for
this tool only when that misses, when you need messages older than the
roughly two-week local backfill window, or when you must be certain whether a
conversation exists — this reads LinkedIn's own synced history, so an empty
result here means no such conversation, not merely "outside the local
window". Fetched messages are written back to the local store, so a later
search_linkedin_message_history sees them too.
This is not a name-lookup tool: pass the person's LinkedIn provider_id,
sourced from a prospect row, search_linkedin_connections, or a prior local
message — never guessed from a name.
On success, a dict with success=True, chat_id (pass to
setup_linkedin_sequence with action_type='message' to reply), count,
truncated (True when older messages exist beyond the fetch cap),
messages — newest first, each with direction
('sent'/'received', or 'unknown' when LinkedIn omits the sender flag),
message_datetime (ISO), and content (truncated to 1000 chars) — and
connection_request_note: the note on your accepted connection request,
which LinkedIn replays into the chat when they accept, as
message_datetime + content (null when there's none). It's the invite,
not a message you sent them, so it's kept out of messages and count. On
failure, success=False and error; an error that mentions
reconnecting means the user must reconnect LinkedIn in Settings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_teammate | No | Read a consented teammate's LinkedIn history instead of your own — pass their email. Gated on that teammate's conversation-sharing setting; a teammate who hasn't shared is rejected. Reads via the teammate's own LinkedIn connection and caches the result to their local store. Omit for your own. | |
| provider_id | Yes | The other person's LinkedIn provider_id (the `sender_provider_id` / `recipient_provider_id` on message and connection rows). |