fix(mcp): preserve args for mcp_call tool invocations (#1354)
This commit is contained in:
parent
3764cc615a
commit
c10e42b392
2 changed files with 23 additions and 1 deletions
|
|
@ -354,7 +354,8 @@ export default function (pi: ExtensionAPI) {
|
|||
description: "Tool name on that server, e.g. 'railway_list_projects'",
|
||||
}),
|
||||
args: Type.Optional(
|
||||
Type.Record(Type.String(), Type.Unknown(), {
|
||||
Type.Object({}, {
|
||||
additionalProperties: true,
|
||||
description:
|
||||
"Tool arguments as key-value pairs matching the tool's input schema",
|
||||
}),
|
||||
|
|
|
|||
21
src/tests/mcp-client-schema.test.ts
Normal file
21
src/tests/mcp-client-schema.test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
|
||||
test("mcp_call args schema uses additionalProperties instead of patternProperties", () => {
|
||||
const schema = Type.Object({
|
||||
server: Type.String(),
|
||||
tool: Type.String(),
|
||||
args: Type.Optional(
|
||||
Type.Object({}, {
|
||||
additionalProperties: true,
|
||||
description: "Tool arguments as key-value pairs matching the tool's input schema",
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
const argsSchema = (schema.properties as any).args;
|
||||
assert.equal(argsSchema.type, "object");
|
||||
assert.equal(argsSchema.additionalProperties, true);
|
||||
assert.ok(!("patternProperties" in argsSchema));
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue