Skip to main content

At a glance

  • Availability: Experimental (how to enable).
  • Auth: OAuth 2.0.
  • Connection: A user authorizes the connection in the provider’s consent screen.
  • Scopes: https://www.googleapis.com/auth/compute.readonly, https://www.googleapis.com/auth/run.readonly.
  • Optional scopes: https://www.googleapis.com/auth/cloud-platform.
  • Docs: https://cloud.google.com/docs/authentication

Credentials

Set these per environment. See Connect an integration. With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.
VariableRequiredDescription
GOOGLE_CLIENT_IDYesGoogle OAuth Client ID Docs.
GOOGLE_CLIENT_SECRETYesGoogle OAuth Client Secret Docs.

Setup

  1. Create or select a Google Cloud project: Go to https://console.cloud.google.com and create a project (new Google Cloud accounts include free-tier credit, and Compute Engine offers an always-free e2-micro instance in some US regions for testing).
  2. Enable the required APIs: Enable the Compute Engine API (https://console.cloud.google.com/apis/library/compute.googleapis.com), the Cloud Run Admin API (https://console.cloud.google.com/apis/library/run.googleapis.com), and the Cloud Functions API (https://console.cloud.google.com/apis/library/cloudfunctions.googleapis.com) for your project.
  3. Create OAuth credentials: In https://console.cloud.google.com/apis/credentials create an OAuth 2.0 Client ID (Web application) and add your callback URL as an authorized redirect URI. Store the values as GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.
  4. Create test resources: Create a small VM instance (e2-micro) in Compute Engine and deploy a sample Cloud Run service so the list tools have something to return. Stop the VM when done to avoid charges.
  • The default scopes are read-only (compute.readonly and run.readonly) and cover listing Compute Engine instances and Cloud Run services; listing Cloud Functions and starting or stopping VM instances require granting the optional cloud-platform scope during authorization.
  • The signed-in user also needs IAM permissions on the project: roles/viewer covers the list tools, and roles/compute.instanceAdmin.v1 (or broader) is needed to start and stop instances.
  • Start and stop return a zone operation immediately; the instance state changes asynchronously, so re-run List Compute Instances to confirm.
  • Use ’-’ as the location to list Cloud Functions across all locations in one call (unreachable regions are reported in the ‘unreachable’ field); Cloud Run does not support the ’-’ wildcard, so list its services one region at a time.
  • The Cloud Functions v2 API also returns 1st-gen functions, with the generation indicated by the ‘environment’ field.
Provider API reference: https://cloud.google.com/compute/docs/reference/rest/v1

Tools

ToolAccessDescription
List Compute InstancesReadList Compute Engine VM instances in a specific zone of a project
List All Compute InstancesReadList Compute Engine VM instances across all zones of a project (aggregated list), useful when you don’t know which zones are in use
Get Compute InstanceReadGet one Compute Engine VM instance’s details - machine type, status, IPs, and disks - e.g. to confirm a start or stop completed
List ZonesReadList the Compute Engine zones available in a project, so agents can discover valid zone names for the zone-scoped tools
Start Compute InstanceWriteStart a stopped Compute Engine VM instance (returns a zone operation that completes asynchronously) - requires the full cloud-platform scope
Stop Compute InstanceWriteStop a running Compute Engine VM instance so it stops incurring compute charges (returns a zone operation that completes asynchronously) - requires the full cloud-platform scope
List Cloud Run ServicesReadList Cloud Run services in a project location (region)
Get Cloud Run ServiceReadGet one Cloud Run service’s details - URL, container image, environment, and traffic split
List Cloud FunctionsReadList Cloud Functions (2nd gen API) in a project location - requires the optional cloud-platform scope (the only scope the Cloud Functions API accepts)

Example prompts

  • List my Compute Engine instances across all zones and summarize their machine types and power states.
  • List my Cloud Run services and Cloud Functions in a region and summarize what is deployed.
  • Find running Compute Engine instances and help me stop one that looks idle so it stops incurring charges.