Skip to content

Commit 688ad56

Browse files
committed
fix: linting
1 parent 7bf120e commit 688ad56

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/tools/mongodb/metadata/explain.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class ExplainTool extends MongoDBToolBase {
4343
collection,
4444
method: methods,
4545
}: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
46-
const provider = this.ensureConnected();
46+
const provider = await this.ensureConnected();
4747
const method = methods[0];
4848

4949
if (!method) {
@@ -60,7 +60,7 @@ export class ExplainTool extends MongoDBToolBase {
6060
case "find": {
6161
const { filter, ...rest } = method.arguments;
6262
result = await provider
63-
.find(database, collection, filter, { ...rest })
63+
.find(database, collection, filter as Document, { ...rest })
6464
.explain(ExplainTool.defaultVerbosity);
6565
break;
6666
}
@@ -72,14 +72,12 @@ export class ExplainTool extends MongoDBToolBase {
7272
})) as unknown as Document;
7373
break;
7474
}
75-
default:
76-
throw new Error(`Unsupported method: ${method}`);
7775
}
7876

7977
return {
8078
content: [
8179
{
82-
text: `Here is some information about the winning plan chosen by the query optimizer for running the given \`${method}\` operation in \`${database}.${collection}\`. This information can be used to understand how the query was executed and to optimize the query performance.`,
80+
text: `Here is some information about the winning plan chosen by the query optimizer for running the given \`${method.name}\` operation in \`${database}.${collection}\`. This information can be used to understand how the query was executed and to optimize the query performance.`,
8381
type: "text",
8482
},
8583
{

0 commit comments

Comments
 (0)