Skip to content

feat: poc - merge SVM operation in 1 tool#151

Closed
Hardikl wants to merge 3 commits into
mainfrom
hl_svm_merge
Closed

feat: poc - merge SVM operation in 1 tool#151
Hardikl wants to merge 3 commits into
mainfrom
hl_svm_merge

Conversation

@Hardikl

@Hardikl Hardikl commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

SVM existing CI tests haven't been modified for this.
I have printed the logs of svm_test with which tool used and what args map have been passed to the tool to better understand.

Logs:

=== RUN   TestSVM
=== RUN   TestSVM/Clean_SVM
2026/06/15 13:19:43 INFO  "Calling tool"=svm_operation args="map[cluster_name:umeng-aff300-05-06 svm_name:marketing_1781509778 type_operation:delete]"
=== RUN   TestSVM/Create_SVM
2026/06/15 13:19:49 INFO  "Calling tool"=svm_operation args="map[cluster_name:umeng-aff300-05-06 svm_name:marketing_1781509778 type_operation:create]"
=== RUN   TestSVM/Rename_SVM
2026/06/15 13:20:06 INFO  "Calling tool"=svm_operation args="map[cluster_name:umeng-aff300-05-06 svm_name:marketing_1781509778 svm_update:map[new_name:marketingNew_1781509778] type_operation:update]"
=== RUN   TestSVM/Update_SVM
2026/06/15 13:20:17 INFO  "Calling tool"=svm_operation args="map[cluster_name:umeng-aff300-05-06 svm_name:marketingNew_1781509778 svm_update:map[comment:stop_svm state:stopped] type_operation:update]"
=== RUN   TestSVM/Clean_SVM#01
2026/06/15 13:20:31 INFO  "Calling tool"=svm_operation args="map[cluster_name:umeng-aff300-05-06 svm_name:marketingNew_1781509778 type_operation:delete]"
--- PASS: TestSVM (71.43s)
    --- PASS: TestSVM/Clean_SVM (6.35s)
    --- PASS: TestSVM/Create_SVM (17.34s)
    --- PASS: TestSVM/Rename_SVM (11.31s)
    --- PASS: TestSVM/Update_SVM (13.83s)
    --- PASS: TestSVM/Clean_SVM#01 (22.60s)

Copilot AI review requested due to automatic review settings June 15, 2026 07:57
@cla-bot cla-bot Bot added the cla-signed label Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) plus tool.SVMUpdate for update-specific fields.
  • Replaces CreateSVM/UpdateSVM/DeleteSVM handlers with a single App.SVMOperation switch-based handler.
  • Updates tool registration and descriptions to expose only svm_operation for 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 thread server/server.go
Comment thread server/svm.go Outdated
Comment thread tool/tool.go
Comment thread server/server.go
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)
Copilot AI review requested due to automatic review settings June 15, 2026 12:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread tool/tool.go
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 thread server/server.go
Comment on lines +657 to +659
operationAnnotation = mcp.ToolAnnotations{
DestructiveHint: new(true),
}
Comment thread server/server.go
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.`
@Hardikl

Hardikl commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

closing this PR as this #157 handles the same.

@Hardikl Hardikl closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants