generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 303
feat(prompts): Enhanced MCP prompt management with improved UX #2953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
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
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 aws#2789 UX improvement for MCP prompt error handling. 🤖 Assisted by Amazon Q Developer
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
kensave
approved these changes
Sep 25, 2025
mr-lee
approved these changes
Sep 25, 2025
Successfully merged upstream file-based prompt system with existing MCP prompt details and error handling features: - Integrated upstream's file-based local/global prompt system - Preserved MCP prompt details command with server disambiguation - Maintained enhanced MCP error handling with user-friendly messages - Combined both file-based and MCP prompt listing in unified display - Resolved all merge conflicts and duplicate code 🤖 Assisted by Amazon Q Developer
- 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
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
mr-lee
approved these changes
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-approving - new changes look good.
Things we need to fix, but aren't introduced by this PR:
- We desperately need a UX library for console/terminal print commands, these are getting to be unmaintainable.
- There's a bunch of magic numbers for the UX formatting to work right. We should move those into the aforementioned UX framework.
- We do a lot of error message parsing from MCP server errors, if only because I don't believe there is a well-defined error communication format for us to consume. Ideally we can abstract this and make it a bit cleaner going forward.
This was referenced Sep 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #2789
Description of changes:
This PR improves the MCP prompts feature, focusing on better user experience and discoverability:
New Features
/prompts details
to show comprehensive prompt information including metadata and argument details/prompts list
with three-column layout showing descriptions and better formattingImprovements
Here are screenshots to see key differences before and after these changes:
/prompts list
before fix:/prompts list
after fix:New

/prompts details
command:Invoking a prompt now displays the prompt before sending to the model:

Better error messaging (no longer just raw MCP server responses):
Before fix:

After fix:

🤖 Assisted by Amazon Q Developer
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.