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
        """
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states the action ('Start') and mentions a return value, it doesn't disclose critical behavioral traits like required permissions, whether this is a mutating operation, potential costs, time to complete, error conditions, or side effects. The description is minimal beyond the basic action.

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 well-structured with clear sections (purpose, args, returns) and uses minimal but effective language. Every sentence serves a purpose, though the 'Returns' section could be slightly more specific about what 'Status message' entails.

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?

For a mutating tool with no annotations and no output schema, the description is insufficient. It doesn't address permissions, costs, side effects, error handling, or what constitutes 'successfully' started. The agent would need to guess about important behavioral aspects of this infrastructure management operation.

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

Parameters4/5

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

With 0% schema description coverage, the description fully compensates by clearly documenting all 3 parameters with meaningful explanations. Each parameter gets a brief but helpful description that adds semantic context beyond what the bare schema provides, including an example for the zone parameter.

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 clearly states the specific action ('Start') and resource ('Compute Engine instance'), distinguishing it from siblings like 'stop_instance' and 'create_instance'. It provides a complete verb+resource combination that leaves no ambiguity about what the tool does.

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 like 'stop_instance' or 'create_instance'. While the purpose is clear, there's no explicit mention of prerequisites, dependencies, or when-not-to-use scenarios that would help an agent select between sibling tools.

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