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]
name = "mcp-synology-filestation"
version = "0.3.1"
version = "0.3.2"
description = "MCP server for Synology FileStation"
requires-python = ">=3.12"
dependencies = [
+1 -1
View File
@@ -1,3 +1,3 @@
"""MCP server for Synology FileStation."""
__version__ = "0.3.1"
__version__ = "0.3.2"
@@ -358,7 +358,7 @@ def register_filestation(
"SYNO.FileStation.Search",
"start",
params={
"folder_path": path,
"folder_path": json.dumps([path]),
"recursive": "true" if recursive else "false",
"pattern": pattern,
},
@@ -845,7 +845,7 @@ def register_filestation(
"start",
version=2,
params={
"file_path": json.dumps(file_path),
"path": json.dumps(file_path),
"dest_folder_path": json.dumps(dest_folder_path),
"overwrite": "true" if overwrite 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]
assert start_call[0][0] == "SYNO.FileStation.Search"
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"]["recursive"] == "true"
# 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[1]["version"] == 2
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 p["overwrite"] == "false"
assert p["keep_dir"] == "true"