feat: implement tool name and parameter validation system with eslint integration #337
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.
Fix Claude API Errors with Tool Name Validation
This PR fixes a problem where the Azure DevOps MCP server was getting error messages from Claude API because some tool names didn't follow the required format. Claude API is very strict about tool names, they can only contain letters, numbers, underscores, dots, and dashes, and must be 64 characters or less. When tool names don't follow these rules, Claude returns a 400 error and refuses to work.
To solve this, we added validation that checks all tool names before they get sent to Claude. The validation happens in three places: when you're writing code (through ESLint), when you build the project, and when tests run. We tested all 60+ existing tools in the project and they all pass the validation. The longest tool name is only 40 characters, so we're well within the limits.
The validation code is organized so there's no duplication, one shared module handles all the checking logic. We also added comprehensive tests to make sure the validation works correctly, and wrote documentation to help developers understand the naming rules. This prevents future API errors and makes the development process smoother since developers get immediate feedback when they use invalid tool names.
Example linter error while developing;
Output of validation for current tools;
GitHub issue number
Fixes #332
Associated Risks
None
✅ PR Checklist
🧪 How did you test it?
Run
npm run validate-tools
command