Skip to content

Conversation

@AaronGoldsmith
Copy link
Contributor

🐛 Fix Tool Call Display: Show Names Instead of Parameters

This PR fixes a UI bug where tool calls with parameters displayed confusing parameter information instead of clear tool names for unknown/unrecognized tools.

image

🚨 Problem Solved

Confusing Tool Display: Unknown tools with parameters showed parameter details instead of tool names, making it hard for users to understand what Goose was doing:

✨ What's Fixed

🔧 Clean Fallback Logic

  • Unknown tools now return null → triggers proper tool name fallback
  • Consistent display for all unrecognized tools
  • Parameter details still available in expandable "Tool Details" section

🎨 Enhanced Tool Name Display

  • Truncation for long names (50 character limit with ellipsis)
  • Consistent formatting using existing snakeToTitleCase utility
  • Shared truncation logic eliminates code duplication

🚀 Key Improvements

✅ Better User Experience

// Before: Confusing parameter list
"support_type, start_date, end_date, category"

// After: Clear, descriptive tool name  
"Retrieve Support Tickets"

✅ Handles All Tool Types

  • Known tools: Custom descriptions (unchanged)
  • Unknown tools: Formatted tool names (fixed)
  • Long tool names: Properly truncated (enhanced)

🎁 User Experience Enhancements

  • Clear tool identification - Users can immediately see what tool is running
  • Consistent display format - All tools follow same naming pattern
  • Parameter details preserved - Still accessible via expandable sections
  • Cleaner UI - No more confusing parameter lists in tool headers

🔧 Technical Implementation

Core Changes

  • Simplified default case - Returns null to trigger fallback
  • Extracted truncate helper - Shared between functions for consistency
  • Enhanced fallback logic - Formats and truncates tool names properly

// Enhanced fallback with shared truncation
const toolName = toolCall.name.substring(toolCall.name.lastIndexOf('__') + 2);
return truncate(snakeToTitleCase(toolName));

🎨 Examples of Fixed Display

MCP Extension Tools

❌ Before: "start_date, end_date, category"
✅ After:  "Retrieve Support Tickets"

❌ Before: "issueKey, summary, description"  
✅ After:  "Create Issue"

❌ Before: "environment, orderId, country"
✅ After:  "Get Order Transaction Details..."

📊 Impact

Bug: Tool names missing for unknown tools → Fixed: All tools show clear names
Code Quality: Duplicated truncation logic → Improved: Shared helper function
UX: Confusing parameter lists → Enhanced: Clear, truncated tool names
Maintainability: Scattered logic → Consolidated: Single source of truth

✅ Testing

  • ✅ TypeScript compilation passes
  • ✅ ESLint checks pass
  • ✅ No breaking changes to existing functionality
  • ✅ Known tools still show custom descriptions
  • ✅ Unknown tools now show formatted names
  • ✅ Long tool names properly truncated

🔧 Files Changed

  • src/components/ToolCallWithResponse.tsx - Fixed fallback logic and added shared truncation

tool name visible
After_expanded

@AaronGoldsmith
Copy link
Contributor Author

AaronGoldsmith commented Jul 4, 2025

Closing in favor of #3231

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