Skip to content

Commit a3cf79b

Browse files
authored
feat(prompts): Enhanced MCP prompt management with improved UX (#2953)
* feat(prompts): enhance /prompts list to show descriptions - Add description display in three-column layout (Prompt | Description | Arguments) - Implement description truncation at 40 characters with ellipsis - Handle missing descriptions with '(no description)' placeholder - Support multi-line descriptions by showing first line only - Fix existing bug in longest_name calculation for proper alignment - Add comprehensive tests for description formatting functions 🤖 Assisted by Amazon Q Developer * feat(prompts): Add /prompts details command Add new Details subcommand to show comprehensive prompt information including full metadata and argument details. This addresses the discoverability issue where users couldn't easily understand prompt capabilities and requirements. - Add Details variant to PromptsSubcommand enum - Implement prompt resolution with server/prompt disambiguation - Add detailed formatting for prompt metadata and arguments - Include usage examples in details display - Maintain consistent error handling with existing patterns - Add comprehensive unit tests for new functionality 🤖 Assisted by Amazon Q Developer * feat(prompts): improve MCP error handling with user-friendly messages Replace raw JSON MCP server errors with helpful, actionable error messages: - Handle -32602 (Invalid params) with usage hints and argument descriptions - Handle -32603 (Internal error) with user-friendly retry message - Parse MCP error JSON to identify specific subcases - Generate usage examples from PromptBundle data - Preserve existing good error handling for PromptNotFound and AmbiguousPrompt Addresses GitHub issue #2789 UX improvement for MCP prompt error handling. 🤖 Assisted by Amazon Q Developer * feat(prompts): display fetched prompt content before AI processing Display retrieved MCP prompt content immediately after fetching from server to eliminate user confusion about what happens during 'Thinking' phase. Users now see exactly what prompt was retrieved before AI processing begins. - Add display_prompt_content helper function with proper terminal formatting - Handle all PromptMessageContent variants (Text, Image, Resource, ResourceLink) - Preserve existing error handling and AI processing flow - Use consistent crossterm styling with existing prompt commands 🤖 Assisted by Amazon Q Developer * fix: Fixes after manual testing * fix: description width * Re-add removed tests * fix(prompts): resolve file-based and MCP prompt integration issues - Add conflict warning when file-based prompt shadows MCP prompt with same name - Fix missing usage details for fully qualified MCP prompt names (@server/prompt) - Remove redundant 'Fetched prompt:' header from both MCP and file-based prompts - Extract actual prompt name from qualified names for proper error handling - Add comprehensive tests for new functionality 🤖 Assisted by Amazon Q Developer * fix(prompts): add conflict warning to /prompts details command When both file-based and MCP prompts exist with the same name, the /prompts details command now shows a warning and guidance on how to access the MCP prompt using the fully qualified server/prompt syntax. This provides consistent behavior with prompt execution (@prompt-name). 🤖 Assisted by Amazon Q Developer * Fix clippy warning
1 parent a8a815a commit a3cf79b

File tree

2 files changed

+1473
-163
lines changed

2 files changed

+1473
-163
lines changed

0 commit comments

Comments
 (0)