Skip to content

Commit af995d1

Browse files
author
huangzhimou
committed
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
1 parent 4503e2d commit af995d1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-filesystem": patch
3+
---
4+
5+
Fix move_file outputSchema to return array of content objects instead of string. Closes #3093

src/filesystem/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ server.registerTool(
607607
source: z.string(),
608608
destination: z.string()
609609
},
610-
outputSchema: { content: z.string() },
610+
outputSchema: { content: z.array(z.object({ type: z.enum(["text"]), text: z.string() })) },
611611
annotations: { readOnlyHint: false, idempotentHint: false, destructiveHint: true }
612612
},
613613
async (args: z.infer<typeof MoveFileArgsSchema>) => {

0 commit comments

Comments
 (0)