list_organizations
List organizations you belong to on YaparAI. Get organization IDs, names, and your role to use with enterprise tools.
Instructions
List your organizations on YaparAI.
Returns organizations you're a member of, with their IDs, names, and your role. Use the org ID for enterprise tools (social media, CRM, chatbots). You can set YAPARAI_ORG_ID env var to skip passing org_id to every call. No credits charged.
Returns: List of organizations with id, name, role, and member count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/yaparai/tools/organizations.py:8-22 (handler)The actual tool handler for list_organizations. Creates a YaparAIClient and calls client.list_organizations().
async def list_organizations() -> dict: """ List your organizations on YaparAI. Returns organizations you're a member of, with their IDs, names, and your role. Use the org ID for enterprise tools (social media, CRM, chatbots). You can set YAPARAI_ORG_ID env var to skip passing org_id to every call. No credits charged. Returns: List of organizations with id, name, role, and member count. """ client = YaparAIClient() return await client.list_organizations() - src/yaparai/server.py:154-154 (registration)Registration of list_organizations as an MCP tool via mcp.tool().
mcp.tool(list_organizations) - src/yaparai/server.py:67-67 (registration)Import of list_organizations from yaparai.tools.organizations.
from yaparai.tools.organizations import list_organizations - src/yaparai/client.py:201-203 (helper)The low-level HTTP client method that sends a GET request to /api/enterprise/organizations.
async def list_organizations(self) -> list: """List user's organizations.""" return await self._request("GET", "/api/enterprise/organizations") - src/yaparai/tools/_org.py:6-18 (helper)Helper that references list_organizations in its error message when no org ID is found.
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