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 — unless whoever's history
this is keeps only prospects' data and this person isn't one of their
prospects; then they're returned but not stored.
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 (the chat holding the
newest message; 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 |
|---|---|---|---|
| provider_id | Yes | The other person's LinkedIn provider_id (the `sender_provider_id` / `recipient_provider_id` on message and connection rows). | |
| on_behalf_of | No | A teammate's email (one with conversation sharing turned on), or an agency client's from list_agency_clients, to run this call in that account: their agents, settings, connected accounts, and credits. Omit it to act on your own account. |