sitebay_list_teams
Retrieve and display all teams associated with your authenticated account, including team details and member information for WordPress site management.
Instructions
List all teams for the authenticated user.
Returns: Formatted list of teams with their details and member information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/sitebay_mcp/server.py:338-373 (handler)The @mcp.tool decorated handler function that implements the sitebay_list_teams tool. It initializes the SiteBay client, fetches the list of teams, formats them nicely, and handles errors.@mcp.tool async def sitebay_list_teams(ctx: Context) -> str: """ List all teams for the authenticated user. Returns: Formatted list of teams with their details and member information """ try: await ctx.info("Fetching teams from SiteBay") client = await initialize_client() teams = await client.list_teams() if not teams: return "No teams found for your account." result = f"**Your Teams** ({len(teams)} teams):\n\n" for team in teams: result += f"• **{team.get('name', 'Unknown')}**\n" result += f" - ID: {team.get('id', 'Unknown')}\n" result += f" - Plan: {team.get('plan_type_name', 'Unknown')}\n" result += f" - Active: {team.get('is_active', 'Unknown')}\n" result += f" - Default: {team.get('is_default', 'Unknown')}\n" result += f" - Created: {team.get('created_at', 'Unknown')}\n\n" await ctx.info("Successfully retrieved teams list") return result except SiteBayError as e: await ctx.error(f"SiteBay API error: {str(e)}") return f"❌ SiteBay Error: {str(e)}" except Exception as e: await ctx.error(f"Unexpected error listing teams: {str(e)}") return f"❌ Unexpected error: {str(e)}"
- src/sitebay_mcp/server.py:338-338 (registration)The @mcp.tool decorator registers the sitebay_list_teams function as an MCP tool.@mcp.tool