Merge pull request #553 from koic/suppress_rubocop_offense

Fix a redundant regexp escape in the tool name validation
This commit is contained in:
Koichi ITO 2026-09-16 00:44:04 +09:00 • committed by GitHub
commit 41fbf05d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -149,7 +149,7 @@ module MCP
raise ArgumentError, "Tool names should be between 1 and 128 characters in length (inclusive)."
end
unless tool_name.match?(/\A[A-Za-z\d_\-\.]+\z/)
unless tool_name.match?(/\A[A-Za-z\d_\-.]+\z/)
raise ArgumentError, <<~MESSAGE
Tool names only allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.).
MESSAGE