feat: poc - merge SVM operation in 1 tool#151
Closed
Hardikl wants to merge 3 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates SVM lifecycle actions into a single MCP tool (svm_operation) that performs create/update/delete based on an operation selector, replacing the previous three separate SVM tools.
Changes:
- Introduces a new unified tool input type (
tool.SVMOperation) plustool.SVMUpdatefor update-specific fields. - Replaces
CreateSVM/UpdateSVM/DeleteSVMhandlers with a singleApp.SVMOperationswitch-based handler. - Updates tool registration and descriptions to expose only
svm_operationfor SVM actions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tool/tool.go | Replaces separate SVM parameter structs with SVMOperation and SVMUpdate. |
| server/svm.go | Collapses create/update/delete logic into a single SVMOperation handler. |
| server/server.go | Registers the new svm_operation tool and adds an operationAnnotation. |
| descriptions/descriptions.go | Replaces three SVM tool descriptions with a single SVMOperation description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
149
to
+150
| // operation on SVM object | ||
| addTool(a, server, "create_svm", descriptions.CreateSVM, createAnnotation, a.CreateSVM) | ||
| addTool(a, server, "update_svm", descriptions.UpdateSVM, updateAnnotation, a.UpdateSVM) | ||
| addTool(a, server, "delete_svm", descriptions.DeleteSVM, deleteAnnotation, a.DeleteSVM) | ||
| addTool(a, server, "svm_operation", descriptions.SVMOperation, operationAnnotation, a.SVMOperation) |
| Name string `json:"svm_name" jsonschema:"SVM name"` | ||
| type SVMOperation struct { | ||
| Cluster string `json:"cluster_name" jsonschema:"cluster name"` | ||
| Operation string `json:"operation" jsonschema:"SVM operation type (e.g., create, update, delete)"` |
Comment on lines
+657
to
+659
| operationAnnotation = mcp.ToolAnnotations{ | ||
| DestructiveHint: new(true), | ||
| } |
Comment on lines
149
to
151
| // operation on SVM object | ||
| addTool(a, server, "create_svm", descriptions.CreateSVM, createAnnotation, a.CreateSVM) | ||
| addTool(a, server, "update_svm", descriptions.UpdateSVM, updateAnnotation, a.UpdateSVM) | ||
| addTool(a, server, "delete_svm", descriptions.DeleteSVM, deleteAnnotation, a.DeleteSVM) | ||
| addTool(a, server, "svm_operation", descriptions.SVMOperation, operationAnnotation, a.SVMOperation) | ||
| // operation on SVM peer object |
| const CreateSVM = `Create an SVM on a cluster by cluster name.` | ||
| const UpdateSVM = `Update an SVM on a cluster by cluster name.` | ||
| const DeleteSVM = `Delete an SVM on a cluster by cluster name.` | ||
| const SVMOperation = `Create, Update and Delete operations on SVM on a cluster by cluster name.` |
Contributor
Author
|
closing this PR as this #157 handles the same. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SVM existing CI tests haven't been modified for this.
I have printed the logs of
svm_testwith which tool used and what args map have been passed to the tool to better understand.Logs: