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

   [CAMEL-25632](https://issues.apache.org/jira/browse/CAMEL-25632): one 
`camel_catalog_doc` call can now check several options. In a local-model 
benchmark, models spent their tool calls on one lookup per option and ran out 
before they edited the route.
   
   ## Argument
   
   `optionsFilter` is still one string, and a comma now separates several 
terms: `logStackTrace,logExhausted,maximumRedeliveries`. This follows the comma 
lists the tools already take (`files`, `utility`).
   - Terms are split on commas only, so a filter that is a phrase matches as 
before.
   - Each term is trimmed, lower-cased and de-duplicated.
   - Brackets and quotes are stripped, so a JSON-like list sent as text works 
too.
   - At most 30 terms are searched; past that, `filterNote` says so.
   - A filter with a single term takes the old code path.
   
   ## Answer
   
   - `options`, `nestedOptions`, the Simple `functions`/`operators`, the 
exchange properties and the doc sections list what any of the terms matches.
   - A term that matches nothing goes in `unmatchedTerms`, with what a call for 
that term alone would say: the message header it is, where an option of that 
name lives (`elsewhere`), or the closest options. `unmatchedHint` explains the 
list.
   - For an EIP, the options of its elements are now searched also when options 
of the EIP itself match. For example, `redelivery` on onException now also 
gives the `redeliveryPolicy` options under `nestedOptions`. This applies to 
single-term calls too: answers only gain fields, and the sizes measured stay at 
2.4K to 6.5K characters.
   - Answers stay capped at 18000 characters. When a list is cut, the 
truncation note names the entries left out, so the model knows what to ask for 
again.
   
   ## Clients
   
   - The logic lives in camel-jbang-core (`CatalogDocs`), so `camel ask`, 
`camel run --mcp`, the Camel CLI dashboard and the MCP server all get it.
   - The tool descriptions in core and in camel-jbang-mcp, and the MCP server 
instructions, say that several options can be checked in one call.
   - Docs: `camel-jbang-mcp.adoc` and an upgrade-guide note (4.24).
   
   ## Not in this PR
   
   Point 3 of the JIRA: answering with the full option list after repeated 
lookups (`RepeatedToolCalls`). It needs a per-session way to rewrite the tool's 
arguments in every client, so it is a follow-up of its own.
   
   ## Tests
   
   - New `CatalogDocSeveralOptionsTest` (13 tests): several EIP options found 
nested; several sql options; a term that matches nothing; a term that is a 
header; a term that is an option of another element; several Simple functions; 
a list written as text; the 30-term cap; the unchanged single-term answer; 
nested options when the EIP's own options match; the names in the truncation 
note.
   - camel-jbang-core: the `commands.ai` package plus `AskToolsTest` and 
`CatalogDocTest`, 1083 tests pass.
   - camel-jbang-mcp: `McpServerInstructionsTest`, `AuthoringToolsTest` and 
`AuthoringToolsRootsTest` pass. Locally they ran against the camel-jbang-core 
jar in `~/.m2`, so CI is the first full run of the MCP module with the new core.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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