Skip to main content

Using MCP tools

FolderSpan provides 36 MCP tools for files, bookmarks, favorites, recent items, file tasks, devices, network locations, and sync tasks. After connecting Codex or Claude Code, describe your goal in natural language. The AI chooses folderspan_ tools allowed by the token and turns structured results into an answer; you do not need to write tool arguments manually.

This page covers prompts and returned information for each tool group.

What to include in a prompt​

A clear request usually specifies:

  1. Source: this device, another device, a share, or a network location.
  2. Location: source name and absolute path, or a known stable ID.
  3. Operation: list, read, write, rename, copy, move, delete, share, or run sync.
  4. Conflict handling: error, skip, overwrite, or rename for copies and moves.
  5. Confirmation: for writes, overwrites, moves, deletions, sharing, or connections, ask the AI to show its plan and wait for confirmation.
  6. Response format: request IDs, paths, states, times, and error codes when you need original details rather than only a summary.

Use this template:

Use FolderSpan MCP tools for the following task:
- Source: <Local, Device, Share, or Network, and the source name>
- Path: <absolute path>
- Destination: <source and absolute path; remove this line if unused>
- Operation: <what to do>
- Conflict policy: <error, skip, overwrite, or rename; remove if unused>
- Execution: read metadata first and restate the source, destination, and impact. Wait for my confirmation before making changes.
- Response: return actual tools used, item IDs, full paths, execution states, and failure reasons.
tip

If you do not know a device, network, sync-task, or file-task ID, give its name and ask the AI to “list candidates first; do not guess IDs.” It can use the returned IDs for the next step.

Describe file locations​

All file tools locate items through protocol, sourceId, and path. Calling a tool does not change the directory currently displayed in FolderSpan.

SourceHow to describe itsourceIdpath
Local“This device” or “local”Empty stringAbsolute path on this device
Device“The device named Office PC”Stable ID of a connected deviceAbsolute path used by that device
Share“The share named …” or its IDStable ID of an available shareAbsolute path used by that share
Network“The network location named Backup drive”Stable ID of a connected network locationAbsolute path used by the remote endpoint

Examples:

List the direct children of `/Documents` on this device. Return full paths, types, sizes, and update times. Do not modify files.
List configured network locations, find Backup drive, and tell me its ID and connection state. Do not connect yet.

Device, Share, and Network sources must be currently available; otherwise, tools return not_connected or not_found. Paths must be absolute paths accepted by that endpoint and cannot contain traversal segments such as . or ...

Understand the AI's answer​

FolderSpan returns both JSON text and structured results. AI clients usually turn fields into prose instead of displaying all JSON. To inspect details, ask:

Do not omit returned fields. Show IDs, protocol, sourceId, path, states, times, and nextCursor.

Common response rules:

  • Lists: items and nextCursor. A nonempty cursor means another page is available; ask the AI to keep reading pages until finished.
  • Pagination: limit defaults to 50, with a range of 1–200. The opaque cursor must not be edited manually.
  • Times: fields such as createdAt, updatedAt, lastAccessed, and expiresAt contain timestamps. You can request local date/time conversions too.
  • Changes: successful create, edit, write, and connect operations generally return the complete updated object. Deletions return a boolean or count.
  • Asynchronous file tasks: copy, move, and delete return only taskId; query the task for progress and failures.
  • Errors: code and message. The AI should explain failures rather than describing them as success.

Browse and read files​

Example prompts​

List direct children of local `/Documents`, grouped into directories, documents, and other files. Show each full path, size, update time, and allowed operations. Continue through all pages.
Read local `/Documents/report.txt`. Return its size and update time first, then read the whole file in chunks and summarize it. Do not modify it.

Tools and responses​

ToolPermissionPurposeResponse
folderspan_files_listfiles.readList a directory's direct childrenitems, nextCursor; entries include name, path, directory flag, MIME type, size, creation/update times, source, permissions, hidden/symlink flags, and sensitive-item information
folderspan_file_infofiles.readInspect a file or directoryComplete metadata with the same fields as a directory entry
folderspan_file_readfiles.readRead or summarize a filetotalSize, offset, returnedLength, hasMore, encoding, data

Entry permissions indicate whether the endpoint permits read, write, rename, delete, and share. endpoint identifies the actual protocol and sourceId.

Reading defaults to offset=0 and 262144 bytes, with 1–4194304 bytes allowed per call. Text uses utf8; binary content uses base64. When hasMore is true, continue with an updated offset.

An AI may present the result as:

Read Local `/Documents/report.txt`:
- Total size: <totalSize> bytes
- This range: <returnedLength> bytes from <offset>
- More content available: <hasMore>
- Summary: <summary generated from data>

Write, create directories, and rename​

Example prompts​

Read the size and update time of local `/Notes/todo.txt`. If the file has not changed, append “Backup complete” and return the actual bytes written and new file information.
Create local `/Documents/Archive`. If it already exists, return the existing directory's information. Do not delete or overwrite anything.

Tools and responses​

ToolPermissionPurposeResponse
folderspan_file_writefiles.writeCreate, overwrite, or append file contententry, bytesWritten, mode; entry is the complete post-write metadata
folderspan_directory_createfiles.writeCreate one directory levelComplete new-directory metadata, or the existing directory if already present
folderspan_file_renamefiles.writeRename a file or directoryComplete renamed-item metadata

Write modes are overwrite and append, defaulting to overwrite. Decoded content cannot exceed 524288 bytes per call. To avoid overwriting a file changed by another program, first call folderspan_file_info, then pass its size and updatedAt as expectedSize and expectedUpdatedAt. Mismatched preconditions return conflict without writing.

Copy, move, delete, and file tasks​

Example prompts​

Copy local `/Documents/report.pdf` to `/Reports` on Backup drive, using `rename` for conflicts. Inspect both locations and show a plan first. Wait for confirmation, then create the task and keep checking until it finishes. Summarize progress and failures.
Prepare to delete local `/Downloads/old.zip`. Show its full path, size, and update time first. Wait for confirmation before deleting, then query the final task state.

Create tasks​

ToolPermissionPurposeInitial response
folderspan_files_copyfiles.writeCopy files to a destination directorytaskId
folderspan_files_movefiles.writeMove files to a destination directorytaskId
folderspan_files_deletefiles.writeDelete files or directoriestaskId

Copy and move support error, skip, overwrite, and rename. A move deletes each source item only after its destination copy completes. If source deletion fails, retrying does not copy it again.

Query and control tasks​

ToolPermissionFollow-upResponse
folderspan_tasks_listtasks.readList recent file tasks and progressPaginated tasks
folderspan_tasks_gettasks.readQuery a task ID's current stateTask details
folderspan_tasks_pausetasks.controlPause a task IDUpdated task details
folderspan_tasks_resumetasks.controlResume a task IDUpdated task details
folderspan_tasks_canceltasks.controlCancel a task IDUpdated task details
folderspan_tasks_deletetasks.controlDelete a finished task recorddeleted

Task details include:

  • id, type, status: identifier, type, and current state.
  • protocol, sourceId, values: source and task parameters without tokens or passwords.
  • progressCurrent, progressTotal: current and total progress.
  • failureCount, failurePath, failureMessage: failure count and most recent failure path and reason.
  • availableActions: currently allowed pause, resume, cancel, or delete actions.

Running and paused tasks cannot be deleted directly. Ask the AI to use availableActions rather than blindly trying disallowed operations.

Bookmarks​

Example prompts​

List local bookmarks with IDs, names, types, paths, sort values, and source availability.
Create a local bookmark named Work documents, with type `document` and path `/Documents/Work`. Return its ID and full information.

Tools and responses​

ToolPermissionOperationResponse
folderspan_bookmarks_listbookmarks.readList bookmarks under a protocol and sourceIditems, nextCursor
folderspan_bookmarks_createbookmarks.writeCreate a bookmarkComplete new bookmark
folderspan_bookmarks_updatebookmarks.writeUpdate name, type, path, icon, or sorting by IDComplete updated bookmark
folderspan_bookmarks_deletebookmarks.writeDelete by bookmark IDdeleted

Bookmarks include id, protocol, sourceId, name, type, path, icon, sort, createdAt, updatedAt, and sourceAvailable. Types are home, image, audio, video, document, download, and custom.

Favorites and recent items​

Example prompts​

List all favorites with pinned entries first. Return each ID, file location, type, size, and update time.
Favorite local `/Documents/manual.pdf`. Read its information first and return the favorite ID after success. If already saved, return only the existing record.

Favorite tools​

ToolPermissionsOperationResponse
folderspan_favorites_listfavorites.readList favoritesitems, nextCursor
folderspan_favorites_addfavorites.write, files.readAdd by file locationComplete new or existing favorite
folderspan_favorites_removefavorites.write, files.readRemove by file locationremoved
folderspan_favorites_pinfavorites.writePin or unpin by favorite IDComplete updated favorite

Favorites include id, locator, name, isDirectory, mimeType, size, createdAt, updatedAt, and pinned. The locator contains the source endpoint and full path.

Recent-item tools​

ToolPermissionPurposeResponse
folderspan_recents_listrecents.readList recent historyitems, nextCursor; entries include ID, location, name, type, size, creation/update times, and lastAccessed
folderspan_recents_deleterecents.writeDelete specified history IDsdeletedCount
folderspan_recents_clearrecents.writeClear all recent historydeletedCount

These tools manage existing history and do not create artificial visits. Clearing affects every record; ask the AI to return the count and wait for confirmation first.

HTTP and WebRTC devices​

Example prompt​

List currently discovered HTTP devices, grouped as connected, connecting, awaiting peer approval, and discovered. Show IDs, names, addresses, platforms, and states. Do not connect yet.

Discovery and connection tools​

ToolPermissionOperationResponse
folderspan_devices_listdevices.readView online HTTP devicesDevices grouped by connection state
folderspan_device_connectdevices.connectConnect to an HTTP device by IDConnected-device details
folderspan_webrtc_devices_listdevices.readView discovered WebRTC devicesDevices grouped by connection state
folderspan_webrtc_device_connectdevices.connectConnect to a WebRTC device by IDConnected-device details

Device tools use online devices already discovered by FolderSpan; they do not actively scan network ranges. Groups are connected, connecting, approvalRequired, and discovered. Entries include id, name, host, port, platform, transport, and status. Connection tools do not bypass certificate checks or peer approval.

Network locations​

Example prompts​

List configured network locations with IDs, names, protocols, hosts, stable source IDs, connection states, and whether they are saved. Do not return credentials.
Find the unique network location named Backup drive. Show its ID and state first. Wait for confirmation before testing and connecting.
ToolPermissionOperationResponse
folderspan_networks_listnetworks.readList configured network locationsitems, nextCursor
folderspan_network_connectnetworks.connectValidate the root and connect by IDConnected network-location details

Entries include id, sourceId, name, protocol, host, connected, and persisted. Saved usernames, passwords, private keys, and other credentials are not returned. Connection failures return not_connected.

Sync tasks​

Example prompts​

List sync tasks and find Document backup. Return its ID, enabled state, endpoints, latest state, last run time, and next run time. Do not run it yet.
Run Document backup. First verify the name uniquely identifies one task and tell me its source and destination. Wait for confirmation, then run it and return the state after triggering.
ToolPermissionOperationResponse
folderspan_sync_listsync.readList sync tasksitems, nextCursor
folderspan_sync_runsync.runRun an idle task nowTask details after triggering

Details include id, name, enabled, sourceType, sourceRef, sourcePath, targetType, targetRef, targetPath, lastStatus, lastRunAt, and nextRunAt. Running returns immediately without waiting for completion. A queued or running task returns conflict.

Share files​

Example prompts​

Create a time-limited LAN share link for local `/Public/manual.pdf`, hiding hidden files and disabling uploads. Return all addresses, the expiration time, and the HTTPS fingerprint.
List connected HTTP devices first. Find the unique device named Tablet and share local `/Public/manual.pdf` with it, excluding hidden files. Return the operation ID and receiving state.
ToolPermissionsOperationResponse
folderspan_files_share_linkfiles.share, files.readCreate a time-limited LAN linkurls, expiresAt, allowHidden, allowUpload, fileCount, tlsFingerprintSha256
folderspan_files_share_devicefiles.share, files.readShare to a connected HTTP deviceoperationId, deviceId, status, fileCount

Enabling uploads also requires files.write, and the FolderSpan host must already allow uploads. Symbolic links and items whose endpoints prohibit sharing are rejected. Device sharing accepts only online, connected HTTP devices.

Errors and follow-ups​

Failures return code and message. Common codes:

CodeMeaningSuggested follow-up
invalid_argumentInvalid arguments, paths, encoding, read range, or portIdentify the invalid argument and retry with real values from a list result.
not_foundMissing file, record, task, tool, or sourceList candidates again with IDs and paths; do not guess.
permission_deniedInsufficient token permissions or endpoint, path, or sensitive-item restrictionsExplain the missing permission; do not bypass restrictions.
conflictDestination exists, write preconditions changed, or sync is already runningRead the current state and explain the conflict; do not overwrite.
invalid_stateTask state disallows the requested control actionReturn availableActions and suggest only allowed actions.
not_connectedDevice, share, or network source is disconnectedList states and identify the correct source before asking whether to connect.
unsupportedEndpoint or platform lacks the capabilityIdentify the unsupported endpoint and available alternatives.
io_errorEndpoint file read/write errorPreserve the failure path and message; stop further changes.
cancelledOperation was cancelledReturn progress before cancellation and remaining actions.
internal_errorInternal service operation failedPreserve the code and operation context; do not repeat destructive actions.

Safe use​

  • Configure the token in the MCP client, never in a chat prompt.
  • Start with View only. Verify sources, paths, and responses before adding change or control permissions.
  • Before deletion, overwrite, move, sharing, or connection, ask the AI to restate targets, scope, and conflict policy and wait for confirmation.
  • Obtain actual IDs from list tools. Do not guess source, device, task, or network IDs from names.
  • If a tool is missing, check its token permissions, then refresh the client's tool list.
  • Read large files in chunks. When hasMore is true, continue using the returned offset information rather than exceeding request limits.