name: sync-data-facebook description: > Fetch Facebook Messenger conversations from browser into a JSON file. No classification, no actions — just data. Requires browser. allowed-tools: Read, Write, Edit, Glob, Grep, Bash(python3:), mcp__claude-in-chrome__
Sync Facebook Messenger Data
Facebook Messenger ingestion via browser automation. No classification, no triage. Slow — requires browser. Cannot run in parallel with other browser-based syncs.
Use facebook.com/messages (NOT messenger.com) — shows more message history for E2E encrypted chats, better sidebar previews.
Output File
outputs/sync-data/facebook.json — full replacement on every run.
Schema
{
"version": 1,
"last_synced": "2026-02-11T09:05:00-08:00",
"conversation_count": 20,
"conversations": [
{
"name": "Contact Name",
"isGroup": false,
"lastActivity": "2026-02-11 08:30",
"unreadCount": 0,
"lastMessagePreview": "text",
"isMessageRequest": false,
"isE2EEncrypted": false,
"messages": [
{
"sender": "Contact Name",
"timestamp": "2026-02-11 08:30",
"content": "Message text here"
}
]
}
]
}
Steps
- Get browser tab context via
tabs_context_mcp. - Use an existing Facebook messages tab or create a new one. Navigate to
https://www.facebook.com/messages. - Wait for chat list to load in the left sidebar. If login required, ask Master to authenticate.
- Extract the conversation list (first 20 conversations) from the sidebar.
For each conversation, capture list-level metadata:
name: contact or group nameisGroup: true if group chat indicator presentlastActivity: timestamp of last messageunreadCount: unread badge count (0 if none)lastMessagePreview: the preview text visible in the sidebar
Click into EVERY conversation and extract messages. Sidebar previews are often truncated or show "Messages and calls are secured..." which hides actual content. For each conversation:
a. Click on the conversation in the sidebar. b. Wait 1-2 seconds for messages to load in the chat panel. c. Verify the conversation opened by checking the header. d. Extract the last 5-10 visible messages. Each message:
{ sender, timestamp, content }e. Check for E2E encryption badge — setisE2EEncrypted: trueif present. f. If message content shows "Messages are missing" or is unreadable, note what IS visible and set content to[encrypted - not readable].Check "Message Requests" folder. After processing regular conversations: a. Look for "Message Requests" link/button in the sidebar. b. If found, click into it and scan for conversations. c. Extract these the same way, with
isMessageRequest: true. d. Navigate back to the main chat list after. e. Include message requests in the conversations array.Only include conversations currently visible. The output is a full replacement — do NOT carry forward conversations from previous syncs. Output reflects exactly what's in the chat list now.
Build the output object with
version,last_synced(current ISO timestamp with timezone offset),conversation_count, andconversations.Write to
outputs/sync-data/facebook.json(full replacement).Log: "Synced {N} Facebook conversations at {timestamp}"
Known Issues
- Facebook's DOM is heavily obfuscated with auto-generated class names. Use
read_page,find, andget_page_texttools rather than hardcoded CSS selectors. - E2E encrypted chats: despite the badge,
facebook.comusually shows recent message content. If content is truly missing, capture what's available. - Facebook may show notification permission popups or cookie banners — dismiss them (decline cookies for privacy).
- Message timestamps on Facebook are often relative ("2h", "3d", "Yesterday") — capture as-is.
- Some conversations may show "This person isn't available on Messenger" — still capture the visible messages.
Notes
- This skill does NOT classify or triage. That's
alfred-fb-message-triage. - The file is always the latest snapshot. No historical accumulation.
- Requires exclusive browser access — cannot run in parallel with other browser-based skills.