From af995d160b3e17ecf596004eca808d707c3fc4e6 Mon Sep 17 00:00:00 2001 From: huangzhimou Date: Wed, 22 Apr 2026 11:17:17 +0800 Subject: [PATCH] fix(filesystem): fix move_file outputSchema to return array The move_file tool was returning raw string instead of array of content objects, causing MCP protocol -32602 validation errors. Closes #3093 --- .changeset/fix-move-file-output-schema.md | 5 +++++ src/filesystem/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-move-file-output-schema.md diff --git a/.changeset/fix-move-file-output-schema.md b/.changeset/fix-move-file-output-schema.md new file mode 100644 index 0000000000..cdb957cc6a --- /dev/null +++ b/.changeset/fix-move-file-output-schema.md @@ -0,0 +1,5 @@ +--- +"@modelcontextprotocol/server-filesystem": patch +--- + +Fix move_file outputSchema to return array of content objects instead of string. Closes #3093 diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 7b67e63e58..68c3dc0605 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -607,7 +607,7 @@ server.registerTool( source: z.string(), destination: z.string() }, - outputSchema: { content: z.string() }, + outputSchema: { content: z.array(z.object({ type: z.enum(["text"]), text: z.string() })) }, annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true } }, async (args: z.infer) => {