batch: enable edit, todoread, clarify error message, minor tool description change (#5659)

This commit is contained in:
Spoon
2025-12-17 17:23:35 +01:00
committed by GitHub
parent 1b39199083
commit 8864da7a77
2 changed files with 14 additions and 16 deletions

View File

@@ -2,7 +2,7 @@ import z from "zod"
import { Tool } from "./tool"
import DESCRIPTION from "./batch.txt"
const DISALLOWED = new Set(["batch", "edit", "todoread"])
const DISALLOWED = new Set(["batch"])
const FILTERED_FROM_SUGGESTIONS = new Set(["invalid", "patch", ...DISALLOWED])
export const BatchTool = Tool.define("batch", async () => {
@@ -54,7 +54,9 @@ export const BatchTool = Tool.define("batch", async () => {
const tool = toolMap.get(call.tool)
if (!tool) {
const availableToolsList = Array.from(toolMap.keys()).filter((name) => !FILTERED_FROM_SUGGESTIONS.has(name))
throw new Error(`Tool '${call.tool}' not found. Available tools: ${availableToolsList.join(", ")}`)
throw new Error(
`Tool '${call.tool}' not in registry. External tools (MCP, environment) cannot be batched - call them directly. Available tools: ${availableToolsList.join(", ")}`,
)
}
const validatedParams = tool.parameters.parse(call.parameters)