Commit 3a1a1b41 authored by Christian Tzolov's avatar Christian Tzolov
Browse files

feat: add duplicate tool name validation for MCP server registration



- Add AssertNotDupplicateTool validation method to prevent duplicate tool registration
- Throw IllegalArgumentException during server building when duplicate tool names detected
- Throw McpError when attempting to add duplicate tools to existing server
- Add test coverage for duplicate detection scenarios:
  - Individual tool registration during building
  - Batch tool registration (list and varargs)
  - Runtime duplicate tool addition
- Apply validation to both sync and async server implementations

This prevents tool name conflicts that could cause unexpected behavior
or runtime errors in MCP server implementations.

Signed-off-by: default avatarChristian Tzolov <christian.tzolov@broadcom.com>
parent 37c342c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment