Facebook Page Publisher
Manage your Facebook Page directly from an AI agent. Create posts, upload photos, schedule content, view analytics, and moderate comments -- all through natural language.
Required Environment Variables
- -
FB_PAGE_ID — The numeric ID of your Facebook Page - INLINECODE1 — A long-lived (non-expiring) Facebook Page Access Token with permissions: pagesmanageposts, pagesreadengagement, pagesmanageengagement
create_post
Create and immediately publish a text post to the Facebook Page.
- -
message (string, required): The text content of the post.
uploadphotopost
Upload a photo to the Facebook Page with an optional caption. The photo must be a publicly accessible URL.
- -
photo_url (string, required): A publicly accessible URL to the image file (JPEG, PNG, etc.). - INLINECODE4 (string, optional): Text caption for the photo post.
schedule_post
Schedule a text post for future publication. Time must be at least 10 minutes ahead and no more than 6 months.
- -
message (string, required): The text content of the post. - INLINECODE6 (string, required): ISO 8601 datetime (e.g., "2026-03-10T09:00:00").
getpageinsights
Retrieve engagement metrics (impressions, reach, engagement, views) for the Facebook Page.
- -
metric (string, optional): One of "impressions", "reach", "engagement", "views", or "all". Default: "all". - INLINECODE8 (string, optional): Time period: "day", "week", or "days_28". Default: "day".
getrecentposts
Fetch the most recent posts from the Page with engagement statistics (likes, comments, shares).
- -
limit (integer, optional): Number of posts to retrieve (1-100). Default: 10.
delete_post
Delete a specific post from the Facebook Page. This action is irreversible.
- -
post_id (string, required): The full post ID (format: pageId_postId).
getpostcomments
Retrieve comments on a specific post.
- -
post_id (string, required): The full post ID (format: pageId_postId). - INLINECODE12 (integer, optional): Number of comments to retrieve (1-100). Default: 25.
replytocomment
Reply to a comment on a post as the Page.
- -
comment_id (string, required): The ID of the comment to reply to. - INLINECODE14 (string, required): The reply message text.
Example Usage
CODEBLOCK0
Setup
- 1. Set
FB_PAGE_ID to your Facebook Page's numeric ID. - Set
FB_ACCESS_TOKEN to a non-expiring Page Access Token. - Run with
uv run src/server.py.
Facebook 页面发布工具
通过AI助手直接管理您的Facebook页面。创建帖子、上传照片、安排内容、查看分析数据和审核评论——全部通过自然语言完成。
必需的环境变量
- - FBPAGEID — 您Facebook页面的数字ID
- FBACCESSTOKEN — 具有以下权限的长期(不过期)Facebook页面访问令牌:pagesmanageposts、pagesreadengagement、pagesmanageengagement
create_post
创建并立即将文本帖子发布到Facebook页面。
- - message(字符串,必需):帖子的文本内容。
uploadphotopost
向Facebook页面上传照片,可附带说明文字。照片必须是可公开访问的URL。
- - photo_url(字符串,必需):图像文件(JPEG、PNG等)的可公开访问URL。
- caption(字符串,可选):照片帖子的文字说明。
schedule_post
安排文本帖子在未来发布。时间必须至少提前10分钟,且不超过6个月。
- - message(字符串,必需):帖子的文本内容。
- scheduled_time(字符串,必需):ISO 8601日期时间(例如:2026-03-10T09:00:00)。
getpageinsights
获取Facebook页面的互动指标(展示量、覆盖人数、互动量、浏览量)。
- - metric(字符串,可选):impressions、reach、engagement、views或all之一。默认值:all。
- period(字符串,可选):时间段:day、week或days_28。默认值:day。
getrecentposts
获取页面最近发布的帖子及其互动统计数据(点赞、评论、分享)。
- - limit(整数,可选):要检索的帖子数量(1-100)。默认值:10。
delete_post
从Facebook页面删除特定帖子。此操作不可逆。
- - postid(字符串,必需):完整的帖子ID(格式:pageIdpostId)。
getpostcomments
检索特定帖子的评论。
- - postid(字符串,必需):完整的帖子ID(格式:pageIdpostId)。
- limit(整数,可选):要检索的评论数量(1-100)。默认值:25。
replytocomment
以页面身份回复帖子上的评论。
- - comment_id(字符串,必需):要回复的评论ID。
- message(字符串,必需):回复消息文本。
使用示例
text
用户:在我的Facebook页面上发布我们正在招聘!查看我们的招聘页面。
助手:我现在使用create_post来发布。
用户:安排一条帖子,明天上午9点发布,内容为限时抢购开始!
助手:我将使用schedule_post并计算好的日期时间来安排。
用户:显示我过去一周的页面洞察数据。
助手:我将使用getpageinsights并设置period=week来获取。
设置步骤
- 1. 将FBPAGEID设置为您的Facebook页面的数字ID。
- 将FBACCESSTOKEN设置为不过期的页面访问令牌。
- 使用uv run src/server.py运行。