Skip to content

[plan] Add validation tests for MCP tool schemas and error messages #7953

@github-actions

Description

@github-actions

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:

  1. Schema documentation is complete for all required parameters
  2. Error messages follow the enhanced format with examples
  3. Future schema changes don't break validation

Approach

  1. Create test file(s) for MCP schema validation
  2. 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
  3. Use existing test patterns from the codebase (e.g., *_test.go files)

Files to Create/Modify

  • Create test file for MCP schema validation (follow existing patterns)
  • Look at existing tests in actions/setup/js/*.test.cjs for JavaScript testing patterns
  • May need to add Go tests if MCP schema validation happens at compile time

Test Cases to Cover

  1. Schema Completeness:

    • All required parameters have non-empty descriptions
    • Descriptions include examples or format guidance
    • Tool schemas include usage examples
  2. Error Message Format:

    • Missing parameter errors include parameter name
    • Errors include expected format
    • Errors include example correct usage
  3. 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 feedback

Related to #7950

AI generated by Plan Command for discussion #7934

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions