-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
Description
Objective
Create comprehensive tests for MCP tool schema validation and error message generation to prevent regressions and ensure consistent behavior.
Context
After enhancing MCP schemas and error messages, we need tests to verify:
- Schema documentation is complete for all required parameters
- Error messages follow the enhanced format with examples
- Future schema changes don't break validation
Approach
- Create test file(s) for MCP schema validation
- Add tests that verify:
- All required parameters have descriptions
- Descriptions include examples
- Error messages include parameter name, description, and example
- Error format is consistent across tools
- Use existing test patterns from the codebase (e.g.,
*_test.gofiles)
Files to Create/Modify
- Create test file for MCP schema validation (follow existing patterns)
- Look at existing tests in
actions/setup/js/*.test.cjsfor JavaScript testing patterns - May need to add Go tests if MCP schema validation happens at compile time
Test Cases to Cover
-
Schema Completeness:
- All required parameters have non-empty descriptions
- Descriptions include examples or format guidance
- Tool schemas include usage examples
-
Error Message Format:
- Missing parameter errors include parameter name
- Errors include expected format
- Errors include example correct usage
-
Regression Prevention:
- Test that schemas can be parsed correctly
- Test that error message generation doesn't break
Acceptance Criteria
- Tests verify all required parameters have detailed descriptions
- Tests verify error messages follow enhanced format
- Tests pass with
make test - Test coverage includes all safe output MCP tools
Testing
After creating tests:
make test # Run all tests including new validation tests
make test-unit # Run just unit tests for faster feedbackRelated to #7950
AI generated by Plan Command for discussion #7934
Copilot