Send Messenger messages, read conversations, manage the Messenger profile and route threads for a Facebook Page through the Messenger Platform.
Facebook Messenger ships in the w6w first-party pack. It declares 19 actions, 3 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.facebook-messengerThis app talks to people who message a Facebook Page, through the Messenger Platform’s Send API. It sends text, images, audio, video and files, button and generic (carousel) templates, and quick replies, and it shows typing, read and emoji-reaction indicators — everything a Page needs to hold a conversation from a workflow.
It also reads what has already been said: it lists a Page’s conversations, lists the messages inside one, and fetches a single message with its sender, recipient and reply context. The Messenger profile — greeting text, Get Started button, ice breakers and the persistent menu — can be read, set and cleared, and media can be uploaded once and reused by attachment id. When more than one app is connected to a Page, thread control can be passed to or taken back from another app.
Messenger enforces a messaging window: a Page may only message a person who has contacted it first, and outside the standard window a message needs an approved message tag. This app does not work around that — Meta’s errors are returned verbatim so a workflow can see exactly why a send was refused. It authenticates with a Page access token, because every Messenger endpoint is Page-scoped.
Three routes to the same 19 actions. The Workflow tab is generated from Facebook Messenger's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
delete-messenger-profile-fields Remove properties such as the greeting, ice breakers or persistent menu.
get-messenger-profile Read the Page's greeting, Get Started button, ice breakers, persistent menu and other profile properties.
get-page-status Read the Page's integrity status, violations and messaging restrictions.
list-conversation-messages List the message IDs (and times) in a conversation.
list-conversations List the Page's Messenger conversations, or find the one with a specific person.
send-attachment Send an image, audio, video or file, from a URL or a previously saved attachment.
send-generic-template Send a card, or a carousel of up to ten cards, with an image and buttons.
set-ice-breakers Set the FAQ questions shown to people who open a new conversation.
set-messenger-profile Set one or more Messenger Profile properties (Get Started, allowlisted domains …).
set-persistent-menu Set the menu that is always visible in a Messenger conversation with the Page.
take-thread-control Take control of a conversation that is idle or owned by another app.
upload-attachment Save an image, audio, video or file from a URL and get a reusable attachment ID.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying Facebook Messenger's real ids.
{
"manifestVersion": "2",
"name": "facebook-messenger-example",
"steps": [
{
"id": "get-message",
"uses": {
"app": "io.w6w.facebook-messenger",
"action": "get-message",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"messageId": "<messageId>"
}
}
]
}get-message get-messenger-profile get-page-status list-conversation-messages list-conversations +14 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for Facebook Messenger, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to Facebook Messenger. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "get-message",
payload: {
messageId: "<value>",
// fields: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action get-message --payload '{"messageId":"<value>"}' Give an AI agent Facebook Messenger — without giving it Facebook Messenger's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.facebook-messenger#get-message",
"input": {
"messageId": "<messageId>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's Facebook Messenger connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
Facebook Messenger's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. Facebook Messenger itself is MIT, and the runtime that executes it is source-available (FSL).
Facebook Messenger declares its own checks, so its health is a property of the app rather than something the host guesses at.
Unauthenticated GET /me?fields=id on graph.facebook.com. Graph's own OAuth error envelope passes — it proves the API is answering. Token validity is the derived `auth:*` check's job.
Percentage of the app's call-count, CPU-time and total-time allowances consumed, read off `X-App-Usage`. Meta throttles when any meter reaches 100.