Repository navigation
Add validation tests for MCP tool schemas and error messages - #7967
Merged
Merged
Conversation
- Create safe_outputs_mcp_schema_validation.test.cjs for schema validation - Test all required parameters have descriptions with examples - Test optional parameters have descriptions - Test tool descriptions are detailed with use cases - Test schema consistency (types, snake_case, additionalProperties) - Test enum values follow conventions - Create safe_outputs_mcp_error_messages.test.cjs for error message validation - Test validateRequiredFields function behavior - Test error messages include parameter names - Test error format consistency across tools - Document current error message format for future enhancement - All 25 tests pass successfully - Tests cover all safe output MCP tools - Tests prevent regressions in schema quality and error messages Related to #7950 Co-authored-by: mnkiefer <[email protected]>
Copilot
AI
changed the title
[WIP] Add validation tests for MCP tool schemas and error messages
Add validation tests for MCP tool schemas and error messages
Dec 28, 2025
pelikhan
marked this pull request as ready for review
December 28, 2025 15:57
Collaborator
|
@copilot format and lint |
- Format .cjs test files with prettier - Format devcontainer.json - Update package-lock.json - All 25 tests still pass Co-authored-by: pelikhan <[email protected]>
Contributor
Author
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
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.
Summary: Add validation tests for MCP tool schemas and error messages ✅
This PR adds comprehensive tests for MCP tool schema validation and error message generation to prevent regressions and ensure consistent behavior across all safe output MCP tools.
Changes
New Test Files
safe_outputs_mcp_schema_validation.test.cjs(13 tests)safe_outputs_mcp_error_messages.test.cjs(12 tests)validateRequiredFieldsfunction behaviorFormatting & Linting
Test Coverage
✅ 25 tests pass successfully
What These Tests Prevent
Running the Tests
Example Test Output
Validation Examples
Schema Quality Checks
additionalProperties: falseError Message Checks
"Invalid arguments: missing or empty 'title', 'body'"Future Enhancement Opportunities
Tests document potential improvements:
Related to #7950
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.