Support overriding tool annotations in aggregation config#4285
Open
Support overriding tool annotations in aggregation config#4285
Conversation
MCP clients like Claude Desktop display annotations.title as the primary tool label. Previously only name and description could be overridden in vMCP aggregation config, so overridden tools still showed the original backend's title. Add ToolAnnotationsOverride with pointer fields (*string, *bool) so nil means "don't override" while zero values mean "explicitly set." Wire annotation overrides through processBackendTools, manual conflict resolution, and the CRD-to-config converter. Closes #4282 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4285 +/- ##
==========================================
+ Coverage 68.54% 69.09% +0.54%
==========================================
Files 471 471
Lines 47732 47683 -49
==========================================
+ Hits 32717 32945 +228
+ Misses 12247 12171 -76
+ Partials 2768 2567 -201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
annotations.titleas the primary tool label, but vMCP aggregation config only supported overridingnameanddescription. This meant overridden tools still showed the original backend's title (e.g., "List Channels" instead of "List Jira Projects").ToolAnnotationsOverridestruct with pointer fields (*string,*bool) sonilmeans "don't override" while zero values mean "explicitly set to this value." Wire annotation overrides throughprocessBackendTools, manual conflict resolution, and the CRD-to-config converter.Closes #4282
Type of change
Test plan
task test)Changes
pkg/vmcp/config/config.goToolAnnotationsOverridestruct; addAnnotationsfield toToolOverridecmd/thv-operator/api/v1alpha1/toolconfig_types.goToolAnnotationsOverrideandToolOverride.Annotationspkg/vmcp/aggregator/tool_adapter.goapplyAnnotationOverrideshelper; apply inprocessBackendToolspkg/vmcp/aggregator/manual_resolver.goresolveToolWithOverridecmd/thv-operator/pkg/vmcpconfig/converter.goconvertCRDAnnotationsOverridebridge*/zz_generated.deepcopy.godeploy/charts/operator-crds/***_test.goapplyAnnotationOverrides,processBackendTools, manual resolver, converter merge, and CRD conversionDoes this introduce a user-facing change?
Yes. Users can now override tool annotation fields (
title,readOnlyHint,destructiveHint,idempotentHint,openWorldHint) in vMCP aggregation config and MCPToolConfig CRDs. Example:Special notes for reviewers
*string,*bool) sonil= "don't override" and zero values = "explicitly set." This is important because annotations are optional in the MCP spec — a user may want to clear a title or set a hint tofalse.ToolAnnotationsOverrideis duplicated betweenpkg/vmcp/configandcmd/thv-operator/api/v1alpha1because CRD types can't import config types (kubebuilder convention). AconvertCRDAnnotationsOverridebridge handles the conversion, matching the existing Anti-Corruption Layer pattern.applyAnnotationOverridesassigns*boolpointers directly (shared reference). Safe today since nothing mutates annotations post-construction, but worth noting.Generated with Claude Code