Skip to main content
Glama

sitebay_list_sites

Retrieve a list of WordPress sites managed by the authenticated user, displaying domain, status, region, and version details. Filter results by team ID to organize sites efficiently.

Instructions

List all WordPress sites for the authenticated user.

Args: team_id: Optional team ID (UUID4) to filter sites by team

Returns: Formatted string with site details including domain, status, region, and versions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_idNo

Implementation Reference

  • MCP tool handler registration and execution wrapper for sitebay_list_sites. Initializes the SiteBay client, handles MCP context logging, delegates to the core sites module helper, and manages errors.
    @mcp.tool async def sitebay_list_sites(ctx: Context, team_id: Optional[UUID4] = None) -> str: """ List all WordPress sites for the authenticated user. Args: team_id: Optional team ID (UUID4) to filter sites by team Returns: Formatted string with site details including domain, status, region, and versions """ try: await ctx.info("Fetching WordPress sites from SiteBay") if team_id: await ctx.info(f"Filtering by team ID: {team_id}") client = await initialize_client() team_id_str = str(team_id) if team_id is not None else None result = await sites.sitebay_list_sites(client, team_id_str) await ctx.info("Successfully retrieved site list") return result except SiteBayError as e: await ctx.error(f"SiteBay API error: {str(e)}") return f"❌ SiteBay Error: {str(e)}" except ValueError as e: await ctx.error(f"Validation error listing sites: {str(e)}") return f"❌ Validation Error: {str(e)}" except Exception as e: await ctx.error(f"Unexpected error listing sites: {str(e)}") return f"❌ Unexpected error: {str(e)}"
  • Core helper function implementing the site listing logic: calls client.list_sites, validates and formats the response into a user-friendly string with site details.
    async def sitebay_list_sites( client: SiteBayClient, team_id: Optional[str] = None ) -> str: """ List all WordPress sites for the authenticated user. Args: team_id: Optional team ID to filter sites by team Returns: Formatted string with site details """ try: # Normalize team_id to string (UUID4 expected by API) if team_id is not None: team_id = str(team_id) sites = await client.list_sites(team_id=team_id) if isinstance(sites, str): return f"Error listing sites: {sites}" if not isinstance(sites, list) or not all(isinstance(s, dict) for s in sites): return f"Unexpected response format when listing sites: {sites}" if not sites: return "No sites found for your account." result = f"Found {len(sites)} site(s):\n\n" for site in sites: result += f"• **{site.get('fqdn', 'Unknown')}**\n" result += f" - Active: {site.get('active', 'Unknown')}\n" result += f" - HTTP Auth Enabled: {site.get('http_auth_enabled', 'Unknown')}\n" result += f" - Is Free: {site.get('is_free', 'Unknown')}\n" result += f" - Created: {site.get('created_at', 'Unknown')}\n" result += "\n" return result except SiteBayError as e: return f"Error listing sites: {str(e)}" except ValueError as e: return f"Error listing sites: {str(e)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sitebay/sitebay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server