Skip to content

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

Closed
Jim1874 wants to merge 1 commit into
modelcontextprotocol:mainfrom
Jim1874:fix/issue-3093-move-file-output-schema
Closed

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

Conversation

@Jim1874

@Jim1874 Jim1874 commented Apr 22, 2026 •

Copy link
Copy Markdown

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

Jim1874 commented Apr 22, 2026

Copy link
Copy Markdown
Author

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

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Verified MCP server implementation for consistency with current SDK patterns.

@cliffhall cliffhall added the closed-superseded-v2 Closed: fixed or made obsolete by the v2 / 2026-07-28 refactor (#4875) label Oct 20, 2026
@cliffhall

Copy link
Copy Markdown
Member

Thank you for this pull request, and apologies for the long wait for a response.

Since it was opened, the reference servers have been rebuilt for the 2026-07-28 MCP specification (#4857) and released as v2 (2.0.0 on npm for the TypeScript servers, 2026.10.19 on PyPI for the Python servers). The code this PR changes has been replaced, and the behavior it addresses has either been fixed in v2 or no longer exists in the same form.

This is not a judgment on the change or on you; it's a consequence of the code it targets having been replaced. If the problem still happens on v2, please open a fresh issue with the version you're running and steps to reproduce. Note that this repository now accepts contributions as issues rather than pull requests from anyone but its maintainers; see CONTRIBUTING.md.

This is part of the backlog triage in #4875.

@cliffhall cliffhall closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-superseded-v2 Closed: fixed or made obsolete by the v2 / 2026-07-28 refactor (#4875)

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)

3 participants