Skip to content

feat(gcloud-mcp): add get_gcloud_context tool #323

@arnaldo-delisio

Description

@arnaldo-delisio

Feature: Add get_gcloud_context tool

Problem

AI agents frequently need to know the current GCP context (active account, project, region, zone) before executing commands. Currently they must run multiple gcloud config get-value commands sequentially.

Solution

Add a get_gcloud_context tool that returns all context values in a single call by running the config queries in parallel.

Use Cases

  • Verify which project/account will be used before executing commands
  • Check environment at session start
  • Debug configuration issues

Implementation

  • Returns: account, project, region, zone, configuration name
  • Executes 5 gcloud config queries in parallel for performance
  • Handles unset values gracefully with helpful notes

Related to #168 (provide gcloud context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions