We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4cd7e4 commit 825401fCopy full SHA for 825401f
core/tool-writer.js
@@ -16,6 +16,10 @@ const ToolWriter = {
16
const { logger, Errors } = Utils;
17
18
const validateCode = (code) => {
19
+ // Check if code is provided
20
+ if (!code || typeof code !== 'string') {
21
+ throw new Errors.ValidationError('Missing or invalid code parameter. create_tool requires { name, code } where code is the tool implementation.');
22
+ }
23
// Basic sanity check
24
if (!code.includes('export default') || !code.includes('async function')) {
25
throw new Errors.ValidationError('Tool must export a default async function');
0 commit comments