Skip to main content
Glama

sync_files

Sync local files to a remote SLURM cluster, transferring only new or changed files. Use dry-run to preview; optionally delete remote-only files with max-delete safeguard.

Instructions

Sync a configured mount from this machine to a remote SLURM cluster.

Copies new and changed files only. Files that exist on the cluster but not
locally are left untouched unless ``delete=True``.

That means a file deleted locally stays on the cluster, where a job can
still pick it up. This tool does not report those — call ``inspect_mount``
to see them. It is read-only, so it is safe to call before or after a sync;
reach for it rather than setting ``delete=True`` to find out what is stale.

Args:
    transport: SSH profile name to sync against. Required and must name
        an SSH profile — there is no local-to-local sync, and (unlike
        the CLI) no implicit current-profile fallback. ``"local"`` is
        rejected. Call ``list_ssh_profiles`` to see profiles and the
        mounts each one defines.
    mount: Mount name from that SSH profile. Only pre-registered mounts
        can be synced; arbitrary paths are not accepted.
    dry_run: Preview only. Reports exactly what would be transferred and
        deleted without touching the cluster. Prefer this first whenever
        you are unsure, and always before a ``delete=True`` run.
    delete: Mirror the mount — also DELETE cluster files that no longer
        exist locally. **This destroys remote-only data** such as
        training checkpoints, job logs, and outputs written by jobs on
        the cluster, which by definition do not exist locally. Leave it
        off unless the user explicitly asked for a mirror, and preview
        with ``dry_run=True`` before running it.
    max_delete: Refuse the mirror, without changing anything, if it would
        delete more than this many **entries**. Entries are files *and*
        directories, matching rsync's own ``--max-delete`` unit: removing
        a directory holding two files counts as three entries (both files
        plus the directory), so set this above the file count you have in
        mind. Guards against mirroring from a wrong or half-populated
        local directory. Must be >= 1; to sync without deleting, leave
        ``delete`` off. Only applies to a real ``delete=True`` run — a
        ``dry_run`` preview is never capped, so it can show the whole list.

Returns:
    On success: ``files_transferred``, ``entries_deleted``, and the
    ``deleted_paths`` list. Past a very large number of deletions the list
    is omitted and ``deleted_paths_omitted`` is set — the count stays
    exact, and no list is ever silently shortened.

    The two counts use different units on purpose, because that is what
    rsync reports: ``entries_deleted`` includes removed directories, while
    ``files_transferred`` counts only regular files whose data actually
    crossed the wire — matching rsync's own "regular files transferred"
    statistic. Directory creations, symlinks, devices, hard links and
    attribute-only touch-ups move no data and are excluded, so a sync can
    legitimately change the remote while reporting zero transfers.

    Counts are reliable; path *strings* have one documented limit. rsync
    separates its flag block from the filename with whitespace whose width
    varies by version, so a filename that itself begins with spaces cannot
    be told apart from that separator, and those leading spaces are lost
    from the reported string. Such a deletion is still counted, so the
    cap and the refusal logic are unaffected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mountYes
deleteNo
dry_runNo
transportYes
max_deleteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosure and exceeds it. It explains that files deleted locally persist on the cluster, that the tool does not report them, that delete destroys remote-only data, that dry_run does not touch the cluster, that max_delete counts both files and directories, and even documents the whitespace limitation on reported filenames. This is exceptionally transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every sentence earns its place. It is front-loaded with a summary sentence, then structured into Args and Returns sections. The use of bold for delete and clear unit explanations makes it scannable. The length is justified by the tool's complexity and safety implications. It could not be meaningfully shortened without losing crucial detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with five parameters, a destructive delete mode, and nuanced return counts, the description covers all necessary context: parameter choices, return value meanings, count unit differences, and edge-case behavior. Even with an output schema, this description enriches the semantics and leaves no obvious gap for an agent to misuse the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description fully compensates. Each of the five parameters is explained with real semantics: transport must be an SSH profile (no local-to-local, 'local' rejected), mount must be pre-registered, dry_run is a no-touch preview, delete is destructive and mirrors, and max_delete counts entries with a clear unit definition. This adds meaning far beyond the plain schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Sync a configured mount from this machine to a remote SLURM cluster.' It explicitly notes it copies new and changed files only, distinguishing it from inspect_mount (which lists stale files) and from list_ssh_profiles (which discovers mounts). This clearly separates it from sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: call inspect_mount to identify stale files rather than enabling delete=True, call list_ssh_profiles to see profiles and their mounts, prefer dry_run first when unsure, and always before delete=True. It also warns to leave delete off unless the user explicitly asks for a mirror. This is strong when-to-use/when-not-to guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ksterx/srunx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server