mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
feat: comprehensive parameter validation for MCP tools
- Add validateToolParams method with clear error messages - Fix failing tests to expect new parameter validation errors - Create comprehensive parameter validation test suite (52 tests) - Add parameter validation for all n8n management tools - Test numeric parameter conversion and edge cases - Ensure consistent error format across all tools - Verify MCP error response handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -63,8 +63,8 @@ describe('MCP Error Handling', () => {
|
||||
expect.fail('Should have thrown an error');
|
||||
} catch (error: any) {
|
||||
expect(error).toBeDefined();
|
||||
// The error occurs when trying to call startsWith on undefined nodeType
|
||||
expect(error.message).toContain("Cannot read properties of undefined");
|
||||
// The error now properly validates required parameters
|
||||
expect(error.message).toContain("Missing required parameters");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -500,8 +500,8 @@ describe('MCP Error Handling', () => {
|
||||
expect.fail('Should have thrown an error');
|
||||
} catch (error: any) {
|
||||
expect(error).toBeDefined();
|
||||
// The error occurs when trying to access properties of undefined query
|
||||
expect(error.message).toContain("Cannot read properties of undefined");
|
||||
// The error now properly validates required parameters
|
||||
expect(error.message).toContain("Missing required parameters");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user