MCP Tools Reference: compute.googleapis.com

Tool: list_managed_instances

Lists managed instances for a given managed instance group (MIG). For each instance, details include id, instance URL, instance status, and current action. Requires project, zone, and MIG name as input.

The following sample demonstrate how to use curl to invoke the list_managed_instances 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": "list_managed_instances",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Input Schema

Request message for listing managed instances.

JSON representation
{
  "project": string,
  "zone": string,
  "name": string,
  "pageSize": integer,
  "pageToken": string
}
Fields
project

string

Required. Project ID for this request.

zone

string

Required. The zone of the instance group manager.

name

string

Required. Identifier. The instance group manager name.

pageSize

integer

Optional. The maximum number of managed instances to return.

pageToken

string

Optional. A page token received from a previous call to list managed instances.

Output Schema

Response message for listing managed instances.

JSON representation
{
  "managedInstances": [
    {
      object (ManagedInstance)
    }
  ],
  "nextPageToken": string
}
Fields
managedInstances[]

object (ManagedInstance)

The list of managed instances.

nextPageToken

string

A token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

JSON representation
{
  "name": string,
  "instance": string,
  "id": string,
  "instanceStatus": enum (Status),
  "version": {
    object (Version)
  },
  "preservedStateFromPolicy": {
    object (PreservedState)
  },
  "preservedStateFromConfig": {
    object (PreservedState)
  },
  "currentAction": enum (InstanceAction),
  "instanceHealth": [
    {
      object (InstanceHealth)
    }
  ],
  "lastAttempt": {
    object (LastAttempt)
  },
  "propertiesFromFlexibilityPolicy": {
    object (PropertiesFromFlexibilityPolicy)
  }
}
Fields
name

string

Output only. [Output Only] The name of the instance. The name always exists even if the instance has not yet been created.

instance

string

Output only. [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created.

id

string (uint64 format)

Output only. [Output only] The unique identifier for this resource. This field is empty when instance does not exist.

instanceStatus

enum (Status)

Output only. [Output Only] The status of the instance. This field is empty when the instance does not exist.

version

object (Version)

Output only. [Output Only] Intended version of this instance.

preservedStateFromPolicy

object (PreservedState)

Output only. [Output Only] Preserved state generated based on stateful policy for this instance.

preservedStateFromConfig

object (PreservedState)

Output only. [Output Only] Preserved state applied from per-instance config for this instance.

currentAction

enum (InstanceAction)

Output only. [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values:

  • NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance.
  • CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.
  • CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead.
  • RECREATING The managed instance group is recreating this instance.
  • DELETING The managed instance group is permanently deleting this instance.
  • ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.
  • RESTARTING The managed instance group is restarting the instance.
  • REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.
  • VERIFYING The managed instance group has created the instance and it is in the process of being verified.

instanceHealth[]

object (InstanceHealth)

Output only. [Output Only] Health state of the instance per health-check.

lastAttempt

object (LastAttempt)

Output only. [Output Only] Information about the last attempt to create or delete the instance.

propertiesFromFlexibilityPolicy

object (PropertiesFromFlexibilityPolicy)

Output only. [Output Only] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy.

JSON representation
{
  "name": string,
  "instanceTemplate": string
}
Fields
name

string

Output only. [Output Only] Name of the version.

instanceTemplate

string

Output only. [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }.

JSON representation
{
  "disks": {
    string: {
      object (PreservedDisk)
    },
    ...
  },
  "metadata": {
    string: string,
    ...
  },
  "internalIPs": {
    string: {
      object (PreservedNetworkIp)
    },
    ...
  },
  "externalIPs": {
    string: {
      object (PreservedNetworkIp)
    },
    ...
  },
  "disksAlts": [
    {
      object
    }
  ],
  "metadataAlts": [
    {
      object
    }
  ]
}
Fields
disks

map (key: string, value: object (PreservedDisk))

Preserved disks defined for this instance. This map is keyed with the device names of the disks.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

metadata

map (key: string, value: string)

Preserved metadata defined for this instance.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

internalIPs

map (key: string, value: object (PreservedNetworkIp))

Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

externalIPs

map (key: string, value: object (PreservedNetworkIp))

Preserved external IPs defined for this instance. This map is keyed with the name of the network interface.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

disksAlts[]
(deprecated)

object (Struct format)

metadataAlts[]
(deprecated)

object (Struct format)

JSON representation
{
  "key": string,
  "value": {
    object (PreservedDisk)
  }
}
Fields
key

string

value

object (PreservedDisk)

JSON representation
{
  "source": string,
  "mode": enum (DiskMode),
  "autoDelete": enum (AutoDelete)
}
Fields
source

string

The URL of the disk resource that is stateful and should be attached to the VM instance.

mode

enum (DiskMode)

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

autoDelete

enum (AutoDelete)

These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

value

string

JSON representation
{
  "key": string,
  "value": {
    object (PreservedNetworkIp)
  }
}
Fields
key

string

value

object (PreservedNetworkIp)

JSON representation
{
  "autoDelete": enum (AutoDelete),
  "ipAddress": {
    object (IpAddress)
  }
}
Fields
autoDelete

enum (AutoDelete)

These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.

ipAddress

object (IpAddress)

Ip address representation

JSON representation
{
  "literal": string,
  "address": string
}
Fields
literal

string

An IPv4 internal network address to assign to the instance for this network interface.

address

string

The URL of the reservation for this IP address.

JSON representation
{
  "key": string,
  "value": {
    object (PreservedNetworkIp)
  }
}
Fields
key

string

value

object (PreservedNetworkIp)

JSON representation
{
  "fields": {
    string: value,
    ...
  }
}
Fields
fields

map (key: string, value: value (Value format))

Unordered map of dynamically typed values.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

JSON representation
{
  "key": string,
  "value": value
}
Fields
key

string

value

value (Value format)

JSON representation
{

  // Union field kind can be only one of the following:
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
  // End of list of possible types for union field kind.
}
Fields
Union field kind. The kind of value. kind can be only one of the following:
nullValue

null

Represents a null value.

numberValue

number

Represents a double value.

stringValue

string

Represents a string value.

boolValue

boolean

Represents a boolean value.

structValue

object (Struct format)

Represents a structured value.

listValue

array (ListValue format)

Represents a repeated Value.

JSON representation
{
  "values": [
    value
  ]
}
Fields
values[]

value (Value format)

Repeated field of dynamically typed values.

JSON representation
{
  "healthCheck": string,
  "detailedHealthState": enum (HealthState)
}
Fields
healthCheck

string

Output only. [Output Only] The URL for the health check that verifies whether the instance is healthy.

detailedHealthState

enum (HealthState)

Output only. [Output Only] The current detailed instance health state.

JSON representation
{
  "errors": {
    "errors": [
      {
        "code": string,
        "location": string,
        "message": string,
        "errorDetails": [
          {
            "errorInfo": {
              object (ErrorInfo)
            },
            "quotaInfo": {
              object (QuotaExceededInfo)
            },
            "help": {
              object (google.rpc.Help)
            },
            "localizedMessage": {
              object (google.rpc.LocalizedMessage)
            }
          }
        ]
      }
    ]
  }
}
Fields
errors

object

Output only. [Output Only] Encountered errors during the last attempt to create or delete the instance.

errors[]

object

[Output Only] The array of errors encountered while processing this operation.

code

string

[Output Only] The error type identifier for this error.

location

string

[Output Only] Indicates the field in the request that caused the error. This property is optional.

message

string

[Output Only] An optional, human-readable error message.

errorDetails[]

object

[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.

errorInfo

object (ErrorInfo)

quotaInfo

object (QuotaExceededInfo)

help

object (google.rpc.Help)

localizedMessage

object (google.rpc.LocalizedMessage)

JSON representation
{
  "errors": [
    {
      "code": string,
      "location": string,
      "message": string,
      "errorDetails": [
        {

          // Union field details_oneof can be only one of the following:
          "errorInfo": {
            object (ErrorInfo)
          },
          "quotaInfo": {
            object (QuotaExceededInfo)
          },
          "help": {
            object (google.rpc.Help)
          },
          "localizedMessage": {
            object (google.rpc.LocalizedMessage)
          }
          // End of list of possible types for union field details_oneof.
        }
      ]
    }
  ]
}
Fields
errors[]

object

[Output Only] The array of errors encountered while processing this operation.

code

string

[Output Only] The error type identifier for this error.

location

string

[Output Only] Indicates the field in the request that caused the error. This property is optional.

message

string

[Output Only] An optional, human-readable error message.

errorDetails[]

object

[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.

errorInfo

object (ErrorInfo)

quotaInfo

object (QuotaExceededInfo)

help

object (google.rpc.Help)

localizedMessage

object (google.rpc.LocalizedMessage)

JSON representation
{
  "code": string,
  "location": string,
  "message": string,
  "errorDetails": [
    {
      "errorInfo": {
        object (ErrorInfo)
      },
      "quotaInfo": {
        object (QuotaExceededInfo)
      },
      "help": {
        object (google.rpc.Help)
      },
      "localizedMessage": {
        object (google.rpc.LocalizedMessage)
      }
    }
  ]
}
Fields
code

string

[Output Only] The error type identifier for this error.

location

string

[Output Only] Indicates the field in the request that caused the error. This property is optional.

message

string

[Output Only] An optional, human-readable error message.

errorDetails[]

object

[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.

errorInfo

object (ErrorInfo)

quotaInfo

object (QuotaExceededInfo)

help

object (google.rpc.Help)

localizedMessage

object (google.rpc.LocalizedMessage)

JSON representation
{

  // Union field details_oneof can be only one of the following:
  "errorInfo": {
    object (ErrorInfo)
  },
  "quotaInfo": {
    object (QuotaExceededInfo)
  },
  "help": {
    object (google.rpc.Help)
  },
  "localizedMessage": {
    object (google.rpc.LocalizedMessage)
  }
  // End of list of possible types for union field details_oneof.
}
Fields

Union field details_oneof.

details_oneof can be only one of the following:

errorInfo

object (ErrorInfo)

quotaInfo

object (QuotaExceededInfo)

help

object (google.rpc.Help)

localizedMessage

object (google.rpc.LocalizedMessage)

JSON representation
{
  "reason": string,
  "domain": string,
  "metadatas": {
    string: string,
    ...
  }
}
Fields
reason

string

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of [A-Z][A-Z0-9_]+[A-Z0-9], which represents UPPER_SNAKE_CASE.

domain

string

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

metadatas

map (key: string, value: string)

Additional structured details about this error.

Keys must match a regular expression of [a-z][a-zA-Z0-9-_]+ but should ideally be lowerCamelCase. Also, they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

value

string

JSON representation
{
  "metricName": string,
  "limitName": string,
  "dimensions": {
    string: string,
    ...
  },
  "limit": number,
  "futureLimit": number,
  "rolloutStatus": enum (RolloutStatus)
}
Fields
metricName

string

The Compute Engine quota metric name.

limitName

string

The name of the quota limit.

dimensions

map (key: string, value: string)

The map holding related quota dimensions.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

limit

number

Current effective quota limit. The limit's unit depends on the quota type or metric.

futureLimit

number

Future quota limit being rolled out. The limit's unit depends on the quota type or metric.

rolloutStatus

enum (RolloutStatus)

Rollout status of the future quota limit.

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

value

string

JSON representation
{
  "links": [
    {
      object (google.rpc.Help.Link)
    }
  ]
}
Fields
links[]

object (google.rpc.Help.Link)

URL(s) pointing to additional information on handling the current error.

JSON representation
{
  "description": string,
  "url": string
}
Fields
description

string

Describes what the link offers.

url

string

The URL of the link.

JSON representation
{
  "locale": string,
  "message": string
}
Fields
locale

string

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

message

string

The localized error message in the above locale.

JSON representation
{
  "machineType": string
}
Fields
machineType

string

Output only. The machine type to be used for this instance.

Tool Annotations

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