Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

list_subnets

Retrieve subnets/VLANs configured in Prism Central including names, VLAN IDs, CIDRs, IP pools, and associated clusters. Supports filtering by name or VLAN ID and limiting results.

Instructions

List subnets/VLANs configured in Prism Central. Returns subnet names, VLAN IDs, CIDRs, IP pools, and associated clusters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOData filter expression. Examples: "name eq 'production-vlan'", "vlanId eq 100"
limitNoMaximum number of subnets to return. Omit to retrieve all (auto-paginates).

Implementation Reference

  • Handler for list_subnets - calls v4 networking API config/subnets endpoint with optional filter/limit, auto-paginates, returns formatted subnet list
    async def handle_list_subnets(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """List subnets using v4 networking API."""
        filter_expr = arguments.get("filter")
        limit = arguments.get("limit")
    
        result = await client.v4_list_all(
            namespace="networking",
            path="config/subnets",
            filter=filter_expr,
            max_results=limit,
        )
    
        subnets = result.get("data", [])
        metadata = result.get("metadata", {})
        return {
            "count": len(subnets),
            "truncated": metadata.get("truncated", False),
            "subnets": [
                {
                    "name": s.get("name"),
                    "extId": s.get("extId"),
                    "subnetType": s.get("subnetType"),
                    "vlanId": s.get("networkId"),
                    "cidr": _extract_cidr(s),
                    "cluster": s.get("clusterReference"),
                }
                for s in subnets
            ],
        }
  • Schema definition for list_subnets tool - defines optional 'filter' (string) and 'limit' (integer) input parameters
    {
        "name": "list_subnets",
        "description": (
            "List subnets/VLANs configured in Prism Central. Returns subnet names, "
            "VLAN IDs, CIDRs, IP pools, and associated clusters."
        ),
        "inputSchema": {
            "type": "object",
            "properties": {
                "filter": {
                    "type": "string",
                    "description": (
                        "OData filter expression. Examples: "
                        "\"name eq 'production-vlan'\", \"vlanId eq 100\""
                    ),
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of subnets to return. Omit to retrieve all (auto-paginates).",
                },
            },
        },
    },
  • Helper function used by handle_list_subnets to extract CIDR notation from subnet IP configuration
    def _extract_cidr(subnet: dict) -> str | None:
        """Extract CIDR from subnet IP config."""
        ip_config = subnet.get("ipConfig")
        if not ip_config:
            return None
        # ipConfig can be a list of configs or a single dict
        if isinstance(ip_config, list):
            ip_config = ip_config[0] if ip_config else None
        if not ip_config or not isinstance(ip_config, dict):
            return None
        ipv4 = ip_config.get("ipv4", {})
        if not ipv4:
            return None
        ip_subnet = ipv4.get("ipSubnet", {})
        if not ip_subnet:
            return None
        ip = ip_subnet.get("ip", {}).get("value")
        prefix = ip_subnet.get("prefixLength")
        if ip and prefix:
            return f"{ip}/{prefix}"
        return None
  • Handler dispatch mapping - maps 'list_subnets' string to handle_list_subnets function
    NETWORKING_HANDLERS: dict[str, Any] = {
        "list_subnets": handle_list_subnets,
        "get_subnet": handle_get_subnet,
        "list_images": handle_list_images,
        "get_image": handle_get_image,
        "list_categories": handle_list_categories,
        "get_category": handle_get_category,
    }
  • Merges NETWORKING_HANDLERS into ALL_HANDLERS for tool dispatch in the MCP server's call_tool handler
    # Merge all handler dispatch tables
    ALL_HANDLERS: dict[str, Any] = {
        **VM_HANDLERS,
        **CLUSTER_HANDLERS,
        **PE_HANDLERS,
        **REPORT_HANDLERS,
        **NETWORKING_HANDLERS,
    }
Behavior2/5

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

No annotations provided; description only states return values but omits behavioral details such as pagination, auth requirements, or rate limits.

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?

Single sentence efficiently conveys purpose and output, with no redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lists return fields adequately for a read-only operation, but lacks mention of error conditions or performance characteristics.

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?

Input schema already has 100% description coverage for both parameters, so description adds marginal value beyond stating return fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description explicitly states the tool lists subnets/VLANs in Prism Central and enumerates return fields, distinguishing it from sibling tools like get_subnet.

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 on when to use this tool vs alternatives, or when to apply filter vs no filter.

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/jkmills/nutanix-mcp-server'

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