- upload_file: PUT request with utf8/base64 encoding, auto MIME detection, X-OC-Mtime support
- create_folder: MKCOL request with 405 (already exists) error handling
- bulk_upload: POST multipart/related with manual body construction for multi-file upload
- All tools return FileMetadata/BulkUploadResult via PROPFIND after operation
- read_file: GET file content inline (utf8 for text, base64 for binary)
with configurable maxSize (default 10MB) to stay within MCP transport limits
- download_file: returns direct download URL for out-of-band fetching
with optional HEAD metadata
- download_folder: GET folder as ZIP/TAR archive, returns inline base64
if under maxSize (default 50MB), otherwise returns download URL
with optional X-NC-Files header for selective download
Add 5 file management tools to src/tools/files.ts:
- list_files: PROPFIND with depth control (0/1/infinity)
- get_file_info: PROPFIND Depth:0 with extended properties (owner, preview, checksums)
- search_files: WebDAV SEARCH with PROPFIND fallback + client-side filtering
- list_favorites: REPORT with oc:filter-files
- get_quota: PROPFIND for quota-used-bytes / quota-available-bytes
search_files tries WebDAV SEARCH first; if the server lacks Full Text Search,
falls back to PROPFIND Depth:infinity with client-side filtering by name,
mimeType (wildcard), size range, date range, and favorite status.
Sorting and limit are applied after filtering.
- All PROPFIND builders (standard, extended, trashbin, versions, quota)
- PROPPATCH builder for property updates (favorites)
- REPORT builder for favorite filtering
- SEARCH builder (rfc5323) with dynamic where-clause construction
- All response parsers (files, single file, search, trashbin, versions, quota)
- Helper extractors for properties, booleans, numerics
- Namespace handling for both prefixed and unprefixed XML tags