Skip to content

Commit 5771a98

Browse files
Fj-ivyfangjie33
authored andcommitted
SyncMcpToolCallback call method NPE
Signed-off-by: fangjie33 <[email protected]>
1 parent dcc9148 commit 5771a98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public String call(String functionInput) {
113113
// Note that we use the original tool name here, not the adapted one from
114114
// getToolDefinition
115115
CallToolResult response = this.mcpClient.callTool(new CallToolRequest(this.tool.name(), arguments));
116-
if (response.isError()) {
116+
if (response.isError() != null && response.isError()) {
117117
throw new IllegalStateException("Error calling tool: " + response.content());
118118
}
119119
return ModelOptionsUtils.toJsonString(response.content());

0 commit comments

Comments
 (0)