Skip to content

ToolRegistry.register() silently overwrites tools with the same name.#1747

Open
pixan-ai wants to merge 1 commit intoHKUDS:mainfrom
pixan-ai:fix/registry-duplicate-tool-warning
Open

ToolRegistry.register() silently overwrites tools with the same name.#1747
pixan-ai wants to merge 1 commit intoHKUDS:mainfrom
pixan-ai:fix/registry-duplicate-tool-warning

Conversation

@pixan-ai
Copy link
Copy Markdown
Contributor

@pixan-ai pixan-ai commented Mar 8, 2026

This can happen when multiple MCP servers expose tools with identical names, causing one to disappear without any indication.
Adds a logger.warning() so users can diagnose unexpected tool conflicts.

What

Add a warning log when registering a tool that overwrites an existing one.

Why

ToolRegistry.register() silently overwrites if a tool with the same
name already exists. This can happen when multiple MCP servers expose
tools with identical names — one tool quietly disappears with no
indication to the user, making debugging very difficult.

How

  • Check if tool.name already exists in the registry before overwriting
  • Log a warning with the tool name via loguru.logger

Testing

  1. Configure two MCP servers that expose a tool with the same name
  2. Start nanobot → should see warning in logs about the duplicate
  3. Normal tool registration (no duplicates) should have no warning

Acknowledgment

Fix identified and developed with assistance from Claude Opus 4.6

This can happen when multiple MCP servers expose tools with identical
names, causing one to disappear without any indication.

Adds a logger.warning() so users can diagnose unexpected tool conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant