You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [WIP] Add getDataSourceSuggestions tool
* make sure datasource discovery tool is invoked only if cluster version is > 10.13.0.cl
* address comments
* add test for number of tools returned
query: z.string().describe(`The query to get data source suggestions for, this could be a high level task or question the user is asking or hoping to get answered.
71
+
There can be multiple data sources. Each data source can be used to get the data for the user's query using the other tools getRelevantQuestions and getAnswer.`),
@@ -120,7 +126,17 @@ export class MCPServer extends BaseMCPServer {
120
126
readOnlyHint: true,
121
127
destructiveHint: false,
122
128
},
123
-
}
129
+
},
130
+
...(this.isDatasourceDiscoveryAvailable() ? [{
131
+
name: ToolName.GetDataSourceSuggestions,
132
+
description: "Get data source suggestions for a query. Use this tool only if there is not datasource id provided in the context or the users query. If mulitple data sources are returned, and the confidence difference between the top two data sources is less than 0.3, ask the user to select the most relevant data source. Otherwise use the data source with the highest confidence to get the relevant questions and answers for the query.",
returnthis.createSuccessResponse("No relevant data sources found, please provide a datasource id in the query");
130
+
}
131
+
constresults=dataSources.map(d=>({
132
+
id: `datasource:///${d.header.guid}`,
133
+
title: d.header.displayName,
134
+
text: `Datasource Description: ${d.header.description}. Confidence that this datasource is relevant to the query: ${d.confidence}. Reasoning for the confidence: ${d.llmReasoning}.
135
+
Use this datasource to search for relevant questions and to get answers for the questions.
136
+
Use the search tool to search for relevant questions with the format "datasource:<id> <query-with-spaces>" and the fetch tool to get answers for the questions.`,
0 commit comments