Skip to main content
Glama

create_backup

Generate backups for GCP Cloud SQL instances by specifying the project ID, instance ID, and optional description. Ensures data recovery and continuity for Google Cloud databases.

Instructions

    Create a backup for a Cloud SQL instance.
    
    Args:
        project_id: The ID of the GCP project
        instance_id: The ID of the Cloud SQL instance
        description: Optional description for the backup
    
    Returns:
        Result of the backup operation
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
instance_idYes
project_idYes

Implementation Reference

  • The create_backup tool handler: creates an on-demand backup for a Cloud SQL instance using the GCP SQL Admin API.
        @mcp.tool()
        def create_backup(project_id: str, instance_id: str, description: Optional[str] = None) -> str:
            """
            Create a backup for a Cloud SQL instance.
            
            Args:
                project_id: The ID of the GCP project
                instance_id: The ID of the Cloud SQL instance
                description: Optional description for the backup
            
            Returns:
                Result of the backup operation
            """
            try:
                from googleapiclient import discovery
                
                # Initialize the Cloud SQL Admin API client
                service = discovery.build('sqladmin', 'v1')
                
                # Create backup
                backup_run_body = {}
                if description:
                    backup_run_body['description'] = description
                
                request = service.backupRuns().insert(project=project_id, instance=instance_id, body=backup_run_body)
                operation = request.execute()
                
                # Get operation ID and status
                operation_id = operation.get('name', 'Unknown')
                status = operation.get('status', 'Unknown')
                
                return f"""
    Backup operation initiated:
    - Instance: {instance_id}
    - Project: {project_id}
    - Description: {description or 'None provided'}
    
    Operation ID: {operation_id}
    Status: {status}
    
    The backup process may take some time to complete. You can check the status of the backup using the Cloud SQL Admin API or Google Cloud Console.
    """
            except Exception as e:
                return f"Error creating backup: {str(e)}"
  • Registers the databases tools module, which contains the create_backup handler, with the MCP server instance.
    databases_tools.register_tools(mcp)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates a backup but doesn't describe what that entails—whether it's a full or incremental backup, how long it takes, if it requires downtime, what permissions are needed, or potential side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections for Args and Returns. It uses bullet-like formatting for parameters, making it easy to scan. There's no unnecessary verbosity, and the information is front-loaded with the main purpose stated first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a mutation tool for backups), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the return value beyond 'Result of the backup operation,' nor does it cover behavioral aspects like error handling or operational impact. For a tool with 3 parameters and significant implications, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter details. The description adds basic semantics by listing parameters and their purposes (e.g., 'project_id: The ID of the GCP project'), which helps clarify what each parameter means. However, it doesn't provide format examples, constraints, or deeper context, leaving some ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Create a backup for a Cloud SQL instance.' It specifies the verb ('create') and resource ('backup for a Cloud SQL instance'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'create_snapshot' or 'list_snapshots', which might be related backup operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., instance must be running), when not to use it (e.g., during peak hours), or refer to sibling tools like 'create_snapshot' for comparison. The usage context is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/henihaddad/gcp-mcp'

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