Federico Mariani created CAMEL-23078:
----------------------------------------

             Summary: camel-openai MCP improvements
                 Key: CAMEL-23078
                 URL: https://issues.apache.org/jira/browse/CAMEL-23078
             Project: Camel
          Issue Type: Improvement
          Components: camel-openai
    Affects Versions: 4.18.0
            Reporter: Federico Mariani


Implementing https://issues.apache.org/jira/browse/CAMEL-23076 I noticed the 
following improvements:

* Parallel tool execution - mcpToolExecutorThreads config, CompletableFuture 
for batch calls

When the model returns multiple tool calls in a single response (e.g., "get 
weather for London" and "get weather for Paris" simultaneously), they're 
currently executed sequentially. This is a per-exchange latency optimization — 
with 3 tools at 500ms each, sequential = 1.5s, parallel = ~500ms. It does not 
address thread exhaustion under concurrent load; the exchange thread remains 
blocked for the full agentic loop regardless. A configurable 
mcpToolExecutorThreads (default 1 = sequential, current behavior) would create 
a fixed thread pool at endpoint startup, used only for concurrent callTool() 
within a single model response.

* Tool list refresh - mcpToolRefreshInterval or SDK toolsChangeConsumer callback

Tools are listed once at doStart() and cached for the lifetime of the route. If 
an MCP server adds, removes, or updates tools at runtime, the cached list 
becomes stale — the model may try to call tools that no longer exist, or miss 
new ones.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to