Make Tool inputSchema optional

This commit is contained in:
Alex Gleason committed 2025-09-11 16:03:06 -05:00
1 parent ba2cfe7b68
commit 0f67f64936
8 files changed
+40 -52

No files matched your search

+8 -1
View File
@@ -325,7 +325,14 @@ export class SessionManager {
}
try {
const toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments));
let toolArgs: unknown;
if (tool.inputSchema) {
toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments));
} else {
// For tools without inputSchema, use empty object or parsed arguments as-is
const rawArgs = functionToolCall.function.arguments;
toolArgs = rawArgs ? JSON.parse(rawArgs) : {};
}
const content = await tool.execute(toolArgs);
await this.addToolMessage(projectId, functionToolCall.id, content);
} catch (error) {