@@ -286,7 +286,7 @@ abstract class AsyncSpecification<S extends AsyncSpecification<S>> {
286286
287287 String instructions ;
288288
289- Boolean skipStrictToolNameValidation ;
289+ boolean strictToolNameValidation = ToolNameValidator . isStrictByDefault () ;
290290
291291 /**
292292 * The Model Context Protocol (MCP) allows servers to expose tools that can be
@@ -405,14 +405,14 @@ public AsyncSpecification<S> instructions(String instructions) {
405405 }
406406
407407 /**
408- * Sets whether to skip strict tool name validation for this server. When set,
409- * this takes priority over the system property
410- * {@code io.modelcontextprotocol.skipStrictToolNameValidation }.
411- * @param skip true to warn only, false to throw exception on invalid names
408+ * Sets whether to use strict tool name validation for this server. When set, this
409+ * takes priority over the system property
410+ * {@code io.modelcontextprotocol.strictToolNameValidation }.
411+ * @param strict true to throw exception on invalid names and false to warn only
412412 * @return This builder instance for method chaining
413413 */
414- public AsyncSpecification <S > skipStrictToolNameValidation (boolean strict ) {
415- this .skipStrictToolNameValidation = strict ;
414+ public AsyncSpecification <S > strictToolNameValidation (boolean strict ) {
415+ this .strictToolNameValidation = strict ;
416416 return this ;
417417 }
418418
@@ -553,7 +553,7 @@ public AsyncSpecification<S> tools(McpServerFeatures.AsyncToolSpecification... t
553553 }
554554
555555 private void validateToolName (String toolName ) {
556- ToolNameValidator .validate (toolName , this .skipStrictToolNameValidation );
556+ ToolNameValidator .validate (toolName , this .strictToolNameValidation );
557557 }
558558
559559 private void assertNoDuplicateTool (String toolName ) {
@@ -905,7 +905,7 @@ abstract class SyncSpecification<S extends SyncSpecification<S>> {
905905
906906 String instructions ;
907907
908- Boolean skipStrictToolNameValidation ;
908+ boolean strictToolNameValidation = ToolNameValidator . isStrictByDefault () ;
909909
910910 /**
911911 * The Model Context Protocol (MCP) allows servers to expose tools that can be
@@ -1028,14 +1028,14 @@ public SyncSpecification<S> instructions(String instructions) {
10281028 }
10291029
10301030 /**
1031- * Sets whether to skip strict tool name validation for this server. When set,
1032- * this takes priority over the system property
1033- * {@code io.modelcontextprotocol.skipStrictToolNameValidation }.
1034- * @param skip true to warn only, false to throw exception on invalid names
1031+ * Sets whether to use strict tool name validation for this server. When set, this
1032+ * takes priority over the system property
1033+ * {@code io.modelcontextprotocol.strictToolNameValidation }.
1034+ * @param strict true to throw exception on invalid names, false to warn only
10351035 * @return This builder instance for method chaining
10361036 */
1037- public SyncSpecification <S > skipStrictToolNameValidation (boolean strict ) {
1038- this .skipStrictToolNameValidation = strict ;
1037+ public SyncSpecification <S > strictToolNameValidation (boolean strict ) {
1038+ this .strictToolNameValidation = strict ;
10391039 return this ;
10401040 }
10411041
@@ -1175,7 +1175,7 @@ public SyncSpecification<S> tools(McpServerFeatures.SyncToolSpecification... too
11751175 }
11761176
11771177 private void validateToolName (String toolName ) {
1178- ToolNameValidator .validate (toolName , this .skipStrictToolNameValidation );
1178+ ToolNameValidator .validate (toolName , this .strictToolNameValidation );
11791179 }
11801180
11811181 private void assertNoDuplicateTool (String toolName ) {
@@ -1473,7 +1473,7 @@ class StatelessAsyncSpecification {
14731473
14741474 String instructions ;
14751475
1476- Boolean skipStrictToolNameValidation ;
1476+ boolean strictToolNameValidation = ToolNameValidator . isStrictByDefault () ;
14771477
14781478 /**
14791479 * The Model Context Protocol (MCP) allows servers to expose tools that can be
@@ -1593,14 +1593,14 @@ public StatelessAsyncSpecification instructions(String instructions) {
15931593 }
15941594
15951595 /**
1596- * Sets whether to skip strict tool name validation for this server. When set,
1597- * this takes priority over the system property
1598- * {@code io.modelcontextprotocol.skipStrictToolNameValidation }.
1599- * @param skip true to warn only, false to throw exception on invalid names
1596+ * Sets whether to use strict tool name validation for this server. When set, this
1597+ * takes priority over the system property
1598+ * {@code io.modelcontextprotocol.strictToolNameValidation }.
1599+ * @param strict true to throw exception on invalid names, false to warn only
16001600 * @return This builder instance for method chaining
16011601 */
1602- public StatelessAsyncSpecification skipStrictToolNameValidation (boolean strict ) {
1603- this .skipStrictToolNameValidation = strict ;
1602+ public StatelessAsyncSpecification strictToolNameValidation (boolean strict ) {
1603+ this .strictToolNameValidation = strict ;
16041604 return this ;
16051605 }
16061606
@@ -1702,7 +1702,7 @@ public StatelessAsyncSpecification tools(
17021702 }
17031703
17041704 private void validateToolName (String toolName ) {
1705- ToolNameValidator .validate (toolName , this .skipStrictToolNameValidation );
1705+ ToolNameValidator .validate (toolName , this .strictToolNameValidation );
17061706 }
17071707
17081708 private void assertNoDuplicateTool (String toolName ) {
@@ -1956,7 +1956,7 @@ class StatelessSyncSpecification {
19561956
19571957 String instructions ;
19581958
1959- Boolean skipStrictToolNameValidation ;
1959+ boolean strictToolNameValidation = ToolNameValidator . isStrictByDefault () ;
19601960
19611961 /**
19621962 * The Model Context Protocol (MCP) allows servers to expose tools that can be
@@ -2076,14 +2076,14 @@ public StatelessSyncSpecification instructions(String instructions) {
20762076 }
20772077
20782078 /**
2079- * Sets whether to skip strict tool name validation for this server. When set,
2080- * this takes priority over the system property
2081- * {@code io.modelcontextprotocol.skipStrictToolNameValidation }.
2082- * @param skip true to warn only, false to throw exception on invalid names
2079+ * Sets whether to use strict tool name validation for this server. When set, this
2080+ * takes priority over the system property
2081+ * {@code io.modelcontextprotocol.strictToolNameValidation }.
2082+ * @param strict true to throw exception on invalid names, false to warn only
20832083 * @return This builder instance for method chaining
20842084 */
2085- public StatelessSyncSpecification skipStrictToolNameValidation (boolean strict ) {
2086- this .skipStrictToolNameValidation = strict ;
2085+ public StatelessSyncSpecification strictToolNameValidation (boolean strict ) {
2086+ this .strictToolNameValidation = strict ;
20872087 return this ;
20882088 }
20892089
@@ -2185,7 +2185,7 @@ public StatelessSyncSpecification tools(
21852185 }
21862186
21872187 private void validateToolName (String toolName ) {
2188- ToolNameValidator .validate (toolName , this .skipStrictToolNameValidation );
2188+ ToolNameValidator .validate (toolName , this .strictToolNameValidation );
21892189 }
21902190
21912191 private void assertNoDuplicateTool (String toolName ) {
0 commit comments