oscerd opened a new pull request, #23359:
URL: https://github.com/apache/camel/pull/23359

   ## Summary
   
   Reduces the token cost of `camel_catalog_component_doc` (MCP) — part of the
   ongoing token-reduction effort for `camel-jbang-mcp` ([CAMEL-23475][jira]).
   
   Two new arguments and a small follow-up tool:
   
   * `optionsFilter` — case-insensitive substring match on option name.
   * `includeOptions` — one of `required` | `common` | `all`, default `common`
     (excludes deprecated and advanced options).
   * `ComponentDetailResult` no longer carries `groupId` / `artifactId` /
     `version`. Callers that actually need maven coordinates now call the new
     `camel_catalog_component_maven` tool.
   
   ## Behaviour numbers (Kafka)
   
   Measured locally against the in-bundle catalog (estimating ~4 chars / token):
   
   | Scope      | Endpoint opts | Component opts | JSON chars | Est. tokens |
   | ---------- | -------------:| --------------:| ----------:| -----------:|
   | `all`      | 121           | 129            | 92,866     | ~23,200     |
   | `common`   | 112           | 117            | 82,882     | ~20,700     |
   | `required` | 1             | 0              | 515        | ~130        |
   
   The default `common` scope (excluding deprecated + advanced, per the ticket
   definition) 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 call `required` first)
   — the docs and tool description nudge it to do so.
   
   ## Changes
   
   * `CatalogTools.camel_catalog_component_doc`: added `optionsFilter` and
     `includeOptions` args; updated tool description.
   * `CatalogTools.camel_catalog_component_maven`: new tool returning `name`,
     `groupId`, `artifactId`, `version`.
   * `ComponentDetailResult`: removed `groupId`/`artifactId`/`version` fields.
   * `ComponentMavenResult`: new record.
   * `OptionScope`: internal enum implementing the filter predicates.
   * Docs: added the new tool to `camel-jbang-mcp.adoc`, bumped tool count
     from 27 to 28, added an upgrade-guide entry under camel-jbang-mcp.
   
   ## Test plan
   
   - [x] `mvn -DskipTests install` in `dsl/camel-jbang/camel-jbang-mcp` 
(formats + builds)
   - [x] `mvn test` in `dsl/camel-jbang/camel-jbang-mcp` — 250 tests pass, 
including 6 new ones
   - [x] `mvn clean install -DskipTests` from repository root — full reactor 
build green, no
         uncommitted regenerated files
   - [x] `McpJsonSerializationTest` updated for the new `ComponentDetailResult` 
shape
   
   Tests added:
   
   * `componentDocDefaultsToCommonScope`
   * `componentDocRequiredScopeOnlyReturnsRequiredOptions`
   * `componentDocOptionsFilterByName`
   * `componentDocInvalidIncludeOptionsThrows`
   * `componentMavenReturnsCoordinates`
   * `componentMavenUnknownComponentThrows`
   * `componentMavenResultSerializesNonNullFields`
   
   [jira]: https://issues.apache.org/jira/browse/CAMEL-23475
   
   ---
   _Claude Code on behalf of Andrea Cosentino_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to