Skip to main content
Glama

get_vnic

Retrieve detailed information about a specific Virtual Network Interface Card (VNIC) in Oracle Cloud Infrastructure, including IP addresses, subnet details, and Network Security Group associations.

Instructions

Get detailed information about a specific VNIC.

Args:
    vnic_id: OCID of the VNIC to retrieve

Returns:
    Detailed VNIC information including IP addresses, subnet, and NSG associations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vnic_idYes

Implementation Reference

  • MCP tool handler for 'get_vnic': decorated with @mcp.tool and wrapper, calls the core get_vnic helper with OCI network client and vnic_id parameter.
    @mcp.tool(name="get_vnic")
    @mcp_tool_wrapper(
        start_msg="Getting VNIC details for {vnic_id}...",
        success_msg="Retrieved VNIC details successfully",
        error_prefix="Error getting VNIC details"
    )
    async def mcp_get_vnic(ctx: Context, vnic_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific VNIC.
    
        Args:
            vnic_id: OCID of the VNIC to retrieve
    
        Returns:
            Detailed VNIC information including IP addresses, subnet, and NSG associations
        """
        return get_vnic(oci_clients["network"], vnic_id)
  • Core helper function implementing the logic to retrieve VNIC details from OCI VirtualNetworkClient, formats the response including private/public IP, subnet, IPv6 if available, and handles errors.
    def get_vnic(network_client: oci.core.VirtualNetworkClient, vnic_id: str) -> Dict[str, Any]:
        """
        Get details of a specific VNIC.
        
        Args:
            network_client: OCI VirtualNetwork client
            vnic_id: OCID of the VNIC
            
        Returns:
            Details of the VNIC
        """
        try:
            # Get the VNIC details
            vnic = network_client.get_vnic(vnic_id).data
            
            # Format the VNIC details
            vnic_details = {
                "id": vnic.id,
                "display_name": vnic.display_name,
                "hostname_label": vnic.hostname_label,
                "is_primary": vnic.is_primary,
                "lifecycle_state": vnic.lifecycle_state,
                "mac_address": vnic.mac_address,
                "private_ip": vnic.private_ip,
                "public_ip": vnic.public_ip,
                "subnet_id": vnic.subnet_id,
                "time_created": str(vnic.time_created),
                "compartment_id": vnic.compartment_id,
            }
            
            # Add IPv6 addresses if available
            if hasattr(vnic, 'ipv6_addresses') and vnic.ipv6_addresses:
                vnic_details["ipv6_addresses"] = vnic.ipv6_addresses
            
            logger.info(f"Retrieved details for VNIC {vnic_id}")
            return vnic_details
            
        except Exception as e:
            logger.exception(f"Error getting VNIC details: {e}")
            raise
  • Registration of the 'get_vnic' tool using @mcp.tool decorator in the main MCP server file.
    @mcp.tool(name="get_vnic")
    @mcp_tool_wrapper(
        start_msg="Getting VNIC details for {vnic_id}...",
        success_msg="Retrieved VNIC details successfully",
        error_prefix="Error getting VNIC details"
    )
    async def mcp_get_vnic(ctx: Context, vnic_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific VNIC.
    
        Args:
            vnic_id: OCID of the VNIC to retrieve
    
        Returns:
            Detailed VNIC information including IP addresses, subnet, and NSG associations
        """
        return get_vnic(oci_clients["network"], vnic_id)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get detailed information'), which implies it's non-destructive, but doesn't mention authentication requirements, rate limits, error conditions, or what happens if the VNIC doesn't exist. The return statement adds some value but is incomplete.

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 perfectly structured and concise. It uses three clear sections (purpose, args, returns) with no wasted words. Every sentence earns its place by providing essential information in a well-organized format.

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 no annotations and no output schema, the description does a decent job but has gaps. It explains the parameter well and gives a high-level overview of return data, but doesn't provide complete behavioral context (authentication, errors) or detailed output structure. For a simple retrieval tool, it's adequate but not comprehensive.

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 provides excellent parameter semantics despite 0% schema description coverage. It clearly explains that 'vnic_id' is the 'OCID of the VNIC to retrieve,' adding crucial context about the parameter format and purpose that the schema lacks. For a single parameter tool, this is highly effective.

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 VNIC.' It uses a specific verb ('Get') and resource ('VNIC'), but doesn't explicitly differentiate from sibling tools like 'list_vnics' or other 'get_' tools. The purpose is clear but lacks sibling distinction.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools like 'list_vnics' for listing multiple VNICs or other 'get_' tools for different resources. There's no context about prerequisites or when this specific retrieval is appropriate.

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