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.Setup
- 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).
- 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.
- 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.
- 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.
Tools
| Tool | Access | Description |
|---|---|---|
| List Compute Instances | Read | List Compute Engine VM instances in a specific zone of a project |
| List All Compute Instances | Read | List 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 Instance | Read | Get one Compute Engine VM instance’s details - machine type, status, IPs, and disks - e.g. to confirm a start or stop completed |
| List Zones | Read | List the Compute Engine zones available in a project, so agents can discover valid zone names for the zone-scoped tools |
| Start Compute Instance | Write | Start a stopped Compute Engine VM instance (returns a zone operation that completes asynchronously) - requires the full cloud-platform scope |
| Stop Compute Instance | Write | Stop 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 Services | Read | List Cloud Run services in a project location (region) |
| Get Cloud Run Service | Read | Get one Cloud Run service’s details - URL, container image, environment, and traffic split |
| List Cloud Functions | Read | List 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.