fix: search empty results + extract error 408 (v0.3.2)

Bug 1 — search always returned empty results:
  Search::start was passing folder_path as a plain string.
  DSM silently ignores a plain string for this parameter and returns
  finished=True with files=[] immediately, as if nothing was found.
  Fix: json.dumps([path]) — JSON array, matching the multi-path API
  pattern used by DirSize::start and List::getinfo.

Bug 2 — extract returned DSM error 408:
  Extract::start was using "file_path" as the parameter key for the
  source archive. DSM expects "path". Without a valid path DSM returned
  error 408. The json.dumps wrapping was already correct.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 17:55:22 +02:00
parent 3dd6197fb3
commit 314fae9167
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "mcp-synology-filestation" name = "mcp-synology-filestation"
version = "0.3.1" version = "0.3.2"
description = "MCP server for Synology FileStation" description = "MCP server for Synology FileStation"
requires-python = ">=3.12" requires-python = ">=3.12"
dependencies = [ dependencies = [
+1 -1
View File
@@ -1,3 +1,3 @@
"""MCP server for Synology FileStation.""" """MCP server for Synology FileStation."""
__version__ = "0.3.1" __version__ = "0.3.2"
@@ -358,7 +358,7 @@ def register_filestation(
"SYNO.FileStation.Search", "SYNO.FileStation.Search",
"start", "start",
params={ params={
"folder_path": path, "folder_path": json.dumps([path]),
"recursive": "true" if recursive else "false", "recursive": "true" if recursive else "false",
"pattern": pattern, "pattern": pattern,
}, },
@@ -845,7 +845,7 @@ def register_filestation(
"start", "start",
version=2, version=2,
params={ params={
"file_path": json.dumps(file_path), "path": json.dumps(file_path),
"dest_folder_path": json.dumps(dest_folder_path), "dest_folder_path": json.dumps(dest_folder_path),
"overwrite": "true" if overwrite else "false", "overwrite": "true" if overwrite else "false",
"keep_dir": "true" if keep_dir else "false", "keep_dir": "true" if keep_dir else "false",
+2 -2
View File
@@ -463,7 +463,7 @@ async def test_search_success(config: AppConfig) -> None:
start_call = client.request.call_args_list[0] start_call = client.request.call_args_list[0]
assert start_call[0][0] == "SYNO.FileStation.Search" assert start_call[0][0] == "SYNO.FileStation.Search"
assert start_call[0][1] == "start" assert start_call[0][1] == "start"
assert start_call[1]["params"]["folder_path"] == "/docker" assert json.loads(start_call[1]["params"]["folder_path"]) == ["/docker"]
assert start_call[1]["params"]["pattern"] == "*.yaml" assert start_call[1]["params"]["pattern"] == "*.yaml"
assert start_call[1]["params"]["recursive"] == "true" assert start_call[1]["params"]["recursive"] == "true"
# Verify clean was called last # Verify clean was called last
@@ -1353,7 +1353,7 @@ async def test_extract_success(config: AppConfig) -> None:
assert start_call[0][1] == "start" assert start_call[0][1] == "start"
assert start_call[1]["version"] == 2 assert start_call[1]["version"] == 2
p = start_call[1]["params"] p = start_call[1]["params"]
assert json.loads(p["file_path"]) == "/backup/archive.zip" assert json.loads(p["path"]) == "/backup/archive.zip"
assert json.loads(p["dest_folder_path"]) == "/data/extracted" assert json.loads(p["dest_folder_path"]) == "/data/extracted"
assert p["overwrite"] == "false" assert p["overwrite"] == "false"
assert p["keep_dir"] == "true" assert p["keep_dir"] == "true"