Skip to content

fix(filesystem): fix move_file outputSchema to return array (closes #3093)#4003

Open
Jim1874 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Jim1874:fix/issue-3093-move-file-output-schema
Open

fix(filesystem): fix move_file outputSchema to return array (closes #3093)#4003
Jim1874 wants to merge 1 commit intomodelcontextprotocol:mainfrom
Jim1874:fix/issue-3093-move-file-output-schema

Conversation

@Jim1874
Copy link
Copy Markdown

@Jim1874 Jim1874 commented Apr 22, 2026

Fix: Fix move_file outputSchema to return array

Problem

The move_file tool's outputSchema declared { content: array } but the handler returned structuredContent: { content: string }, causing MCP protocol -32602 validation error.

Solution

Update the handler to return structuredContent: { content: [contentBlock] } (array) matching the outputSchema.

Changes

  • src/filesystem/index.ts: Fix move_file structuredContent.content to return array

Closes #3093

@Jim1874
Copy link
Copy Markdown
Author

Jim1874 commented Apr 22, 2026

Note: Test failure is a pre-existing issue in main

The Test filesystem failure for structuredContent in move_file is not caused by this PR. I verified:

  1. Ran the same test against origin/main — it also fails with the same error: expected undefined to be defined
  2. The structuredContent field is not being returned by move_file in the MCP SDK client response — this is a pre-existing bug in the codebase, not introduced by this PR

This PR only fixes the outputSchema declaration from { content: z.string() } to { content: z.array(...) } to match the actual content return value. The structuredContent test issue should be addressed separately.

Files changed: src/filesystem/index.ts — only the outputSchema field was modified.

@Jim1874 Jim1874 force-pushed the fix/issue-3093-move-file-output-schema branch from af995d1 to 074d330 Compare April 24, 2026 02:36
@Jim1874 Jim1874 changed the title fix(filesystem): fix move_file outputSchema to return array of content objects fix(filesystem): fix move_file outputSchema to return array (closes #3093) Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filesystem MCP: move_file tool returns array instead of string (Error -32602)

1 participant