Skip to main content
Glama

list_gcp_projects

Retrieve all Google Cloud Platform projects available to the authenticated user, returning a list of project IDs for seamless resource management.

Instructions

List all available GCP projects for the authenticated user. Returns: List of project IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_gcp_projects' tool. It uses the Google Cloud ResourceManager API to search and return a list of project IDs accessible to the authenticated user. Includes error handling. Registered via @mcp.tool() decorator.
    @mcp.tool() def list_gcp_projects(): """ List all available GCP projects for the authenticated user. Returns: List of project IDs """ try: from google.cloud import resourcemanager_v3 client = resourcemanager_v3.ProjectsClient() request = resourcemanager_v3.SearchProjectsRequest() response = client.search_projects(request=request) return [project.project_id for project in response] except Exception as e: return [f"Error listing GCP projects: {str(e)}"]
  • Invocation of register_tools from the resource_management module, which defines and registers the list_gcp_projects tool using the MCP server instance.
    resource_tools.register_tools(mcp)
  • Import of the tools module from resource_management, which contains the list_gcp_projects implementation and registration logic.
    from .gcp_modules.resource_management import tools as resource_tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/henihaddad/gcp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server