create_social_post
Create and publish social media posts across Instagram, Facebook, TikTok, and Twitter. Supports text, images, videos, and optional scheduling for later.
Instructions
Create and publish a social media post.
Post to Instagram, Facebook, TikTok, Twitter/X and other platforms. Supports text, images, and videos. Requires enterprise subscription.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Post caption/text content | |
| platform | Yes | Target platform ("instagram", "facebook", "tiktok", "twitter") | |
| account_id | Yes | Social account ID (from list_social_accounts) | |
| media_urls | No | Optional list of image/video URLs to attach | |
| scheduled_at | No | Optional ISO 8601 datetime to schedule the post (e.g., "2026-05-01T10:00:00Z"). If None, posts immediately. | |
| 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:33-70 (handler)The core implementation of the create_social_post tool. Builds a payload dict with text, platform, account_id (and optionally media_urls, scheduled_at), then calls client.social_create_post(oid, payload).
async def create_social_post( text: str, platform: Platform, account_id: str, media_urls: list[str] | None = None, scheduled_at: str | None = None, org_id: str | None = None, ) -> dict: """ Create and publish a social media post. Post to Instagram, Facebook, TikTok, Twitter/X and other platforms. Supports text, images, and videos. Requires enterprise subscription. Args: text: Post caption/text content platform: Target platform ("instagram", "facebook", "tiktok", "twitter") account_id: Social account ID (from list_social_accounts) media_urls: Optional list of image/video URLs to attach scheduled_at: Optional ISO 8601 datetime to schedule the post (e.g., "2026-05-01T10:00:00Z"). If None, posts immediately. org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided) Returns: Dict with post_id, status, platform, and published details. """ oid = resolve_org_id(org_id) client = YaparAIClient() payload: dict = { "text": text, "platform": platform, "account_id": account_id, } if media_urls: payload["media_urls"] = media_urls if scheduled_at: payload["scheduled_at"] = scheduled_at return await client.social_create_post(oid, payload) - src/yaparai/tools/social.py:10-10 (schema)The Platform type alias (Literal["instagram", "facebook", "tiktok", "twitter"]) used as a parameter type for the create_social_post function.
Platform = Literal["instagram", "facebook", "tiktok", "twitter"] - src/yaparai/server.py:158-158 (registration)Registration of create_social_post as an MCP tool via mcp.tool(create_social_post).
mcp.tool(create_social_post) - src/yaparai/tools/social.py:7-7 (helper)Imports resolve_org_id from _org helper module, used to resolve the organization ID parameter in create_social_post.
from yaparai.tools._org import resolve_org_id