Skip to content

Commit e61b340

Browse files
authored
Merge pull request #1488 from gabe-l-hart/ToolNameUpdate-1485
fix: Set the tool name when changed
2 parents 8698ff4 + 966874f commit e61b340

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mcpgateway/services/tool_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,9 @@ async def update_tool(
15411541
).scalar_one_or_none()
15421542
if existing_tool:
15431543
raise ToolNameConflictError(existing_tool.custom_name, enabled=existing_tool.enabled, tool_id=existing_tool.id, visibility=existing_tool.visibility)
1544+
if tool_update.custom_name is None and tool.name == tool.custom_name:
1545+
tool.custom_name = tool_update.name
1546+
tool.name = tool_update.name
15441547

15451548
if tool_update.custom_name is not None:
15461549
tool.custom_name = tool_update.custom_name

0 commit comments

Comments
 (0)