Skip to content

Replace ToolMatch with mcp.Tool in optimizer pipeline#4016

Merged
aponcedeleonch merged 1 commit intomainfrom
add-inputschema-to-toolmatch
Mar 6, 2026
Merged

Replace ToolMatch with mcp.Tool in optimizer pipeline#4016
aponcedeleonch merged 1 commit intomainfrom
add-inputschema-to-toolmatch

Conversation

@aponcedeleonch
Copy link
Member

@aponcedeleonch aponcedeleonch commented Mar 5, 2026

Summary

  • Removes the ToolMatch struct from the optimizer's internal types, replacing it with mcp.Tool throughout the pipeline
  • The store's Search method now returns []mcp.Tool (with only Name and Description populated)
  • FindTool enriches results by swapping in the full mcp.Tool from the in-memory map, giving callers all fields (InputSchema, OutputSchema, RawInputSchema, Annotations, etc.) for free
  • Regenerates mocks to match the updated ToolStore interface

Test plan

  • go test ./pkg/vmcp/optimizer/... — all pass
  • go test ./pkg/vmcp/server/... — all pass
  • task test — full unit suite passes
  • task lint-fix — 0 issues

🤖 Generated with Claude Code

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.53%. Comparing base (e758073) to head (c691e5e).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

JAORMX
JAORMX previously approved these changes Mar 5, 2026
@aponcedeleonch aponcedeleonch changed the title Add InputSchema to ToolMatch in find_tool results Add InputSchema and OutputSchema to ToolMatch in find_tool results Mar 5, 2026
@aponcedeleonch aponcedeleonch force-pushed the add-inputschema-to-toolmatch branch from 3bf5b67 to 0ed92d4 Compare March 5, 2026 20:51
@aponcedeleonch aponcedeleonch requested a review from JAORMX March 5, 2026 20:51
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 5, 2026
ChrisJBurns
ChrisJBurns previously approved these changes Mar 5, 2026
jerm-dro
jerm-dro previously approved these changes Mar 5, 2026
@aponcedeleonch aponcedeleonch dismissed stale reviews from jerm-dro and ChrisJBurns via 2dc06d2 March 6, 2026 09:36
@aponcedeleonch aponcedeleonch force-pushed the add-inputschema-to-toolmatch branch from 0ed92d4 to 2dc06d2 Compare March 6, 2026 09:36
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 6, 2026
@aponcedeleonch aponcedeleonch changed the title Add InputSchema and OutputSchema to ToolMatch in find_tool results Replace ToolMatch with mcp.Tool in optimizer pipeline Mar 6, 2026
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>
@aponcedeleonch aponcedeleonch force-pushed the add-inputschema-to-toolmatch branch from 2dc06d2 to c691e5e Compare March 6, 2026 09:46
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 6, 2026
@aponcedeleonch aponcedeleonch merged commit edafa62 into main Mar 6, 2026
58 of 59 checks passed
@aponcedeleonch aponcedeleonch deleted the add-inputschema-to-toolmatch branch March 6, 2026 10:55
Copy link
Contributor

@jerm-dro jerm-dro left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for cleaning this up 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants