Skip to content

Commit e7cc6f5

Browse files
google-genai-botcopybara-github
authored andcommitted
refactor: simplify McpSessionManager.initializeSession()
PiperOrigin-RevId: 784312942
1 parent 55b87ee commit e7cc6f5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

core/src/main/java/com/google/adk/tools/mcp/McpSessionManager.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,7 @@ public McpSyncClient createSession() {
4646
}
4747

4848
public static McpSyncClient initializeSession(Object connectionParams) {
49-
McpClientTransport transport = new DefaultMcpTransportBuilder().build(connectionParams);
50-
McpSyncClient client =
51-
McpClient.sync(transport)
52-
.requestTimeout(Duration.ofSeconds(10))
53-
.capabilities(ClientCapabilities.builder().build())
54-
.build();
55-
InitializeResult initResult = client.initialize();
56-
logger.debug("Initialize Client Result: {}", initResult);
57-
return client;
49+
return initializeSession(connectionParams, new DefaultMcpTransportBuilder());
5850
}
5951

6052
public static McpSyncClient initializeSession(

0 commit comments

Comments
 (0)