MCP Tools Reference: compute.googleapis.com

Tool: create_instance

Create a new Google Compute Engine virtual machine (VM) instance. Requires project, zone, and instance name as input. If machine_type is not provided, it defaults to e2-medium . If image_project and image_family are not provided, it defaults to debian-12 image from debian-cloud project. guest_accelerator and maintenance_policy can be optionally provided. Proceed only if there is no error in response and the status of the operation is DONE without any errors. To get details of the operation, use the get_zone_operation tool.

The following sample demonstrate how to use curl to invoke the create_instance MCP tool.

Curl Request
  
curl  
--location  
 'https://compute.googleapis.com/mcp' 
  
 \ 
--header  
 'content-type: application/json' 
  
 \ 
--header  
 'accept: application/json, text/event-stream' 
  
 \ 
--data  
 '{ 
 "method": "tools/call", 
 "params": { 
 "name": "create_instance", 
 "arguments": { 
 // provide these details according to the tool' 
s  
MCP  
specification  
 } 
  
 } 
,  
 "jsonrpc" 
:  
 "2.0" 
,  
 "id" 
:  
 1 
 } 
 ' 
  

Input Schema

Request message for creating an instance.

McpCreateInstanceRequest

JSON representation
 { 
 "project" 
 : 
 string 
 , 
 "zone" 
 : 
 string 
 , 
 "name" 
 : 
 string 
 , 
 "machineType" 
 : 
 string 
 , 
 "imageFamily" 
 : 
 string 
 , 
 "imageProject" 
 : 
 string 
 , 
 "guestAccelerators" 
 : 
 [ 
 { 
 object (  AcceleratorConfig 
 
) 
 } 
 ] 
 , 
 "maintenancePolicy" 
 : 
 enum ( OnHostMaintenance 
) 
 } 
Fields
project

string

Required. Project ID for this request.

zone

string

Required. The zone of the instance.

name

string

Required. Identifier. The instance name.

machineType

string

Optional. The machine type of the instance.

imageFamily

string

Optional. The image family of the instance.

imageProject

string

Optional. The image project of the instance.

guestAccelerators[]

object ( AcceleratorConfig )

Optional. The list of attached accelerators. Each entry specifies the accelerator type (short name or full/partial URL, e.g., 'nvidia-tesla-p4') and the count.

maintenancePolicy

enum ( OnHostMaintenance )

Optional. The maintenance policy option for the instance.

AcceleratorConfig

JSON representation
 { 
 "acceleratorType" 
 : 
 string 
 , 
 "acceleratorCount" 
 : 
 integer 
 } 
Fields
acceleratorType

string

Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.

acceleratorCount

integer

The number of the guest accelerator cards exposed to this instance.

Output Schema

Response message for creating an instance.

McpCreateInstanceResponse

JSON representation
 { 
 "operationName" 
 : 
 string 
 } 
Fields
operationName

string

The operation name of the instance creation.

Tool Annotations

Destructive Hint: ✅ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌

Create a Mobile Website
View Site in Mobile | Classic
Share by: