Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

list_categories

List category keys and values for resource tagging to enable policy-based management like Flow and disaster recovery.

Instructions

List category keys and their values used for resource tagging. Categories enable policy-based management (Flow, DR, etc.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoOData filter expression. Example: "key eq 'Environment'"
limitNoMaximum number of categories to return. Omit to retrieve all (auto-paginates).

Implementation Reference

  • The async handler function that executes the list_categories tool logic. Uses v4 prism API to list categories with optional filter and limit, returning structured category data.
    async def handle_list_categories(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """List categories using v4 prism API."""
        filter_expr = arguments.get("filter")
        limit = arguments.get("limit")
    
        result = await client.v4_list_all(
            namespace="prism",
            path="config/categories",
            filter=filter_expr,
            max_results=limit,
        )
    
        categories = result.get("data", [])
        metadata = result.get("metadata", {})
        return {
            "count": len(categories),
            "truncated": metadata.get("truncated", False),
            "categories": [
                {
                    "key": cat.get("key"),
                    "extId": cat.get("extId"),
                    "value": cat.get("value"),
                    "description": cat.get("description"),
                    "type": cat.get("type"),
                }
                for cat in categories
            ],
        }
  • The tool definition (name, description, inputSchema) for list_categories, defining 'filter' (string) and 'limit' (integer) as optional input parameters.
    {
        "name": "list_categories",
        "description": (
            "List category keys and their values used for resource tagging. "
            "Categories enable policy-based management (Flow, DR, etc.)."
        ),
        "inputSchema": {
            "type": "object",
            "properties": {
                "filter": {
                    "type": "string",
                    "description": "OData filter expression. Example: \"key eq 'Environment'\"",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of categories to return. Omit to retrieve all (auto-paginates).",
                },
            },
        },
    },
  • The NETWORKING_HANDLERS dispatch table mapping 'list_categories' to handle_list_categories, which gets merged into ALL_HANDLERS in server.py.
    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,
    }
  • ALL_HANDLERS merges all handler dispatch tables including NETWORKING_HANDLERS, and the call_tool handler dispatches to the function by name.
    # Merge all handler dispatch tables
    ALL_HANDLERS: dict[str, Any] = {
        **VM_HANDLERS,
        **CLUSTER_HANDLERS,
        **PE_HANDLERS,
        **REPORT_HANDLERS,
        **NETWORKING_HANDLERS,
    }
  • get_all_tools() aggregates tool definitions from all modules including NETWORKING_TOOLS which contains the list_categories schema.
    def get_all_tools() -> list[dict]:
        """Return all registered tool definitions."""
        return VM_TOOLS + CLUSTER_TOOLS + PE_TOOLS + REPORT_TOOLS + NETWORKING_TOOLS
Behavior3/5

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

No annotations exist, so the description carries the burden. It mentions listing keys and values and policy context but omits behavioral details like pagination, performance, or that it is a read-only operation. The auto-pagination hint in the schema is not reiterated.

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?

Two concise sentences: the first states the primary function, the second adds context. No wasted words, and the most critical information is front-loaded.

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?

Given no output schema, no annotations, and two simple parameters, the description is mostly complete. It could hint at the return format (list of key-value pairs) but is sufficient for a basic list operation. The context about policy management adds useful background.

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?

Schema description coverage is 100%, so baseline is 3. The description does not add new meaning beyond the schema; it only clarifies the overall result (keys and values) but does not elaborate on how parameters affect output or provide examples beyond the schema's OData filter example.

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?

The description clearly states the tool lists category keys and values used for resource tagging, and explains their role in policy-based management. It distinguishes well from siblings like get_category (singular retrieval) and other list_ tools that deal with different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives like get_category. While the purpose is clear, an explicit usage note (e.g., 'Use for overview of all categories; use get_category for a specific one') would improve the score.

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