Skip to content

Commit f4bec2c

Browse files
committed
Tweak tool descriptions
1 parent 1415205 commit f4bec2c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/tools/assistant/listKnowledgeSources.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ export type ListKnowledgeSourcesResponse = {
2222
dataSources: KnowledgeSource[];
2323
};
2424

25+
export const ListKnowledgeSourcesToolName = "list-knowledge-sources";
26+
2527
export class ListKnowledgeSourcesTool extends AssistantToolBase {
26-
public name = "list-knowledge-sources";
28+
public name = ListKnowledgeSourcesToolName;
2729
protected description = "List available data sources in the MongoDB Assistant knowledge base";
2830
protected argsShape = {};
2931
public operationType: OperationType = "read";

src/tools/assistant/searchKnowledge.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ import { type ToolArgs, type OperationType, formatUntrustedData } from "../tool.
44
import { AssistantToolBase } from "./assistantTool.js";
55
import { LogId } from "../../common/logger.js";
66
import { stringify as yamlStringify } from "yaml";
7+
import { ListKnowledgeSourcesToolName } from "./listKnowledgeSources.js";
78

89
export const SearchKnowledgeToolArgs = {
9-
query: z.string().describe("A natural language query to search for in the knowledge base"),
10+
query: z
11+
.string()
12+
.describe(
13+
"A natural language query to search for in the MongoDB Assistant knowledge base. This should be a single question or a topic that is relevant to the user's MongoDB use case."
14+
),
1015
limit: z.number().min(1).max(100).optional().default(5).describe("The maximum number of results to return"),
1116
dataSources: z
1217
.array(
@@ -17,7 +22,7 @@ export const SearchKnowledgeToolArgs = {
1722
)
1823
.optional()
1924
.describe(
20-
"A list of one or more data sources to search in. You can specify a specific version of a data source by providing the version label. If not provided, the latest version of all data sources will be searched."
25+
`A list of one or more data sources to limit the search to. You can specify a specific version of a data source by providing the version label. If not provided, the latest version of all data sources will be searched. Available data sources and their versions can be listed by calling the ${ListKnowledgeSourcesToolName} tool.`
2126
),
2227
};
2328

0 commit comments

Comments
 (0)