Skip to content

Commit 5c02660

Browse files
authored
default args for tools so openai doesn't yell at us (#18)
* fix the empty-args tool schema for o3-mini * delete non-claude hacks for tools, just return default empty args when doing `tools/list`
1 parent 858072c commit 5c02660

File tree

1 file changed

+4
-5
lines changed
  • packages/opencontrol/src

1 file changed

+4
-5
lines changed

packages/opencontrol/src/mcp.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ export function createMcp(input: { tools: Tool[] }) {
4141
return {
4242
tools: input.tools.map((tool) => ({
4343
name: tool.name,
44-
inputSchema: tool.args
45-
? (zodToJsonSchema(tool.args as any, "args").definitions![
46-
"args"
47-
] as any)
48-
: { type: "object", properties: {} },
44+
inputSchema: zodToJsonSchema(
45+
(tool.args || z.object({}) as any),
46+
"args",
47+
).definitions!["args"] as any,
4948
description: tool.description,
5049
})),
5150
} satisfies ListToolsResult

0 commit comments

Comments
 (0)