list_social_posts
List all published and scheduled social media posts for your organization, with optional filters for platform or specific account.
Instructions
List published and scheduled social media posts.
Returns all posts for the organization, with optional filtering by platform or specific account. Requires enterprise subscription.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | No | Filter by platform ("instagram", "facebook", "tiktok", "twitter") | |
| account_id | No | Filter by specific social account ID | |
| org_id | No | Organization ID (uses YAPARAI_ORG_ID env var if not provided) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/yaparai/tools/social.py:73-99 (handler)Main handler function for the list_social_posts MCP tool. Accepts optional platform, account_id, and org_id filters, then delegates to the HTTP client.
async def list_social_posts( platform: Platform | None = None, account_id: str | None = None, org_id: str | None = None, ) -> dict: """ List published and scheduled social media posts. Returns all posts for the organization, with optional filtering by platform or specific account. Requires enterprise subscription. Args: platform: Filter by platform ("instagram", "facebook", "tiktok", "twitter") account_id: Filter by specific social account ID org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided) Returns: List of posts with content, platform, published_at, and engagement stats. """ oid = resolve_org_id(org_id) client = YaparAIClient() params: dict = {} if platform: params["platform"] = platform if account_id: params["account_id"] = account_id return await client.social_list_posts(oid, params or None) - src/yaparai/tools/social.py:10-10 (schema)Type definition for the Platform literal used as a parameter in list_social_posts.
Platform = Literal["instagram", "facebook", "tiktok", "twitter"] - src/yaparai/server.py:159-159 (registration)Registration of list_social_posts as an MCP tool on the server.
mcp.tool(list_social_posts) - src/yaparai/server.py:69-73 (registration)Import of list_social_posts in server.py where the tool is registered.
# --- Enterprise: Social Media --- from yaparai.tools.social import ( list_social_accounts, create_social_post, list_social_posts, - src/yaparai/client.py:213-217 (helper)HTTP client method that sends a GET request to /api/enterprise/orgs/{org_id}/social/posts to fetch social posts.
async def social_list_posts(self, org_id: str, params: dict | None = None) -> dict: """List social media posts.""" return await self._request( "GET", f"/api/enterprise/orgs/{org_id}/social/posts", params=params )