Skip to content

Commit cd624a7

Browse files
oleksandr-popovtzolov
authored andcommitted
fix: correct typos and improve documentation (#35)
Signed-off-by: Christian Tzolov <[email protected]>
1 parent c3a7c1a commit cd624a7

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

mcp/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<scope>test</scope>
9898
</dependency>
9999

100-
<!-- The Spring Context is required due to the reactor-netty connector being dependant on
100+
<!-- The Spring Context is required due to the reactor-netty connector being dependent on
101101
the Spring Lifecycle, as discussed here:
102102
https://github.com/spring-projects/spring-framework/issues/31180 -->
103103
<dependency>

mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ private <T> Mono<T> withInitializationCheck(String actionName,
364364
}
365365

366366
// --------------------------
367-
// Basic Utilites
367+
// Basic Utilities
368368
// --------------------------
369369

370370
/**
@@ -751,6 +751,14 @@ private NotificationHandler asyncPromptsChangeNotificationHandler(
751751
// --------------------------
752752
// Logging
753753
// --------------------------
754+
/**
755+
* Create a notification handler for logging notifications from the server. This
756+
* handler automatically distributes logging messages to all registered consumers.
757+
* @param loggingConsumers List of consumers that will be notified when a logging
758+
* message is received. Each consumer receives the logging message notification.
759+
* @return A NotificationHandler that processes log notifications by distributing the
760+
* message to all registered consumers
761+
*/
754762
private NotificationHandler asyncLoggingNotificationHandler(
755763
List<Function<LoggingMessageNotification, Mono<Void>>> loggingConsumers) {
756764

mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientSseClientTransport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public Mono<Void> closeGracefully() {
376376
}
377377

378378
/**
379-
* Unmarshals data to the specified type using the configured object mapper.
379+
* Unmarshal data to the specified type using the configured object mapper.
380380
* @param data the data to unmarshal
381381
* @param typeRef the type reference for the target type
382382
* @param <T> the target type

mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private void startInboundProcessing() {
292292
*/
293293
private void startOutboundProcessing() {
294294
this.handleOutbound(messages -> messages
295-
// this bit is important since writes come from user threads and we
295+
// this bit is important since writes come from user threads, and we
296296
// want to ensure that the actual writing happens on a dedicated thread
297297
.publishOn(outboundScheduler)
298298
.handle((message, s) -> {

mcp/src/main/java/io/modelcontextprotocol/spec/McpClientSession.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public interface NotificationHandler {
107107
public McpClientSession(Duration requestTimeout, McpClientTransport transport,
108108
Map<String, RequestHandler<?>> requestHandlers, Map<String, NotificationHandler> notificationHandlers) {
109109

110-
Assert.notNull(requestTimeout, "The requstTimeout can not be null");
110+
Assert.notNull(requestTimeout, "The requestTimeout can not be null");
111111
Assert.notNull(transport, "The transport can not be null");
112112
Assert.notNull(requestHandlers, "The requestHandlers can not be null");
113113
Assert.notNull(notificationHandlers, "The notificationHandlers can not be null");
@@ -127,7 +127,7 @@ public McpClientSession(Duration requestTimeout, McpClientTransport transport,
127127
logger.debug("Received Response: {}", response);
128128
var sink = pendingResponses.remove(response.id());
129129
if (sink == null) {
130-
logger.warn("Unexpected response for unkown id {}", response.id());
130+
logger.warn("Unexpected response for unknown id {}", response.id());
131131
}
132132
else {
133133
sink.success(response);

mcp/src/test/java/io/modelcontextprotocol/spec/McpClientSessionTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void tearDown() {
6161
void testConstructorWithInvalidArguments() {
6262
assertThatThrownBy(() -> new McpClientSession(null, transport, Map.of(), Map.of()))
6363
.isInstanceOf(IllegalArgumentException.class)
64-
.hasMessageContaining("requstTimeout can not be null");
64+
.hasMessageContaining("The requestTimeout can not be null");
6565

6666
assertThatThrownBy(() -> new McpClientSession(TIMEOUT, null, Map.of(), Map.of()))
6767
.isInstanceOf(IllegalArgumentException.class)

0 commit comments

Comments
 (0)