[
https://issues.apache.org/jira/browse/CAMEL-23472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrea Cosentino updated CAMEL-23472:
-------------------------------------
Fix Version/s: 4.21.0
> camel-jbang-mcp: deduplicate @ToolArg descriptions to shrink tool schema
> payload
> --------------------------------------------------------------------------------
>
> Key: CAMEL-23472
> URL: https://issues.apache.org/jira/browse/CAMEL-23472
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Affects Versions: 4.21.0
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.21.0
>
>
> h3. Context
> Part of an effort to reduce token consumption of the {{camel-jbang-mcp}} MCP
> server. The module exposes 31 tools, 6 resources, and 3 prompts; both tool
> schemas (loaded once per session) and tool results (per call) contribute to
> LLM context-window pressure for every user of the server.
> Related tickets in this effort are linked via "Relates to".
> The {{camel-jbang-mcp}} module exposes 31 MCP tools whose schemas are sent to
> the client on every session start. Several {{@ToolArg}} descriptions are
> duplicated verbatim across tools, bloating the schema payload with roughly
> 1.5–2K tokens of pure repetition.
> h3. Verified duplication counts in
> {{dsl/camel-jbang/camel-jbang-mcp/src/main/java/.../mcp/}}
> * {{Runtime type: main, spring-boot, or quarkus (default: main)}} — *18
> copies*
> * {{Platform BOM coordinates in GAV format ...}} (multi-line block) — *16
> copies*
> * {{Camel version to use ...}} — *12 copies*
> * {{Version to query ...}} (longer variant) — *3 copies*
> h3. Proposed change
> * Introduce a {{ToolArgDocs}} constants class with {{RUNTIME}},
> {{CAMEL_VERSION}}, {{PLATFORM_BOM}}, etc.
> * Replace every duplicate description with the constant reference.
> * Trim each text to the minimum necessary (e.g. {{runtime}} → {{"main |
> spring-boot | quarkus"}}).
> h3. Acceptance
> No two {{@ToolArg}} annotations contain the same multi-line description
> literal.
> ----
> _Filed by Claude Code on behalf of Andrea Cosentino_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)