refactor: shorten all tool docstrings to 1 line, trim payload by 544 B
tools/list payload: 8943 B → 8399 B (−6.1%) All 16 multi-line docstrings collapsed to single lines per CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -261,8 +261,7 @@ def register_filestation(
|
||||
sort_by: str = "name",
|
||||
sort_direction: str = "asc",
|
||||
):
|
||||
"""List directory contents. path: share-relative (e.g. /docker).
|
||||
offset/limit for pagination, sort_by/sort_direction for ordering."""
|
||||
"""List directory contents. path: share-relative; offset/limit/sort_by/sort_dir optional."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
# Validate inputs
|
||||
@@ -348,8 +347,7 @@ def register_filestation(
|
||||
recursive: bool = True,
|
||||
max_results: int = 200,
|
||||
):
|
||||
"""Search files by glob pattern under path. pattern: e.g. "*.yaml".
|
||||
recursive/max_results optional."""
|
||||
"""Search files by glob pattern. pattern: e.g. *.yaml; recursive/max_results optional."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
limit = max(1, min(max_results, 1000))
|
||||
@@ -469,8 +467,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def download(path: str):
|
||||
"""Download a file as base64 (max 10 MB). path: share-relative.
|
||||
Returns JSON {filename, size, content_base64}."""
|
||||
"""Download a file as base64 (max 10 MB). Returns JSON {filename, size, content_base64}."""
|
||||
import base64
|
||||
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
@@ -499,8 +496,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def get_info(path: str):
|
||||
"""Get metadata (type/size/owner/permissions/timestamps) for one or more paths.
|
||||
path: comma-separated share-relative paths."""
|
||||
"""Get file/folder metadata. path: one or more comma-separated share-relative paths."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
paths = [p.strip() for p in path.split(",") if p.strip()]
|
||||
@@ -589,8 +585,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def check_exist(path: str):
|
||||
"""Check if one or more paths exist. path: comma-separated share-relative paths.
|
||||
Returns Yes/No table."""
|
||||
"""Check if paths exist (comma-separated share-relative paths). Returns Yes/No table."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
paths = [p.strip() for p in path.split(",") if p.strip()]
|
||||
@@ -638,8 +633,7 @@ def register_filestation(
|
||||
name: str,
|
||||
create_parents: bool = False,
|
||||
):
|
||||
"""Create a folder. path: parent dir, name: folder name (not full path).
|
||||
create_parents: make missing parents."""
|
||||
"""Create a folder. path: parent directory, name: folder name (not full path)."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
try:
|
||||
@@ -661,8 +655,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def rename(path: str, new_name: str):
|
||||
"""Rename a file or folder. path: current share-relative path,
|
||||
new_name: bare name only (not full path)."""
|
||||
"""Rename a file or folder. new_name: bare name only (not a full path)."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
try:
|
||||
@@ -684,8 +677,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def copy(src: str, dst: str, overwrite: bool = False):
|
||||
"""Copy src to dst directory.
|
||||
WARNING: overwrite=True replaces existing items (default False)."""
|
||||
"""Copy src to dst directory. WARNING: overwrite=True replaces existing items."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
try:
|
||||
@@ -718,8 +710,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def move(src: str, dst: str, overwrite: bool = False):
|
||||
"""Move src to dst directory.
|
||||
WARNING: overwrite=True replaces existing items (default False)."""
|
||||
"""Move src to dst directory. WARNING: overwrite=True replaces existing items."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
try:
|
||||
@@ -752,8 +743,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def delete(path: str, confirmed: bool = False):
|
||||
"""Delete a file or folder. IRREVERSIBLE.
|
||||
confirmed=False (default) shows preview only; pass confirmed=True to actually delete."""
|
||||
"""Delete a file or folder (IRREVERSIBLE). confirmed=False shows preview; True deletes."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
if not confirmed:
|
||||
@@ -794,8 +784,7 @@ def register_filestation(
|
||||
format: str = "zip",
|
||||
password: str = "",
|
||||
):
|
||||
"""Compress paths into an archive. dest_file_path: full path incl. filename.
|
||||
level: store/fastest/fast/normal/moderate/maximum. format: zip/7z."""
|
||||
"""Compress paths into a ZIP or 7z archive. dest_file_path: full path incl. filename."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
_valid_levels = {"store", "fastest", "fast", "normal", "moderate", "maximum"}
|
||||
@@ -847,8 +836,7 @@ def register_filestation(
|
||||
create_subfolder: bool = False,
|
||||
password: str = "",
|
||||
):
|
||||
"""Extract a ZIP or 7z archive to dest_folder_path.
|
||||
overwrite/keep_dir/create_subfolder/password optional."""
|
||||
"""Extract a ZIP or 7z archive to dest_folder_path."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
try:
|
||||
@@ -883,8 +871,7 @@ def register_filestation(
|
||||
|
||||
@mcp.tool()
|
||||
async def dir_size(path: str):
|
||||
"""Get total size, file count and folder count for one or more directories.
|
||||
path: comma-separated share-relative paths."""
|
||||
"""Get total size, file count, folder count. path: comma-separated share-relative paths."""
|
||||
paths = [p.strip() for p in path.split(",") if p.strip()]
|
||||
if not paths:
|
||||
return "Error: no path provided."
|
||||
@@ -962,8 +949,7 @@ def register_filestation(
|
||||
overwrite: bool = False,
|
||||
create_parents: bool = True,
|
||||
):
|
||||
"""Upload base64-encoded content as filename into path (max 50 MB).
|
||||
WARNING: overwrite=True replaces existing file (default False)."""
|
||||
"""Upload base64 content to path/filename (max 50 MB). WARNING: overwrite=True replaces."""
|
||||
import base64
|
||||
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
@@ -1003,8 +989,7 @@ def register_filestation(
|
||||
overwrite: bool = False,
|
||||
create_only: bool = False,
|
||||
):
|
||||
"""Check write permission for filename in path.
|
||||
Returns 'Permission granted' or an error message."""
|
||||
"""Check write permission for filename in path."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
req_params: dict[str, Any] = {"path": path, "filename": filename}
|
||||
@@ -1032,8 +1017,7 @@ def register_filestation(
|
||||
date_expired: str = "",
|
||||
date_available: str = "",
|
||||
):
|
||||
"""Create a public sharing link for a file or folder.
|
||||
date_expired/date_available: YYYY-MM-DD, optional."""
|
||||
"""Create a public sharing link. date_expired/date_available: YYYY-MM-DD (optional)."""
|
||||
from mcp_synology_filestation.client import SynologyError
|
||||
|
||||
req_params: dict[str, Any] = {"path": json.dumps(path)}
|
||||
|
||||
Reference in New Issue
Block a user