-
Notifications
You must be signed in to change notification settings - Fork 9k
Description
Filesystem MCP: move_file tool returns array instead of string (Error -32602)
Summary
When executing the move_file tool from @modelcontextprotocol/server-filesystem, error code -32602 (Invalid params) occurs.
Root Cause: The tool returns an array instead of a string, causing MCP protocol validation to fail.
Error Details
Error Code: -32602 (JSON-RPC Invalid params)
Error Message:
Output validation error: Invalid structured content for tool move_file: [
{
"expected": "string",
"code": "invalid_type",
"path": ["content"],
"message": "Invalid input: expected string, received array"
}
]
Problem Location: The content field is an array (should be a string)
Steps to Reproduce
- Configure @modelcontextprotocol/server-filesystem as an MCP server
- Call the move_file tool with:
- source: Source file path
- destination: Destination file path
- Error occurs
Example:
{
"source": "C:\path\to\file.txt",
"destination": "C:\path\to\new\file.txt"
}
Expected Behavior
The move_file tool should return a string message when file movement succeeds.
Example:
"Successfully moved file from source to destination"
Actual Behavior
The move_file tool returns an array, causing MCP protocol validation to fail.
Environment
OS: Windows 10 (build 26100)
Node.js: 22.21.1 (Built-in Claude Desktop)
Package: @modelcontextprotocol/server-filesystem@latest
MCP Client: Claude Desktop 1.0.1307
Log Excerpts
Request:
2025-11-30T09:57:51.155Z [filesystem] [info] Message from client:
{
"method": "tools/call",
"params": {
"name": "move_file",
"arguments": {
"source": "C:\Users\skiku\Documents\MCP_Learning\chapter01\test1.txt",
"destination": "C:\Users\skiku\Documents\MCP_Learning\chapter01\テストファイル\test1.txt"
}
},
"jsonrpc": "2.0",
"id": 26
}
Response (Error):
2025-11-30T09:57:51.174Z [filesystem] [info] Message from server:
{
"jsonrpc": "2.0",
"id": 26,
"result": {
"content": [{
"type": "text",
"text": "MCP error -32602: Output validation error: Invalid structured content for tool move_file: ..."
}],
"isError": true
}
}
Additional Information
- Other file operation tools (read_file, write_file, create_directory, etc.) work correctly
- The move_file tool appears in the available tools list but fails at runtime
- This issue prevents file movement functionality from being used
Related Issues
I checked GitHub Issues but found no known problems related to the move_file tool. This appears to be an unreported bug.
Suggested Labels
- bug
- server-filesystem
- schema-validation