Skip to content

Commit f1b6bb6

Browse files
committed
SCAL-317889 Add a validation of TS connection test for Ping/Check connectivity tools
1 parent d672649 commit f1b6bb6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/servers/mcp-server.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ export class MCPServer extends BaseMCPServer {
192192
switch (name) {
193193
case ToolName.Ping: {
194194
if (this.ctx.props.accessToken && this.ctx.props.instanceUrl) {
195+
if (!this.getThoughtSpotService(recorder).validateConnection()) {
196+
return this.createErrorResponse(
197+
"Failed to validate connection",
198+
"Ping failed",
199+
);
200+
}
195201
return this.createSuccessResponse("Pong", "Ping successful");
196202
}
197203
return this.createErrorResponse("Not authenticated", "Ping failed");
@@ -220,6 +226,12 @@ export class MCPServer extends BaseMCPServer {
220226
"Check connectivity failed",
221227
);
222228
}
229+
if (!this.getThoughtSpotService(recorder).validateConnection()) {
230+
return this.createErrorResponse(
231+
"Failed to validate connection",
232+
"Check connectivity failed",
233+
);
234+
}
223235
return this.createStructuredContentSuccessResponse(
224236
{ success: true },
225237
"Check connectivity successful",

0 commit comments

Comments
 (0)