fix(#3636): allow composite tools to use filtered backend tools - #3637
Merged
Merged
Conversation
Previously, using `filter` in aggregation.tools config would remove backend tools from the routing table entirely, preventing composite tools from calling them. This was inconsistent with `excludeAll` which correctly kept tools in the routing table while hiding them from clients. This fix moves Filter logic to be applied alongside ExcludeAll in MergeCapabilities (via shouldAdvertiseTool), ensuring filtered tools remain in the routing table for composite tool workflows. Changes: - Modified processBackendTools to only apply Overrides, not Filter - Updated shouldAdvertiseTool to check Filter configuration - Added comprehensive unit tests for Filter behavior - Added combined E2E test with ExcludeAll and Filter on separate backends - Updated documentation to clarify visibility vs routing semantics - Changed terminology from "LLM" to "MCP client" for accuracy Fixes: #3636
jerm-dro
marked this pull request as ready for review
February 5, 2026 22:55
jerm-dro
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
jhrozek and
yrobla
as code owners
February 5, 2026 22:55
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3637 +/- ##
==========================================
- Coverage 65.75% 65.74% -0.01%
==========================================
Files 411 411
Lines 40805 40811 +6
==========================================
Hits 26833 26833
- Misses 11882 11886 +4
- Partials 2090 2092 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JAORMX
approved these changes
Feb 6, 2026
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
This PR fixes issue #3636 where tools filtered via
aggregation.tools[].filtercould not be used in composite tool steps. The fix ensures thatFilterbehaves consistently withExcludeAll- both hide tools from MCP clients while preserving them in the internal routing table for composite tool workflows.Root Cause: The
Filterconfiguration was applied inprocessBackendToolsduring capability discovery, which removed filtered tools from the pipeline entirely. This meant they never reached the routing table. In contrast,ExcludeAllwas correctly applied later inMergeCapabilities, preserving tools in the routing table while hiding them from clients.Fix: Move
Filterlogic to be applied inshouldAdvertiseTool(alongsideExcludeAll), ensuring filtered tools remain available for composite tool routing.Changes
Core Fix
pkg/vmcp/aggregator/tool_adapter.go: ModifiedprocessBackendToolsto only applyOverrides, notFilterpkg/vmcp/aggregator/default_aggregator.go: UpdatedshouldAdvertiseToolto checkFilterconfiguration in addition toExcludeAllTests
pkg/vmcp/aggregator/default_aggregator_test.go: Added unit tests for Filter behavior including partial matches and precedence with global ExcludeAllToolspkg/vmcp/aggregator/tool_adapter_test.go: Updated tests to reflect that Filter is no longer applied inprocessBackendToolstest/e2e/.../virtualmcp_composite_hidden_tools_test.go: New E2E test that creates two backends (one with ExcludeAll, one with Filter) and verifies a composite tool can use hidden tools from bothDocumentation
pkg/vmcp/config/config.go: Enhanced documentation forExcludeAllTools,ExcludeAll, andFilterfields to clarify visibility vs routing semanticsTest Plan
go test ./pkg/vmcp/aggregator/...)Fixes #3636