Skip to main content
Glama

start_instance

Initiate the launch of a Compute Engine instance on Google Cloud Platform by specifying the project ID, zone, and instance name, and receive a status message upon completion.

Instructions

    Start a Compute Engine instance.
    
    Args:
        project_id: The ID of the GCP project
        zone: The zone where the instance is located (e.g., "us-central1-a")
        instance_name: The name of the instance to start
    
    Returns:
        Status message indicating whether the instance was started successfully
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_nameYes
project_idYes
zoneYes

Implementation Reference

  • The core handler implementation for the 'start_instance' tool. It uses the Google Cloud Compute Engine API to start a specified VM instance, polls the operation status until completion, and returns success or error message. The @mcp.tool() decorator registers it with the MCP server using the function name as the tool name and type hints/docstring for schema.
    def start_instance(project_id: str, zone: str, instance_name: str) -> str:
        """
        Start a Compute Engine instance.
        
        Args:
            project_id: The ID of the GCP project
            zone: The zone where the instance is located (e.g., "us-central1-a")
            instance_name: The name of the instance to start
        
        Returns:
            Status message indicating whether the instance was started successfully
        """
        try:
            from google.cloud import compute_v1
            
            # Initialize the Compute Engine client
            client = compute_v1.InstancesClient()
            
            # Start the instance
            operation = client.start(project=project_id, zone=zone, instance=instance_name)
            
            # Wait for the operation to complete
            operation_client = compute_v1.ZoneOperationsClient()
            
            # This is a synchronous call that will wait until the operation is complete
            while operation.status != compute_v1.Operation.Status.DONE:
                operation = operation_client.get(project=project_id, zone=zone, operation=operation.name.split('/')[-1])
                import time
                time.sleep(1)
            
            if operation.error:
                return f"Error starting instance {instance_name}: {operation.error.errors[0].message}"
            
            return f"Instance {instance_name} in zone {zone} started successfully."
        except Exception as e:
            return f"Error starting instance: {str(e)}"
  • Top-level registration call in the main MCP server file that invokes the compute module's register_tools function, thereby registering the start_instance tool (among others) with the FastMCP server instance.
    compute_tools.register_tools(mcp)
  • Module-level registration function that defines and registers all compute tools, including start_instance via nested @mcp.tool() decorators.
    def register_tools(mcp):
  • Input schema defined by function parameters (project_id: str, zone: str, instance_name: str) and output str, along with detailed docstring describing args and return value, used by MCP for tool schema generation.
    def start_instance(project_id: str, zone: str, instance_name: str) -> str:
        """
        Start a Compute Engine instance.
        
        Args:
            project_id: The ID of the GCP project
            zone: The zone where the instance is located (e.g., "us-central1-a")
            instance_name: The name of the instance to start
        
        Returns:
            Status message indicating whether the instance was started successfully
        """

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior2/5

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

With no annotations, the description carries the full burden for behavioral disclosure. It only states the action and return value, omitting details about required permissions, asynchronous behavior, idempotency, or failure conditions.

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

Conciseness5/5

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

The description is compact and front-loaded with the purpose. The Args/Returns structure is clean and avoids redundancy, with each sentence serving a clear role.

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

Completeness4/5

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

For a straightforward operation, the description covers the action, all parameters, and return type. It lacks edge-case context (e.g., behavior if the instance is already running), but the core usage is adequately specified for a simple tool.

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

Parameters5/5

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

The Args block thoroughly explains each parameter: project_id as the GCP project, zone with an example format, and instance_name as the target. Since the schema has no field descriptions (0% coverage), this fully compensates and adds clear meaning.

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

Purpose5/5

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

The description opens with 'Start a Compute Engine instance', which is a specific verb+resource statement. This clearly distinguishes the tool from siblings like stop_instance, create_instance, and get_instance_details.

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 does not mention prerequisites, exclusions, or suggest other tools for related operations.

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