Skip to main content
Glama

mcp-nutanix

image.go1.8 kB
package tools import ( "context" "github.com/thunderboltsid/mcp-nutanix/internal/client" "github.com/thunderboltsid/mcp-nutanix/pkg/resources" "github.com/mark3labs/mcp-go/mcp" "github.com/mark3labs/mcp-go/server" ) // Image defines the Image tool func ImageList() mcp.Tool { return mcp.NewTool("image_list", mcp.WithDescription("List image resources"), mcp.WithString("filter", mcp.Description("Optional text filter (interpreted by LLM)"), ), ) } // ImageListHandler implements the handler for the Image list tool func ImageListHandler() server.ToolHandlerFunc { return CreateListToolHandler( resources.ResourceTypeImage, // Define the ListResourceFunc implementation func(ctx context.Context, client *client.NutanixClient, filter string) (interface{}, error) { // Use ListAll function to get all resources return client.V3().ListAllImage(ctx, "") }, ) } // ImageCount defines the Image count tool func ImageCount() mcp.Tool { return mcp.NewTool("image_count", mcp.WithDescription("Count image resources"), mcp.WithString("filter", mcp.Description("Optional text filter (interpreted by LLM)"), ), ) } // ImageCountHandler implements the handler for the Image count tool func ImageCountHandler() server.ToolHandlerFunc { return CreateCountToolHandler( resources.ResourceTypeImage, // Define the ListResourceFunc implementation func(ctx context.Context, client *client.NutanixClient, filter string) (interface{}, error) { // Use ListAll function to get all resources resp, err := client.V3().ListAllImage(ctx, "") if err != nil { return nil, err } res := map[string]interface{}{ "resource_type": "Image", "count": len(resp.Entities), "metadata": resp.Metadata, } return res, nil }, ) }

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

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