Skip to content

Commit eb5eeed

Browse files
committed
add await to get token url before using
1 parent e3c641f commit eb5eeed

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/servers/mcp-server-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ export abstract class BaseMCPServer extends Server {
171171
return tokenUrl;
172172
}
173173

174-
protected getAnswerContent = (answer: any, question: string) => {
175-
const tokenUrl = this.getTokenUrl(answer.session_identifier, answer.generation_number);
174+
protected async getAnswerContent(answer: any, question: string) {
175+
const tokenUrl = await this.getTokenUrl(answer.session_identifier, answer.generation_number);
176176
console.log(`[DEBUG] question: ${question} tokenUrl: ${tokenUrl}`);
177177
return `Data: ${answer.data}
178178

src/servers/mcp-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class MCPServer extends BaseMCPServer {
230230
}
231231

232232
const content = [
233-
{ type: "text" as const, text: this.getAnswerContent(answer, question) },
233+
{ type: "text" as const, text: await this.getAnswerContent(answer, question) },
234234
{
235235
type: "text" as const,
236236
text: `Question: ${question}\nSession Identifier: ${answer.session_identifier}\nGeneration Number: ${answer.generation_number}\n\nUse this information to create a liveboard with the createLiveboard tool, if the user asks.`,

src/servers/openai-mcp-server.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,11 @@ export class OpenAIDeepResearchMCPServer extends BaseMCPServer {
131131
const { id } = fetchInputSchema.parse(request.params.arguments);
132132
// id is of the form "<datasource-id>:<question>"
133133
const [datasourceId, question = ""] = id.split(":");
134-
const thoughtSpotService = this.getThoughtSpotService();
135-
const answer = await thoughtSpotService.getAnswerForQuestion(question, datasourceId, false);
134+
const answer = await this.getThoughtSpotService().getAnswerForQuestion(question, datasourceId, false);
136135
if (answer.error) {
137136
return this.createErrorResponse(answer.error.message, `Error getting answer ${answer.error.message}`);
138137
}
139-
const content = this.getAnswerContent(answer, question);
138+
const content = await this.getAnswerContent(answer, question);
140139
const result = {
141140
id,
142141
title: question,

0 commit comments

Comments
 (0)