Add load_mcp_documentation tool (#2703)

* Add load_mcp_documentation tool

* Create fluffy-toys-punch.md
This commit is contained in:
Saoud Rizwan authored and GitHub committed 2025-04-07 22:10:16 -07:00
1 parent 95120bb050
commit 0b95ad3bae
11 files changed
+421 -431

No files matched your search

+25
View File
@@ -78,6 +78,7 @@ import {
saveClineMessages,
GlobalFileNames,
} from "../storage/disk"
import { loadMcpDocumentation } from "../prompts/loadMcpDocumentation"
const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution
@@ -1455,6 +1456,8 @@ export class Task {
return `[${block.name} for '${block.params.question}']`
case "plan_mode_respond":
return `[${block.name}]`
case "load_mcp_documentation":
return `[${block.name}]`
case "attempt_completion":
return `[${block.name}]`
}
@@ -2799,6 +2802,28 @@ export class Task {
break
}
}
case "load_mcp_documentation": {
try {
if (block.partial) {
// shouldn't happen
break
} else {
await this.say("load_mcp_documentation", "", undefined, false)
const mcpHub = this.controllerRef.deref()?.mcpHub
if (!mcpHub) {
throw new Error("MCP hub not available")
}
pushToolResult(await loadMcpDocumentation(mcpHub))
break
}
} catch (error) {
await handleError("loading MCP documentation", error)
break
}
}
case "attempt_completion": {
/*
this.consecutiveMistakeCount = 0