Skip to main content
Glama

get_network_load_balancer

Retrieve detailed configuration and status information for a specific Oracle Cloud Infrastructure network load balancer, including backend sets and listeners, to monitor and manage traffic distribution.

Instructions

Get detailed information about a specific network load balancer.

Args:
    network_load_balancer_id: OCID of the network load balancer to retrieve

Returns:
    Detailed network load balancer information including backend sets and listeners

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
network_load_balancer_idYes

Implementation Reference

  • Core handler function that retrieves and formats network load balancer details from OCI API, including backend sets, listeners, IP addresses, and other configurations.
    def get_network_load_balancer(network_load_balancer_client: oci.network_load_balancer.NetworkLoadBalancerClient, 
                                   network_load_balancer_id: str) -> Dict[str, Any]:
        """
        Get details of a specific network load balancer.
        
        Args:
            network_load_balancer_client: OCI NetworkLoadBalancer client
            network_load_balancer_id: OCID of the network load balancer
            
        Returns:
            Details of the network load balancer
        """
        try:
            nlb = network_load_balancer_client.get_network_load_balancer(network_load_balancer_id).data
            
            # Format backend sets
            backend_sets = {}
            if nlb.backend_sets:
                for name, backend_set in nlb.backend_sets.items():
                    backend_sets[name] = {
                        "name": name,
                        "policy": backend_set.policy,
                        "is_preserve_source": backend_set.is_preserve_source,
                        "backends": [
                            {
                                "ip_address": backend.ip_address,
                                "port": backend.port,
                                "weight": backend.weight,
                                "target_id": backend.target_id,
                                "is_drain": backend.is_drain,
                                "is_backup": backend.is_backup,
                                "is_offline": backend.is_offline,
                            }
                            for backend in backend_set.backends
                        ] if backend_set.backends else [],
                        "health_checker": {
                            "protocol": backend_set.health_checker.protocol,
                            "port": backend_set.health_checker.port,
                            "url_path": backend_set.health_checker.url_path,
                            "return_code": backend_set.health_checker.return_code,
                            "retries": backend_set.health_checker.retries,
                            "timeout_in_millis": backend_set.health_checker.timeout_in_millis,
                            "interval_in_millis": backend_set.health_checker.interval_in_millis,
                            "request_data": backend_set.health_checker.request_data,
                            "response_data": backend_set.health_checker.response_data,
                        } if backend_set.health_checker else None,
                    }
            
            # Format listeners
            listeners = {}
            if nlb.listeners:
                for name, listener in nlb.listeners.items():
                    listeners[name] = {
                        "name": name,
                        "default_backend_set_name": listener.default_backend_set_name,
                        "port": listener.port,
                        "protocol": listener.protocol,
                        "ip_version": listener.ip_version,
                    }
            
            nlb_details = {
                "id": nlb.id,
                "display_name": nlb.display_name,
                "compartment_id": nlb.compartment_id,
                "lifecycle_state": nlb.lifecycle_state,
                "time_created": str(nlb.time_created),
                "is_private": nlb.is_private,
                "ip_addresses": [
                    {
                        "ip_address": ip.ip_address,
                        "is_public": ip.is_public,
                        "ip_version": ip.ip_version,
                    }
                    for ip in nlb.ip_addresses
                ] if nlb.ip_addresses else [],
                "subnet_id": nlb.subnet_id,
                "network_security_group_ids": nlb.network_security_group_ids,
                "is_preserve_source_destination": nlb.is_preserve_source_destination,
                "backend_sets": backend_sets,
                "listeners": listeners,
            }
            
            logger.info(f"Retrieved details for network load balancer {network_load_balancer_id}")
            return nlb_details
            
        except Exception as e:
            logger.exception(f"Error getting network load balancer details: {e}")
            raise
  • MCP tool registration decorator @mcp.tool(name='get_network_load_balancer') with wrapper for error handling and logging, delegating to the imported handler function.
    @mcp.tool(name="get_network_load_balancer")
    @mcp_tool_wrapper(
        start_msg="Getting network load balancer details for {network_load_balancer_id}...",
        success_msg="Retrieved network load balancer details successfully",
        error_prefix="Error getting network load balancer details"
    )
    async def mcp_get_network_load_balancer(ctx: Context, network_load_balancer_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific network load balancer.
    
        Args:
            network_load_balancer_id: OCID of the network load balancer to retrieve
    
        Returns:
            Detailed network load balancer information including backend sets and listeners
        """
        return get_network_load_balancer(oci_clients["network_load_balancer"], network_load_balancer_id)
  • Import statement bringing the get_network_load_balancer handler into the MCP server module for registration.
    from mcp_server_oci.tools.load_balancer import (
        list_load_balancers,
        get_load_balancer,
        list_network_load_balancers,
        get_network_load_balancer,
    )
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 it retrieves detailed information, implying a read-only operation, but doesn't cover authentication needs, rate limits, error conditions, or what 'detailed information' entails beyond backend sets and listeners. This leaves significant gaps for an agent to understand the tool's behavior.

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 concise, with a clear purpose statement followed by Args and Returns sections. Every sentence adds value without redundancy, making it easy to parse and front-loaded with essential information.

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 moderately complete. It covers the purpose and parameter semantics adequately but lacks behavioral details like error handling or authentication, and the return value description is vague ('detailed information including backend sets and listeners').

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: 'network_load_balancer_id: OCID of the network load balancer to retrieve.' This clarifies that the ID is an OCID (Oracle Cloud Identifier) and its purpose, compensating for the 0% schema description coverage. However, it doesn't provide format examples or validation rules.

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 network load balancer.' It specifies the verb ('Get') and resource ('network load balancer'), but doesn't explicitly differentiate it from sibling tools like 'get_load_balancer' or 'list_network_load_balancers' beyond the specificity of 'network' in the name.

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 'get_load_balancer' (which might be for classic load balancers) or 'list_network_load_balancers' (which lists multiple), nor does it specify prerequisites or exclusions for usage.

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