list_social_accounts
Show all social media accounts linked to your organization, including Instagram, Facebook, and TikTok. Uses your organization ID to fetch connected profiles.
Instructions
List connected social media accounts (Instagram, Facebook, TikTok, etc.).
Shows all social accounts linked to your organization. Requires enterprise subscription. No credits charged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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:13-30 (handler)The main handler function for 'list_social_accounts' tool. Resolves org ID, creates a client, and delegates to client.social_list_accounts().
async def list_social_accounts( org_id: str | None = None, ) -> dict: """ List connected social media accounts (Instagram, Facebook, TikTok, etc.). Shows all social accounts linked to your organization. Requires enterprise subscription. No credits charged. Args: org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided) Returns: List of social accounts with platform, username, account_id, and status. """ oid = resolve_org_id(org_id) client = YaparAIClient() return await client.social_list_accounts(oid) - src/yaparai/client.py:231-235 (helper)HTTP client method that makes a GET request to /api/enterprise/orgs/{org_id}/social/accounts — the underlying API call for the tool.
async def social_list_accounts(self, org_id: str) -> list: """List connected social accounts.""" return await self._request( "GET", f"/api/enterprise/orgs/{org_id}/social/accounts" ) - src/yaparai/server.py:157-157 (registration)Registration of list_social_accounts as an MCP tool on the FastMCP server.
mcp.tool(list_social_accounts) - src/yaparai/tools/_org.py:6-18 (helper)Helper that resolves the org_id from an explicit parameter or falls back to the YAPARAI_ORG_ID environment variable.
def resolve_org_id(org_id: str | None = None) -> str: """Return the org_id from parameter or YAPARAI_ORG_ID env var. Raises ValueError if neither is set. """ oid = org_id or YAPARAI_ORG_ID if not oid: raise ValueError( "Organization ID is required. Either pass org_id parameter " "or set the YAPARAI_ORG_ID environment variable. " "Use list_organizations() to find your org ID." ) return oid - src/yaparai/tools/social.py:10-10 (schema)Type definition for supported social media platforms, defined in the same module as list_social_accounts.
Platform = Literal["instagram", "facebook", "tiktok", "twitter"]