Skip to main content
Glama

get_security_list

Retrieve detailed security list information from Oracle Cloud Infrastructure, including all ingress and egress rules, to manage network security configurations.

Instructions

Get detailed information about a specific security list.

Args:
    security_list_id: OCID of the security list to retrieve

Returns:
    Detailed security list with all ingress and egress rules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
security_list_idYes

Implementation Reference

  • Core handler function that fetches OCI security list details using VirtualNetworkClient and formats ingress/egress rules into a dictionary.
    def get_security_list(network_client: oci.core.VirtualNetworkClient, security_list_id: str) -> Dict[str, Any]:
        """
        Get details of a specific security list.
        
        Args:
            network_client: OCI VirtualNetwork client
            security_list_id: OCID of the security list
            
        Returns:
            Details of the security list
        """
        try:
            security_list = network_client.get_security_list(security_list_id).data
            
            # Format ingress rules
            ingress_rules = []
            if security_list.ingress_security_rules:
                for rule in security_list.ingress_security_rules:
                    ingress_rules.append({
                        "protocol": rule.protocol,
                        "source": rule.source,
                        "source_type": rule.source_type,
                        "is_stateless": rule.is_stateless,
                        "description": rule.description,
                        "tcp_options": {
                            "destination_port_range": {
                                "min": rule.tcp_options.destination_port_range.min if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                                "max": rule.tcp_options.destination_port_range.max if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                            } if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                            "source_port_range": {
                                "min": rule.tcp_options.source_port_range.min if rule.tcp_options and rule.tcp_options.source_port_range else None,
                                "max": rule.tcp_options.source_port_range.max if rule.tcp_options and rule.tcp_options.source_port_range else None,
                            } if rule.tcp_options and rule.tcp_options.source_port_range else None,
                        } if rule.tcp_options else None,
                        "udp_options": {
                            "destination_port_range": {
                                "min": rule.udp_options.destination_port_range.min if rule.udp_options and rule.udp_options.destination_port_range else None,
                                "max": rule.udp_options.destination_port_range.max if rule.udp_options and rule.udp_options.destination_port_range else None,
                            } if rule.udp_options and rule.udp_options.destination_port_range else None,
                            "source_port_range": {
                                "min": rule.udp_options.source_port_range.min if rule.udp_options and rule.udp_options.source_port_range else None,
                                "max": rule.udp_options.source_port_range.max if rule.udp_options and rule.udp_options.source_port_range else None,
                            } if rule.udp_options and rule.udp_options.source_port_range else None,
                        } if rule.udp_options else None,
                        "icmp_options": {
                            "type": rule.icmp_options.type if rule.icmp_options else None,
                            "code": rule.icmp_options.code if rule.icmp_options else None,
                        } if rule.icmp_options else None,
                    })
            
            # Format egress rules
            egress_rules = []
            if security_list.egress_security_rules:
                for rule in security_list.egress_security_rules:
                    egress_rules.append({
                        "protocol": rule.protocol,
                        "destination": rule.destination,
                        "destination_type": rule.destination_type,
                        "is_stateless": rule.is_stateless,
                        "description": rule.description,
                        "tcp_options": {
                            "destination_port_range": {
                                "min": rule.tcp_options.destination_port_range.min if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                                "max": rule.tcp_options.destination_port_range.max if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                            } if rule.tcp_options and rule.tcp_options.destination_port_range else None,
                            "source_port_range": {
                                "min": rule.tcp_options.source_port_range.min if rule.tcp_options and rule.tcp_options.source_port_range else None,
                                "max": rule.tcp_options.source_port_range.max if rule.tcp_options and rule.tcp_options.source_port_range else None,
                            } if rule.tcp_options and rule.tcp_options.source_port_range else None,
                        } if rule.tcp_options else None,
                        "udp_options": {
                            "destination_port_range": {
                                "min": rule.udp_options.destination_port_range.min if rule.udp_options and rule.udp_options.destination_port_range else None,
                                "max": rule.udp_options.destination_port_range.max if rule.udp_options and rule.udp_options.destination_port_range else None,
                            } if rule.udp_options and rule.udp_options.destination_port_range else None,
                            "source_port_range": {
                                "min": rule.udp_options.source_port_range.min if rule.udp_options and rule.udp_options.source_port_range else None,
                                "max": rule.udp_options.source_port_range.max if rule.udp_options and rule.udp_options.source_port_range else None,
                            } if rule.udp_options and rule.udp_options.source_port_range else None,
                        } if rule.udp_options else None,
                        "icmp_options": {
                            "type": rule.icmp_options.type if rule.icmp_options else None,
                            "code": rule.icmp_options.code if rule.icmp_options else None,
                        } if rule.icmp_options else None,
                    })
            
            security_list_details = {
                "id": security_list.id,
                "display_name": security_list.display_name,
                "compartment_id": security_list.compartment_id,
                "vcn_id": security_list.vcn_id,
                "lifecycle_state": security_list.lifecycle_state,
                "time_created": str(security_list.time_created),
                "ingress_security_rules": ingress_rules,
                "egress_security_rules": egress_rules,
            }
            
            logger.info(f"Retrieved details for security list {security_list_id}")
            return security_list_details
            
        except Exception as e:
            logger.exception(f"Error getting security list details: {e}")
            raise
  • MCP tool registration with @mcp.tool(name='get_security_list') decorator. The wrapper function mcp_get_security_list calls the core handler with the network client.
    @mcp.tool(name="get_security_list")
    @mcp_tool_wrapper(
        start_msg="Getting security list details for {security_list_id}...",
        success_msg="Retrieved security list details successfully",
        error_prefix="Error getting security list details"
    )
    async def mcp_get_security_list(ctx: Context, security_list_id: str) -> Dict[str, Any]:
        """
        Get detailed information about a specific security list.
    
        Args:
            security_list_id: OCID of the security list to retrieve
    
        Returns:
            Detailed security list with all ingress and egress rules
        """
        return get_security_list(oci_clients["network"], security_list_id)
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 detailed information, implying a read-only operation, but doesn't clarify permissions needed, rate limits, error conditions, or whether it's idempotent. For a tool with zero annotation coverage, this leaves significant gaps in understanding its 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 front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place: the first states what the tool does, the second explains the parameter, and the third describes the return value. There's no wasted text.

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 (one parameter, no nested objects) and lack of annotations or output schema, the description is minimally complete. It covers the basic purpose, parameter, and return value, but doesn't address behavioral aspects like authentication, errors, or performance. For a simple read operation, this might be adequate, but it leaves room for improvement in transparency.

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?

The description adds minimal parameter semantics beyond the schema. It explains that 'security_list_id' is the 'OCID of the security list to retrieve,' which clarifies the parameter's purpose and format (OCID). However, with 0% schema description coverage and only one parameter, this provides some value but doesn't fully compensate for the lack of schema documentation. The baseline for 0 parameters would be 4, but here there's one parameter with partial explanation.

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 security list.' It specifies the verb ('Get') and resource ('security list'), and distinguishes it from sibling 'list_security_lists' by focusing on a single item. However, it doesn't explicitly differentiate from other 'get_' tools 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?

No guidance is provided on when to use this tool versus alternatives. While the description implies it's for retrieving a specific security list by ID, it doesn't mention sibling tools like 'list_security_lists' for browsing or other 'get_' tools for different resources. There's no context about prerequisites or when-not-to-use scenarios.

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