Skip to content

Conversation

calvingiles
Copy link
Contributor

Given the high occurrence of tool name collisions with MCP Servers (for example, creating an agent that support multiple IDEs will often result in multiple list_directory tools) it is often desirable to be able to namespace MCP tools under a sensible server name. For mcp servers that do not follow this convention, this feature addition adds a simple tool_name_prefix argument that will be added to the names of the MCPTool or MCPToolset.

@calvingiles calvingiles force-pushed the feature/support-mcp-tool-prefix branch from fe4d6c1 to c055ecf Compare June 12, 2025 00:03
@calvingiles calvingiles force-pushed the feature/support-mcp-tool-prefix branch from 7eee2ef to 8542553 Compare June 23, 2025 04:45
Copy link
Collaborator

@seanzhou1023 seanzhou1023 Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the changes in this file will cause the prefix to be added twice, given we already handled prefix prepending in base toolset, did you test it ?

I think the only changes needed in this file is

response = await session.call_tool(self._mcp_tool.name, arguments=args)

could you try and verify ?

session = await self._mcp_session_manager.create_session(headers=headers)

response = await session.call_tool(self.name, arguments=args)
response = await session.call_tool(self._mcp_tool.name, arguments=args)
Copy link
Collaborator

@seanzhou1023 seanzhou1023 Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides this line, I feel all the other changes in this file are not necessary and will cause problem as I mentioned in the comment of the whole file, would you please try and test it ?

@seanzhou1023
Copy link
Collaborator

@calvingiles , just realized you acutally added this prefix feature in mcp tool before we added this feature generally in base_toolset. sorry for the delay, we are really short of hands. would you be able to adapt to the latest code base and address the comments ?

@seanzhou1023
Copy link
Collaborator

close this PR as same function is implemented in #2823

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.

2 participants