Skip to content

feat: merge tools with tool_mode flag#157

Open
Hardikl wants to merge 5 commits into
mainfrom
hl_merge
Open

feat: merge tools with tool_mode flag#157
Hardikl wants to merge 5 commits into
mainfrom
hl_merge

Conversation

@Hardikl

@Hardikl Hardikl commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
ontap-mcp % go run main.go start --tool-mode abv
Usage: ontap-mcp start [flags]

Start ONTAP MCP server

Flags:
  -h, --help                   Show context-sensitive help.
      --log-level="info"       Log level, one of: debug,info,warn,error ($LOG_LEVEL)
      --config="ontap.yaml"    ONTAP-MCP config path ($ONTAP_MCP_CONFIG)
      --tool-mode="both"       ONTAP-MCP tool mode, one of: legacy,multiplex,both ($TOOL_MODE)

      --host="localhost"       Listening address
      --port=8080              Listening port ($ONTAP_MCP_PORT)
      --inspect-traffic        Inspect MCP HTTP traffic
      --read-only              Run MCP in read-only mode. This disables all tool calls that modify ONTAP state.
      --stateless              Run in stateless mode (no mcp-session-id header validation). Required when deploying behind proxies or gateways that don't preserve session headers, e.g. on-premises
                               data gateways.
      --json-response          Respond with application/json instead of text/event-stream. Required when deploying behind proxies or gateways that do not relay SSE/chunked responses, e.g.
                               on-premises data gateways.

ontap-mcp: error: --tool-mode must be one of "legacy","multiplex","both" but got "abv"
exit status 80

Validated with existing CI tests with legacy mode, multiplex mode and both(default) mode.
Usage way: go run main.go start --tool-mode multiplex

@Hardikl Hardikl requested a review from cgrinds as a code owner June 22, 2026 08:31
Copilot AI review requested due to automatic review settings June 22, 2026 08:31
@Hardikl Hardikl requested a review from rahulguptajss as a code owner June 22, 2026 08:31
@cla-bot cla-bot Bot added the cla-signed label Jun 22, 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 introduces a tool-mode switch (--tool-mode=legacy|multiplex|both) to control whether the server exposes the existing discrete update_*/delete_* tools, new merged “modify_*” tools (that combine update/delete/restore/remove operations), or both. It also updates tool parameter types to better separate create vs update/modify inputs and adds validation to prevent no-op updates.

Changes:

  • Add --tool-mode CLI flag + server option, and gate tool registration based on the selected mode.
  • Introduce many Modify* tool handlers (multiplex mode) that unify update/delete (and similar) operations behind an operation parameter.
  • Update/extend tool parameter structs and add “at least one updatable field” validations across multiple resources.

Reviewed changes

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

Show a summary per file
File Description
cmd/cmds.go Adds --tool-mode flag and passes it into server options.
server/server.go Registers tools conditionally based on tool mode; adds modify tool annotation.
tool/tool.go Adds new *Create, *Modify, and *Update request structs for multiplex tools.
server/volume.go Uses VolumeCreate and adds ModifyVolume + update validation improvements.
server/svm.go Adds ModifySVM and update validation helper.
server/Snapshotpolicy.go Uses SnapshotPolicyCreate; adds modify handlers for policy + schedules.
server/snapshot.go Adds ModifySnapshot to unify restore/delete.
server/snapmirror.go Adds ModifySnapMirror; refactors transfer method name and state update helper.
rest/snapmirror.go Renames transfer method to InitOrUpdateSnapMirrorTransfer.
server/qtree.go Uses QtreeCreate; adds ModifyQtree and shared validation.
server/QoSPolicy.go Adds ModifyQoSPolicy and shared update validation.
server/nvme.go Adds modify handlers for NVMe service/subsystem/namespace.
server/nfsService.go Adds ModifyNFSService and update validation helper.
server/NFS.go Uses NFSExportPolicyCreate / rules create type; adds modify handlers and validations.
server/lun.go Adds ModifyLUN and shared LUN validation.
server/iscsiService.go Adds modify handlers for iSCSI service and network IP interface; refactors validation.
server/igroup.go Adds ModifyIGroup.
server/fcp.go Adjusts FCP update input type; adds modify handlers for FCP service + FC interface.
server/cifsService.go Uses CIFSServiceCreate; adds ModifyCIFSService + update validation helper.
server/cifs.go Uses CIFSShareCreate; adds ModifyCIFSShare + update validation helper.
descriptions/descriptions.go Adds descriptions for new modify tools and renames transfer description.
integration/test/tools_test.go Adds extra input context to retry log line.
integration/test/iscsi_test.go Updates prompt text used by integration test.
integration/test/igroup_test.go Updates prompt text used by integration test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/cmds.go Outdated
Comment thread server/server.go
Comment thread server/server.go
Comment thread tool/tool.go
Comment thread server/svm.go Outdated
Comment thread server/snapshot.go Outdated
Comment thread server/volume.go Outdated
Comment thread server/volume.go Outdated
Comment thread server/NFS.go
Comment thread server/NFS.go Outdated
Copilot AI review requested due to automatic review settings June 24, 2026 08:58

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 23 out of 23 changed files in this pull request and generated 5 comments.

Comment thread server/Snapshotpolicy.go
Comment thread server/NFS.go
Comment thread server/NFS.go
Comment thread docs/tools.md Outdated
Comment thread tool/tool.go
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