Replace ToolMatch with mcp.Tool in optimizer pipeline#4016
Merged
aponcedeleonch merged 1 commit intomainfrom Mar 6, 2026
Merged
Replace ToolMatch with mcp.Tool in optimizer pipeline#4016aponcedeleonch merged 1 commit intomainfrom
aponcedeleonch merged 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4016 +/- ##
==========================================
- Coverage 68.60% 68.53% -0.07%
==========================================
Files 444 444
Lines 45178 45181 +3
==========================================
- Hits 30995 30967 -28
- Misses 11781 11816 +35
+ Partials 2402 2398 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JAORMX
previously approved these changes
Mar 5, 2026
3bf5b67 to
0ed92d4
Compare
ChrisJBurns
previously approved these changes
Mar 5, 2026
jerm-dro
previously approved these changes
Mar 5, 2026
2dc06d2
0ed92d4 to
2dc06d2
Compare
The ToolMatch struct duplicated fields from mcp.Tool (Name, Description, InputSchema, OutputSchema), creating an unnecessary conversion layer. Replace it with mcp.Tool throughout the optimizer pipeline: the store returns minimal mcp.Tool values (Name + Description), and FindTool enriches them by swapping in the full tool from the in-memory map. This eliminates the resolveInputSchema/resolveOutputSchema helpers and gives callers all mcp.Tool fields (Annotations, RawInputSchema, etc.) for free. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2dc06d2 to
c691e5e
Compare
JAORMX
approved these changes
Mar 6, 2026
jerm-dro
reviewed
Mar 6, 2026
Contributor
jerm-dro
left a comment
There was a problem hiding this comment.
Nice! Thanks for cleaning this up 😄
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.
Summary
ToolMatchstruct from the optimizer's internal types, replacing it withmcp.Toolthroughout the pipelineSearchmethod now returns[]mcp.Tool(with only Name and Description populated)FindToolenriches results by swapping in the fullmcp.Toolfrom the in-memory map, giving callers all fields (InputSchema, OutputSchema, RawInputSchema, Annotations, etc.) for freeToolStoreinterfaceTest plan
go test ./pkg/vmcp/optimizer/...— all passgo test ./pkg/vmcp/server/...— all passtask test— full unit suite passestask lint-fix— 0 issues🤖 Generated with Claude Code