@@ -31,20 +31,20 @@ describe('validateToolName', () => {
3131 expect ( result . warnings ) . toHaveLength ( 0 ) ;
3232 } ) ;
3333
34- test ( 'should reject names with dots' , ( ) => {
34+ test ( 'should accept names with dots' , ( ) => {
3535 const result = validateToolName ( 'admin.tools.list' ) ;
36- expect ( result . isValid ) . toBe ( false ) ;
37- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "."' ) ;
36+ expect ( result . isValid ) . toBe ( true ) ;
37+ expect ( result . warnings ) . toHaveLength ( 0 ) ;
3838 } ) ;
3939
40- test ( 'should reject names with forward slashes' , ( ) => {
40+ test ( 'should accept names with forward slashes' , ( ) => {
4141 const result = validateToolName ( 'user/profile/update' ) ;
42- expect ( result . isValid ) . toBe ( false ) ;
43- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "/"' ) ;
42+ expect ( result . isValid ) . toBe ( true ) ;
43+ expect ( result . warnings ) . toHaveLength ( 0 ) ;
4444 } ) ;
4545
4646 test ( 'should accept mixed character names' , ( ) => {
47- const result = validateToolName ( 'DATA_EXPORT_v2- 1' ) ;
47+ const result = validateToolName ( 'DATA_EXPORT_v2. 1' ) ;
4848 expect ( result . isValid ) . toBe ( true ) ;
4949 expect ( result . warnings ) . toHaveLength ( 0 ) ;
5050 } ) ;
@@ -55,8 +55,8 @@ describe('validateToolName', () => {
5555 expect ( result . warnings ) . toHaveLength ( 0 ) ;
5656 } ) ;
5757
58- test ( 'should accept 64 character names' , ( ) => {
59- const name = 'a' . repeat ( 64 ) ;
58+ test ( 'should accept 128 character names' , ( ) => {
59+ const name = 'a' . repeat ( 128 ) ;
6060 const result = validateToolName ( name ) ;
6161 expect ( result . isValid ) . toBe ( true ) ;
6262 expect ( result . warnings ) . toHaveLength ( 0 ) ;
@@ -70,11 +70,11 @@ describe('validateToolName', () => {
7070 expect ( result . warnings ) . toContain ( 'Tool name cannot be empty' ) ;
7171 } ) ;
7272
73- test ( 'should reject names longer than 64 characters' , ( ) => {
74- const name = 'a' . repeat ( 65 ) ;
73+ test ( 'should reject names longer than 128 characters' , ( ) => {
74+ const name = 'a' . repeat ( 129 ) ;
7575 const result = validateToolName ( name ) ;
7676 expect ( result . isValid ) . toBe ( false ) ;
77- expect ( result . warnings ) . toContain ( 'Tool name exceeds maximum length of 64 characters (current: 65 )' ) ;
77+ expect ( result . warnings ) . toContain ( 'Tool name exceeds maximum length of 128 characters (current: 129 )' ) ;
7878 } ) ;
7979
8080 test ( 'should reject names with spaces' , ( ) => {
@@ -92,7 +92,7 @@ describe('validateToolName', () => {
9292 test ( 'should reject names with other special characters' , ( ) => {
9393 const result = validateToolName ( 'user@domain.com' ) ;
9494 expect ( result . isValid ) . toBe ( false ) ;
95- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "@", "." ' ) ;
95+ expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "@"' ) ;
9696 } ) ;
9797
9898 test ( 'should reject names with multiple invalid characters' , ( ) => {
@@ -133,22 +133,22 @@ describe('validateToolName', () => {
133133 expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dash, which may cause parsing issues in some contexts' ) ;
134134 } ) ;
135135
136- test ( 'should reject names starting with dot' , ( ) => {
136+ test ( 'should warn about names starting with dot' , ( ) => {
137137 const result = validateToolName ( '.get.user' ) ;
138- expect ( result . isValid ) . toBe ( false ) ;
139- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "." ' ) ;
138+ expect ( result . isValid ) . toBe ( true ) ;
139+ expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dot, which may cause parsing issues in some contexts ' ) ;
140140 } ) ;
141141
142- test ( 'should reject names ending with dot' , ( ) => {
142+ test ( 'should warn about names ending with dot' , ( ) => {
143143 const result = validateToolName ( 'get.user.' ) ;
144- expect ( result . isValid ) . toBe ( false ) ;
145- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "." ' ) ;
144+ expect ( result . isValid ) . toBe ( true ) ;
145+ expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dot, which may cause parsing issues in some contexts ' ) ;
146146 } ) ;
147147
148- test ( 'should reject names with both leading and trailing dots' , ( ) => {
148+ test ( 'should warn about names with both leading and trailing dots' , ( ) => {
149149 const result = validateToolName ( '.get.user.' ) ;
150- expect ( result . isValid ) . toBe ( false ) ;
151- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "." ' ) ;
150+ expect ( result . isValid ) . toBe ( true ) ;
151+ expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dot, which may cause parsing issues in some contexts ' ) ;
152152 } ) ;
153153 } ) ;
154154} ) ;
@@ -202,18 +202,18 @@ describe('validateAndWarnToolName', () => {
202202 } ) ;
203203
204204 test ( 'should return false for names exceeding length limit' , ( ) => {
205- const longName = 'a' . repeat ( 65 ) ;
205+ const longName = 'a' . repeat ( 129 ) ;
206206 const result = validateAndWarnToolName ( longName ) ;
207207 expect ( result ) . toBe ( false ) ;
208208 expect ( warnSpy ) . toHaveBeenCalled ( ) ; // Now issues warnings instead of errors
209209 } ) ;
210210} ) ;
211211
212212describe ( 'edge cases and robustness' , ( ) => {
213- test ( 'should reject names with only dots' , ( ) => {
213+ test ( 'should warn about names with only dots' , ( ) => {
214214 const result = validateToolName ( '...' ) ;
215- expect ( result . isValid ) . toBe ( false ) ;
216- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "." ' ) ;
215+ expect ( result . isValid ) . toBe ( true ) ;
216+ expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dot, which may cause parsing issues in some contexts ' ) ;
217217 } ) ;
218218
219219 test ( 'should handle names with only dashes' , ( ) => {
@@ -222,10 +222,10 @@ describe('edge cases and robustness', () => {
222222 expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a dash, which may cause parsing issues in some contexts' ) ;
223223 } ) ;
224224
225- test ( 'should reject names with only forward slashes' , ( ) => {
225+ test ( 'should warn about names with only forward slashes' , ( ) => {
226226 const result = validateToolName ( '///' ) ;
227- expect ( result . isValid ) . toBe ( false ) ;
228- expect ( result . warnings ) . toContain ( 'Tool name contains invalid characters: "/" ' ) ;
227+ expect ( result . isValid ) . toBe ( true ) ;
228+ expect ( result . warnings ) . toContain ( 'Tool name starts or ends with a slash, which may cause parsing issues in some contexts ' ) ;
229229 } ) ;
230230
231231 test ( 'should handle names with mixed valid and invalid characters' , ( ) => {
0 commit comments