mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:31:00 +00:00
fix: narrow empty MCP tool schema normalization (#60176) (thanks @Bartok9)
This commit is contained in:
@@ -20,6 +20,20 @@ describe("normalizeToolParameters", () => {
|
||||
expect(parameters.properties).toEqual({});
|
||||
});
|
||||
|
||||
it("does not rewrite non-empty schemas that still lack type/properties", () => {
|
||||
const tool: AnyAgentTool = {
|
||||
name: "conditional",
|
||||
label: "conditional",
|
||||
description: "Conditional schema stays untouched",
|
||||
parameters: { allOf: [] },
|
||||
execute: vi.fn(),
|
||||
};
|
||||
|
||||
const normalized = normalizeToolParameters(tool);
|
||||
|
||||
expect(normalized.parameters).toEqual({ allOf: [] });
|
||||
});
|
||||
|
||||
it("injects properties:{} for type:object schemas missing properties (MCP no-param tools)", () => {
|
||||
const tool: AnyAgentTool = {
|
||||
name: "list_regions",
|
||||
|
||||
Reference in New Issue
Block a user