We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a227b5 commit 2b7c400Copy full SHA for 2b7c400
1 file changed
packages/opencode/src/tool/tool.ts
@@ -50,9 +50,12 @@ export namespace Tool {
50
toolInfo.parameters.parse(args)
51
} catch (error) {
52
if (error instanceof z.ZodError && toolInfo.formatValidationError) {
53
- throw new Error(toolInfo.formatValidationError(error))
+ throw new Error(toolInfo.formatValidationError(error), { cause: error })
54
}
55
- throw error
+ throw new Error(
56
+ `The ${id} tool was called with invalid arguments: ${error}.\nPlease rewrite the input so it satisfies the expected schema.`,
57
+ { cause: error },
58
+ )
59
60
return execute(args, ctx)
61
0 commit comments