Skip to content

Conversation

@clouatre
Copy link

Fixes #2564

Problem

The toolAliases feature works functionally (tools execute correctly), but the UI displays original tool names instead of the configured aliases.

Before:

πŸ› οΈ  Using tool: getConfluencePage from mcp server atlassian_slalom

After:

πŸ› οΈ  Using tool: getSlalomPage from mcp server atlassian_slalom

Solution

Added a display_name field to CustomTool to separate display concerns from MCP invocation:

  • name field: Original tool name (sent to MCP server)
  • display_name field: Aliased name (shown in UI)
  • display_name() method: Uses alias if present, falls back to original name

Testing

  • βœ… All existing tests pass (327 passed, 0 failed)
  • βœ… Clippy clean (no new warnings)
  • βœ… Code formatted with cargo +nightly fmt
  • βœ… Manually tested with multi-instance MCP agent
  • βœ… Verified: UI shows alias, MCP receives original name, tools execute correctly

Changes

  • crates/chat-cli/src/cli/chat/tools/custom_tool.rs: Add display_name field
  • crates/chat-cli/src/cli/chat/tools/mod.rs: Update display_name() to use alias
  • crates/chat-cli/src/cli/chat/tool_manager.rs: Set display_name when creating CustomTool

Impact: Cosmetic fix only, fully backward compatible (Optional field with fallback)

- Add display_name field to CustomTool for UI display
- Keep name field for MCP server invocation
- Update display_name() to use alias when available

Fixes aws#2564
@clouatre
Copy link
Author

This PR completes the toolAliases implementation to match the documented behavior in agent-format.md.

Before this change, the UI displayed original tool names while the model used aliases, creating a confusing mismatch. This fix ensures all three layers are consistent:

  • Model: Sees aliased names
  • MCP invocation: Uses original names
  • UI display: Shows aliased names

The display_name field separates display concerns from MCP protocol requirements, completing the documented specification.

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.

Feature Request: Support toolAliases in mcp.json like agent

1 participant