Skip to main content
Glama

get_vpc_details

Retrieve detailed information about a specific VPC network in Google Cloud Platform by providing the project ID and network name. Ideal for managing and monitoring network configurations.

Instructions

    Get detailed information about a specific VPC network.
    
    Args:
        project_id: The ID of the GCP project
        network_name: The name of the VPC network
    
    Returns:
        Detailed information about the specified VPC network
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
network_nameYes
project_idYes

Implementation Reference

  • The handler function for the 'get_vpc_details' MCP tool. It retrieves detailed information about a specific VPC network, including subnets and peerings, using the Google Cloud Compute API.
        @mcp.tool()
        def get_vpc_details(project_id: str, network_name: str) -> str:
            """
            Get detailed information about a specific VPC network.
            
            Args:
                project_id: The ID of the GCP project
                network_name: The name of the VPC network
            
            Returns:
                Detailed information about the specified VPC network
            """
            try:
                from google.cloud import compute_v1
                
                # Initialize the Compute Engine client for networks
                network_client = compute_v1.NetworksClient()
                subnet_client = compute_v1.SubnetworksClient()
                
                # Get network details
                network = network_client.get(project=project_id, network=network_name)
                
                # Format the response
                details = []
                details.append(f"Name: {network.name}")
                details.append(f"ID: {network.id}")
                details.append(f"Description: {network.description or 'None'}")
                details.append(f"Self Link: {network.self_link}")
                details.append(f"Creation Time: {network.creation_timestamp}")
                details.append(f"Subnet Mode: {'Auto' if network.auto_create_subnetworks else 'Custom'}")
                details.append(f"Routing Mode: {network.routing_config.routing_mode if network.routing_config else 'Unknown'}")
                details.append(f"MTU: {network.mtu}")
                
                # If it's a custom subnet mode network, get all subnets
                if not network.auto_create_subnetworks:
                    # List all subnets in this network
                    request = compute_v1.ListSubnetworksRequest(project=project_id)
                    subnets = []
                    
                    for item in subnet_client.list(request=request):
                        # Check if the subnet belongs to this network
                        if network.name in item.network:
                            cidr = item.ip_cidr_range
                            region = item.region.split('/')[-1]
                            purpose = f", Purpose: {item.purpose}" if item.purpose else ""
                            private_ip = ", Private Google Access: Enabled" if item.private_ip_google_access else ""
                            subnets.append(f"  - {item.name} (Region: {region}, CIDR: {cidr}{purpose}{private_ip})")
                    
                    if subnets:
                        details.append(f"Subnets ({len(subnets)}):\n" + "\n".join(subnets))
                
                # List peering connections if any
                if network.peerings:
                    peerings = []
                    for peering in network.peerings:
                        state = peering.state
                        network_name = peering.network.split('/')[-1]
                        peerings.append(f"  - {network_name} (State: {state})")
                    
                    if peerings:
                        details.append(f"Peerings ({len(peerings)}):\n" + "\n".join(peerings))
                
                details_str = "\n".join(details)
                
                return f"""
    VPC Network Details:
    {details_str}
    """
            except Exception as e:
                return f"Error getting VPC network details: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information (implying read-only), but doesn't specify permissions needed, rate limits, error conditions, or what 'detailed information' includes (e.g., subnets, routes, peerings). For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 well-structured with a clear purpose statement followed by Args and Returns sections. It's appropriately sized with no redundant information. However, the 'Returns' section is vague ('Detailed information about the specified VPC network') and could be more specific without adding excessive length.

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

Completeness2/5

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

Given the complexity of VPC networks and the lack of both annotations and output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, potential authentication requirements, error handling, or how it differs from related tools. For a tool that likely returns complex network data, more context is needed to use it effectively.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantics by explaining 'project_id' as 'The ID of the GCP project' and 'network_name' as 'The name of the VPC network', which clarifies what each parameter represents. However, it doesn't provide format examples, constraints, or how to find valid values, leaving room for ambiguity.

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 ('Get') and resource ('detailed information about a specific VPC network'). It distinguishes from sibling tools like 'list_vpc_networks' by focusing on a single VPC rather than listing multiple. However, it doesn't explicitly mention how it differs from other 'get_*_details' tools like 'get_instance_details' or 'get_bucket_details' beyond the resource type.

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 when to use 'get_vpc_details' instead of 'list_vpc_networks' for overviews, or how it relates to other 'get_*_details' tools. There's also no information about prerequisites, such as authentication or project access requirements.

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