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

   ## Summary
   
   Add a per-server `toolNames` include list to the `camel-openai` MCP server 
configuration, allowing users to restrict which tools are registered from each 
MCP server.
   
   **Motivation:** Currently, `camel-openai` registers *all* tools from every 
configured MCP server. Users need filtering to:
   - Reduce prompt size and token cost
   - Keep destructive tools away from the model
   - Work around duplicate tool names across servers
   
   **Configuration:**
   ```
   mcpServer.<name>.toolNames=tool1,tool2
   ```
   
   When `toolNames` is set, only the listed tools are registered. When not set 
or empty, all tools are registered (backward compatible).
   
   ## Changes
   
   - **`OpenAIEndpoint.java`** — Added `filterTools()` helper method that 
parses the per-server `toolNames` include list and filters tools. Applied in 
both `initializeMcpServers()` and `doReconnectMcpServer()` for consistent 
behavior across initial startup and connection recovery.
   - **`OpenAIConfiguration.java`** — Updated `mcpServer` metadata description 
to document the `toolNames` sub-property.
   - **`openai-mcp.adoc`** — Added "Tool Filtering" documentation section with 
Java, XML, and YAML examples.
   - **`OpenAIEndpointMcpToolFilteringTest.java`** — 9 new unit tests covering: 
basic filtering, no filter (all tools), empty filter, whitespace trimming, 
multiple servers with different filters, mixed filtered/unfiltered servers, 
reconnect filter persistence, single tool filter, and `returnDirect` 
interaction with filtering.
   - **`openai.json`** — Regenerated component metadata (auto-generated).
   
   ## Test plan
   
   - [x] All 151 unit tests pass (including 9 new filtering tests)
   - [x] Source check (`mvn -Psourcecheck validate`) passes
   - [ ] CI build passes
   
   _Claude Code on behalf of gnodet_
   
   🤖 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