list_images
List disk images from the image library, including ISOs and QCOW2 files, with details on name, type, size, and source URI.
Instructions
List disk images (ISOs, QCOW2) available in the image library. Returns image names, types, sizes, and source URIs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | OData filter expression. Examples: "name eq 'ubuntu-22.04'", "type eq 'DISK_IMAGE'" | |
| limit | No | Maximum number of images to return. Omit to retrieve all (auto-paginates). |
Implementation Reference
- The async handler function that executes the list_images tool logic. Calls client.v4_list_all with namespace='vmm' and path='content/images', then maps the response to image names, extIds, types, sizes, source URIs, and descriptions.
async def handle_list_images( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """List images using v4 vmm API.""" filter_expr = arguments.get("filter") limit = arguments.get("limit") result = await client.v4_list_all( namespace="vmm", path="content/images", filter=filter_expr, max_results=limit, ) images = result.get("data", []) metadata = result.get("metadata", {}) return { "count": len(images), "truncated": metadata.get("truncated", False), "images": [ { "name": img.get("name"), "extId": img.get("extId"), "type": img.get("type"), "sizeBytes": img.get("sizeBytes"), "sourceUri": img.get("source", {}).get("url") if img.get("source") else None, "description": img.get("description"), } for img in images ], } - The tool definition/schema for list_images, declaring the name, description, and inputSchema with optional 'filter' (string) and 'limit' (integer) parameters.
{ "name": "list_images", "description": ( "List disk images (ISOs, QCOW2) available in the image library. " "Returns image names, types, sizes, and source URIs." ), "inputSchema": { "type": "object", "properties": { "filter": { "type": "string", "description": ( "OData filter expression. Examples: " "\"name eq 'ubuntu-22.04'\", \"type eq 'DISK_IMAGE'\"" ), }, "limit": { "type": "integer", "description": "Maximum number of images to return. Omit to retrieve all (auto-paginates).", }, }, }, }, - src/nutanix_mcp/tools/networking.py:292-295 (registration)The handler dispatch dictionary NETWORKING_HANDLERS mapping the string 'list_images' to the handle_list_images function.
NETWORKING_HANDLERS: dict[str, Any] = { "list_subnets": handle_list_subnets, "get_subnet": handle_get_subnet, "list_images": handle_list_images, - src/nutanix_mcp/server.py:34-41 (registration)The ALL_HANDLERS registry merging all handler dispatch tables, including NETWORKING_HANDLERS which contains list_images.
# Merge all handler dispatch tables ALL_HANDLERS: dict[str, Any] = { **VM_HANDLERS, **CLUSTER_HANDLERS, **PE_HANDLERS, **REPORT_HANDLERS, **NETWORKING_HANDLERS, } - The get_all_tools() function aggregates all tool definitions including NETWORKING_TOOLS (which contains list_images) for registration with the MCP server.
def get_all_tools() -> list[dict]: """Return all registered tool definitions.""" return VM_TOOLS + CLUSTER_TOOLS + PE_TOOLS + REPORT_TOOLS + NETWORKING_TOOLS