CAMEL-23475: camel-jbang-mcp - make ComponentDetailResult lean by default with option filtering#23359
Merged
Merged
Conversation
…ault with option filtering Add option filtering to camel_catalog_component_doc and split out a small camel_catalog_component_maven tool so callers only pay the maven-coordinate token cost when they actually need it. * optionsFilter: case-insensitive substring match on option name. * includeOptions: required | common | all (default: common, which excludes deprecated and advanced options). * ComponentDetailResult no longer carries groupId/artifactId/version; use camel_catalog_component_maven for those. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
davsclaus
approved these changes
May 20, 2026
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
|
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
Reduces the token cost of
camel_catalog_component_doc(MCP) — part of theongoing token-reduction effort for
camel-jbang-mcp(CAMEL-23475).Two new arguments and a small follow-up tool:
optionsFilter— case-insensitive substring match on option name.includeOptions— one ofrequired|common|all, defaultcommon(excludes deprecated and advanced options).
ComponentDetailResultno longer carriesgroupId/artifactId/version. Callers that actually need maven coordinates now call the newcamel_catalog_component_maventool.Behaviour numbers (Kafka)
Measured locally against the in-bundle catalog (estimating ~4 chars / token):
allcommonrequiredThe default
commonscope (excluding deprecated + advanced, per the ticketdefinition) is a modest improvement over the previous all-options response.
To hit the ticket's ≤ 2K token acceptance target the LLM must combine the
default scope with a non-trivial
optionsFilter(or callrequiredfirst)— the docs and tool description nudge it to do so.
Changes
CatalogTools.camel_catalog_component_doc: addedoptionsFilterandincludeOptionsargs; updated tool description.CatalogTools.camel_catalog_component_maven: new tool returningname,groupId,artifactId,version.ComponentDetailResult: removedgroupId/artifactId/versionfields.ComponentMavenResult: new record.OptionScope: internal enum implementing the filter predicates.camel-jbang-mcp.adoc, bumped tool countfrom 27 to 28, added an upgrade-guide entry under camel-jbang-mcp.
Test plan
mvn -DskipTests installindsl/camel-jbang/camel-jbang-mcp(formats + builds)mvn testindsl/camel-jbang/camel-jbang-mcp— 250 tests pass, including 6 new onesmvn clean install -DskipTestsfrom repository root — full reactor build green, nouncommitted regenerated files
McpJsonSerializationTestupdated for the newComponentDetailResultshapeTests added:
componentDocDefaultsToCommonScopecomponentDocRequiredScopeOnlyReturnsRequiredOptionscomponentDocOptionsFilterByNamecomponentDocInvalidIncludeOptionsThrowscomponentMavenReturnsCoordinatescomponentMavenUnknownComponentThrowscomponentMavenResultSerializesNonNullFieldsClaude Code on behalf of Andrea Cosentino