sitebay_backup_list_commits
Retrieve available backup commits for a WordPress site to enable point-in-time restoration. Specify the domain and number of entries to fetch.
Instructions
List available backup commits for point-in-time restore.
Args: fqdn: The site domain number_to_fetch: Number of backup entries to fetch (default: 1)
Returns: List of available backup commits
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fqdn | Yes | ||
| number_to_fetch | No |
Implementation Reference
- src/sitebay_mcp/server.py:496-539 (handler)The primary handler function for the sitebay_backup_list_commits MCP tool, registered via @mcp.tool decorator. It fetches backup commits from the SiteBay API client, formats a user-friendly list, and handles errors appropriately.@mcp.tool async def sitebay_backup_list_commits( ctx: Context, fqdn: str, number_to_fetch: int = 1 ) -> str: """ List available backup commits for point-in-time restore. Args: fqdn: The site domain number_to_fetch: Number of backup entries to fetch (default: 1) Returns: List of available backup commits """ try: await ctx.info(f"Fetching backup commits for {fqdn}") client = await initialize_client() commits = await client.get_backup_commits(fqdn, number_to_fetch) if not commits: return f"No backup commits found for {fqdn}." result = f"**Available Backup Commits for {fqdn}** ({len(commits)} entries):\n\n" for commit in commits: result += f"• **{commit.get('created_at', 'Unknown time')}**\n" result += f" - ID: {commit.get('id', 'Unknown')}\n" result += f" - Commit Hash: {commit.get('commit_hash', 'Unknown')}\n" result += f" - Tables Saved: {len(commit.get('tables_saved', []))} tables\n" result += f" - Status: {'Completed' if commit.get('finished_at') else 'In Progress'}\n" result += "\n" await ctx.info(f"Successfully retrieved backup commits for {fqdn}") return result except SiteBayError as e: await ctx.error(f"Error fetching backup commits: {str(e)}") return f"❌ Backup Error: {str(e)}" except Exception as e: await ctx.error(f"Unexpected backup error: {str(e)}") return f"❌ Unexpected error: {str(e)}"