Skip to main content
Glama

get_vcn

Retrieve detailed information about a specific Oracle Cloud Infrastructure Virtual Cloud Network (VCN), including CIDR blocks, DNS configuration, and default resources by providing its OCID.

Instructions

Get detailed information about a specific VCN.

Args:
    vcn_id: OCID of the VCN to retrieve

Returns:
    Detailed VCN information including CIDR blocks, DNS configuration, and default resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vcn_idYes

Implementation Reference

  • Core handler function that executes the tool logic: retrieves VCN details from OCI API and formats the response.
    def get_vcn(network_client: oci.core.VirtualNetworkClient, vcn_id: str) -> Dict[str, Any]:
        """
        Get details of a specific VCN.
        
        Args:
            network_client: OCI VirtualNetwork client
            vcn_id: OCID of the VCN
            
        Returns:
            Details of the VCN
        """
        try:
            # Get the VCN details
            vcn = network_client.get_vcn(vcn_id).data
            
            # Format the VCN details
            vcn_details = {
                "id": vcn.id,
                "name": vcn.display_name,
                "lifecycle_state": vcn.lifecycle_state,
                "cidr_block": vcn.cidr_block,
                "time_created": str(vcn.time_created),
                "compartment_id": vcn.compartment_id,
                "dns_label": vcn.dns_label,
                "default_dhcp_options_id": vcn.default_dhcp_options_id,
                "default_route_table_id": vcn.default_route_table_id,
                "default_security_list_id": vcn.default_security_list_id,
            }
            
            # Add IPv6 CIDR blocks if available
            if hasattr(vcn, 'ipv6_cidr_blocks') and vcn.ipv6_cidr_blocks:
                vcn_details["ipv6_cidr_blocks"] = vcn.ipv6_cidr_blocks
            
            logger.info(f"Retrieved details for VCN {vcn_id}")
            return vcn_details
            
        except Exception as e:
            logger.exception(f"Error getting VCN details: {e}")
            raise
  • MCP tool registration for 'get_vcn' tool, including wrapper with error handling that delegates to the core handler.
    @mcp.tool(name="get_vcn")
    @mcp_tool_wrapper(
        start_msg="Getting VCN details for {vcn_id}...",
        success_msg="Retrieved VCN details successfully",
        error_prefix="Error getting VCN details"
    )
    async def mcp_get_vcn(ctx: Context, vcn_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific VCN.
    
        Args:
            vcn_id: OCID of the VCN to retrieve
    
        Returns:
            Detailed VCN information including CIDR blocks, DNS configuration, and default resources
        """
        return get_vcn(oci_clients["network"], vcn_id)
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 states the tool retrieves information (implying a read operation) and mentions the return content, but doesn't cover critical aspects like authentication requirements, error handling, rate limits, or whether it's idempotent. For a read tool with zero annotation coverage, this is insufficient.

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

Conciseness5/5

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

The description is well-structured and front-loaded: the first sentence states the purpose, followed by clear 'Args' and 'Returns' sections. Every sentence earns its place by providing essential information without redundancy. It's appropriately sized for a simple retrieval tool.

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 (single parameter, no output schema, no annotations), the description is adequate but has gaps. It covers the basic purpose and parameter semantics but lacks usage guidelines and behavioral details (e.g., auth, errors). Without an output schema, the 'Returns' section is helpful but not exhaustive.

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 description adds meaningful context for the single parameter: it explains that 'vcn_id' is the 'OCID of the VCN to retrieve,' which clarifies the parameter's purpose and format (OCID). Since schema description coverage is 0%, this compensates well, though it doesn't detail OCID structure or validation rules. With only one parameter, the baseline is high.

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: 'Get detailed information about a specific VCN.' It specifies the verb ('Get') and resource ('VCN'), and distinguishes it from sibling tools like 'list_vcns' by focusing on a single VCN rather than listing multiple. However, it doesn't explicitly differentiate from other 'get_' tools (e.g., 'get_subnet'), so it's not a perfect 5.

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 sibling tools like 'list_vcns' for listing all VCNs or other 'get_' tools for different resources. There's no context about prerequisites (e.g., needing the VCN ID) or exclusions, leaving the agent to infer usage from the tool name 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

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/jopsis/mcp-server-oci'

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