Skip to main content
Glama

get_segment

Retrieve detailed configuration and status information for a specific network segment in VMware NSX environments to manage network infrastructure.

Instructions

Get detailed info for a specific network segment.

Args: segment_id: The segment ID (policy path name). target: Optional NSX Manager target name from config. Uses default if omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
segment_idYes
targetNo

Implementation Reference

  • The implementation of the get_segment tool logic, which retrieves segment details and their associated ports from the NSX Policy API.
    def get_segment(client: NsxClient, segment_id: str) -> dict:
        """Get segment details including ports."""
        seg = client.get(f"/policy/api/v1/infra/segments/{segment_id}")
        # Get ports on this segment
        ports = client.get_all(
            f"/policy/api/v1/infra/segments/{segment_id}/ports"
        )
        return {
            "id": _sanitize(seg.get("id", "")),
            "display_name": _sanitize(seg.get("display_name", "")),
            "type": seg.get("type", "ROUTED"),
            "admin_state": seg.get("admin_state", "UP"),
            "subnets": seg.get("subnets", []),
            "transport_zone_path": _sanitize(seg.get("transport_zone_path", "")),
            "connectivity_path": _sanitize(seg.get("connectivity_path", "")),
            "vlan_ids": seg.get("vlan_ids", []),
            "port_count": len(ports),
            "ports": [
                {
                    "id": _sanitize(p.get("id", "")),
                    "display_name": _sanitize(p.get("display_name", "")),
                    "attachment": p.get("attachment", {}),
                }
                for p in ports[:50]  # Limit to 50 ports
            ],
        }

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/zw008/VMware-NSX'

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