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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return type ('List of project IDs') but lacks critical details: whether it requires specific permissions, how it handles pagination or large result sets, if there are rate limits, or what happens on authentication failure. For a read operation with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences: one stating the purpose and one specifying the return value. It's front-loaded with the core functionality. There's no wasted text, though it could be slightly more structured (e.g., bullet points for returns).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, no output schema, no annotations), the description is moderately complete. It covers the basic purpose and return type, but lacks behavioral context (e.g., permissions, pagination) that would be helpful for an agent. Without annotations or output schema, the description should do more to explain how the tool behaves in practice.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so a baseline of 4 is appropriate. It correctly implies no inputs are required, aligning with the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('List') and resource ('GCP projects'), specifying 'all available' and 'for the authenticated user'. It distinguishes from siblings like 'get_gcp_project_details' (which gets details of a specific project) by focusing on listing all projects. However, it doesn't explicitly differentiate from other list tools (e.g., 'list_assets'), though the resource specificity helps.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication status), compare to similar tools like 'list_assets' or 'get_gcp_project_details', or specify use cases (e.g., project selection for operations). The agent must infer usage from the name and context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related 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