Skip to content

Commit 0cc535e

Browse files
fix: typo specification
1 parent 3756e16 commit 0cc535e

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

mcp/common/src/main/java/org/springframework/ai/mcp/McpToolUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ public static String prefixedToolName(String prefix, String toolName) {
9393
}
9494

9595
/**
96-
* Converts a list of Spring AI tool callbacks to MCP synchronous tool specificaiton.
96+
* Converts a list of Spring AI tool callbacks to MCP synchronous tool specification.
9797
* <p>
9898
* This method processes multiple tool callbacks in bulk, converting each one to its
9999
* corresponding MCP tool registration while maintaining synchronous execution
100100
* semantics.
101101
* @param toolCallbacks the list of tool callbacks to convert
102-
* @return a list of MCP synchronous tool specificaiton
102+
* @return a list of MCP synchronous tool specification
103103
*/
104104
public static List<McpServerFeatures.SyncToolSpecification> toSyncToolSpecification(
105105
List<ToolCallback> toolCallbacks) {
@@ -113,7 +113,7 @@ public static List<McpServerFeatures.SyncToolSpecification> toSyncToolSpecificat
113113
* This is a varargs wrapper around {@link #toSyncToolSpecification(List)} for easier
114114
* usage when working with individual callbacks.
115115
* @param toolCallbacks the tool callbacks to convert
116-
* @return a list of MCP synchronous tool specificaiton
116+
* @return a list of MCP synchronous tool specification
117117
*/
118118
public static List<McpServerFeatures.SyncToolSpecification> toSyncToolSpecifications(
119119
ToolCallback... toolCallbacks) {
@@ -201,7 +201,7 @@ public static Optional<McpSyncServerExchange> getMcpExchange(ToolContext toolCon
201201
}
202202

203203
/**
204-
* Converts a list of Spring AI tool callbacks to MCP asynchronous tool specificaiton.
204+
* Converts a list of Spring AI tool callbacks to MCP asynchronous tool specification.
205205
* <p>
206206
* This method processes multiple tool callbacks in bulk, converting each one to its
207207
* corresponding MCP tool registration while adding asynchronous execution
@@ -217,7 +217,7 @@ public static List<McpServerFeatures.AsyncToolSpecification> toAsyncToolSpecific
217217

218218
/**
219219
* Convenience method to convert a variable number of tool callbacks to MCP
220-
* asynchronous tool specificaiton.
220+
* asynchronous tool specification.
221221
* <p>
222222
* This is a varargs wrapper around {@link #toAsyncToolSpecifications(List)} for
223223
* easier usage when working with individual callbacks.
@@ -264,13 +264,13 @@ public static McpServerFeatures.AsyncToolSpecification toAsyncToolSpecification(
264264
* This method enables Spring AI tools to be exposed as asynchronous MCP tools that
265265
* can be discovered and invoked by language models. The conversion process:
266266
* <ul>
267-
* <li>First converts the callback to a synchronous specificaiton</li>
267+
* <li>First converts the callback to a synchronous specification</li>
268268
* <li>Wraps the synchronous execution in a reactive Mono</li>
269269
* <li>Configures execution on a bounded elastic scheduler for non-blocking
270270
* operation</li>
271271
* </ul>
272272
* <p>
273-
* The resulting async specificaiton will:
273+
* The resulting async specification will:
274274
* <ul>
275275
* <li>Execute the tool without blocking the calling thread</li>
276276
* <li>Handle errors and results asynchronously</li>

mcp/common/src/test/java/org/springframework/ai/mcp/ToolUtilsTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void constructorShouldBePrivate() throws Exception {
9797
}
9898

9999
@Test
100-
void toSyncToolSpecificaitonShouldConvertSingleCallback() {
100+
void toSyncToolSpecificationShouldConvertSingleCallback() {
101101

102102
ToolCallback callback = createMockToolCallback("test", "success");
103103

@@ -138,7 +138,7 @@ void toSyncToolSpecificationShouldConvertMultipleCallbacks() {
138138
}
139139

140140
@Test
141-
void toAsyncToolSpecificaitonShouldConvertSingleCallback() {
141+
void toAsyncToolSpecificationShouldConvertSingleCallback() {
142142
ToolCallback callback = createMockToolCallback("test", "success");
143143

144144
AsyncToolSpecification toolSpecification = McpToolUtils.toAsyncToolSpecification(callback);
@@ -160,10 +160,10 @@ void toAsyncToolSpecificaitonShouldConvertSingleCallback() {
160160
void toAsyncToolSpecificationShouldHandleError() {
161161
ToolCallback callback = createMockToolCallback("test", new RuntimeException("error"));
162162

163-
AsyncToolSpecification toolSpecificaiton = McpToolUtils.toAsyncToolSpecification(callback);
163+
AsyncToolSpecification toolSpecification = McpToolUtils.toAsyncToolSpecification(callback);
164164

165-
assertThat(toolSpecificaiton).isNotNull();
166-
StepVerifier.create(toolSpecificaiton.call().apply(mock(McpAsyncServerExchange.class), Map.of()))
165+
assertThat(toolSpecification).isNotNull();
166+
StepVerifier.create(toolSpecification.call().apply(mock(McpAsyncServerExchange.class), Map.of()))
167167
.assertNext(result -> {
168168
TextContent content = (TextContent) result.content().get(0);
169169
assertThat(content.text()).isEqualTo("error");

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/mcp/mcp-helpers.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ Async::
115115
[source,java]
116116
----
117117
List<ToolCallback> toolCallbacks = // obtain tool callbacks
118-
List<AsyncToolSpecification> asyncToolSpecificaitons = McpToolUtils.toAsyncToolSpecifications(toolCallbacks);
118+
List<AsyncToolSpecification> asyncToolSpecifications = McpToolUtils.toAsyncToolSpecifications(toolCallbacks);
119119
----
120120
+
121121
then you can use the `McpServer.AsyncSpecification` to register the tool specifications:
122122
+
123123
[source,java]
124124
----
125125
McpServer.AsyncSpecification asyncSpec = ...
126-
asyncSpec.tools(asyncToolSpecificaitons);
126+
asyncSpec.tools(asyncToolSpecifications);
127127
----
128128
======
129129

0 commit comments

Comments
 (0)