get_social_quota
Check your social media post quota, message limits, and billing period before running bulk operations to avoid exceeding usage limits.
Instructions
Get social media quota and usage limits.
Returns remaining post quota, message limits, and billing period info. Useful to check before running bulk operations.
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:102-119 (handler)Tool handler: get_social_quota() — resolves org ID, creates a YaparAIClient, and delegates to client.social_get_quota(oid). Returns a dict with quota usage limits and billing period info.
async def get_social_quota( org_id: str | None = None, ) -> dict: """ Get social media quota and usage limits. Returns remaining post quota, message limits, and billing period info. Useful to check before running bulk operations. Args: org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided) Returns: Dict with quota limits, used counts, and billing period dates. """ oid = resolve_org_id(org_id) client = YaparAIClient() return await client.social_get_quota(oid) - src/yaparai/server.py:160-160 (registration)Tool registration: mcp.tool(get_social_quota) registers the handler with the MCP server as part of the 'Enterprise: Social Media' group (tools 157-166).
mcp.tool(get_social_quota) - src/yaparai/tools/_org.py:6-18 (helper)Helper: resolve_org_id() — resolves the org_id from the explicit parameter or falls back to YAPARAI_ORG_ID env var. Used by get_social_quota.
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/client.py:269-273 (helper)API client method: social_get_quota() — sends a GET request to /api/enterprise/orgs/{org_id}/social/quota to retrieve the social media quota.
async def social_get_quota(self, org_id: str) -> dict: """Get social media quota.""" return await self._request( "GET", f"/api/enterprise/orgs/{org_id}/social/quota" ) - src/yaparai/server.py:70-81 (registration)Import statement: get_social_quota is imported from yaparai.tools.social into server.py for MCP registration.
from yaparai.tools.social import ( list_social_accounts, create_social_post, list_social_posts, get_social_quota, generate_caption, generate_hashtags, list_inbox, read_conversation, reply_to_message, ai_reply_suggestion, )