feat: add parameterless prompt execution support with defaults and auto-generated values#126
feat: add parameterless prompt execution support with defaults and auto-generated values#126Sean-Sekora wants to merge 4 commits intoQuantGeekDev:mainfrom
Conversation
…to-generated values
## Key Features Added
### 1. Enhanced Schema Support
- Add `default` property to PromptArgumentSchema for explicit default values
- Support for parameterless prompt execution with sensible defaults
### 2. Improved Parameter Handling
- MCPServer now passes empty object when arguments are undefined
- BasePrompt gracefully handles missing arguments with automatic defaults
- Automatic type-based defaults: string="", number=0, boolean=false, array=[], object={}
### 3. Smart Validation Logic
- Fields with explicit defaults are marked as not required in prompt definitions
- Optional parameters (required: false) bypass validation requirements
- Maintains full backward compatibility with existing prompts
### 4. Comprehensive Testing
- 12 test cases covering all parameterless execution scenarios
- Tests for explicit defaults, automatic defaults, and optional parameters
- Error handling and edge case validation
### 5. Rich Documentation
- Complete Prompts section in README with examples and best practices
- Migration guide for existing prompts
- Usage patterns for different parameter configurations
## Breaking Changes
None - fully backward compatible
## Usage Examples
**Before**: `/my-prompt (MCP) {"message": ""}` (required empty object)
**After**: `/my-prompt (MCP)` (truly parameterless execution)
This enables natural prompt usage like `/gitlab:commit (MCP)` without requiring empty JSON objects.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update package name to @sekora/mcp-framework for scoped npm publishing - Add publish.yml workflow that triggers on GitHub releases and manual dispatch - Include comprehensive CI steps: linting, testing, building before publishing - Support manual version updates and automatic npm publishing with public access - Enhance release.yml workflow with outputs for better integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…--components--mcp-framework chore: release 0.2.16
|
Hey @Sean-Sekora, thanks for putting this together — the parameterless prompt execution concept is interesting and the tests you wrote are solid! We did a thorough review and wanted to share some feedback. There are a few issues that would need to be addressed before we could merge this: Blockers
Feature feedbackThe core prompt changes have some good ideas but also some concerns:
SuggestionIf you'd like to rework this, a clean PR from a feature branch with just these changes would be very welcome:
That would be a focused, mergeable change. Would you be interested in doing that, or would you like us to take it from here? |
Key Features Added
1. Enhanced Schema Support
defaultproperty to PromptArgumentSchema for explicit default values2. Improved Parameter Handling
3. Smart Validation Logic
4. Comprehensive Testing
5. Rich Documentation
Breaking Changes
None - fully backward compatible
Usage Examples
Before:
/my-prompt (MCP) {"message": ""}(required empty object)After:
/my-prompt (MCP)(truly parameterless execution)This enables natural prompt usage like
/gitlab:commit (MCP)without requiring empty JSON objects.🤖 Generated with Claude Code