Skip to main content
Glama

sync_files

Sync a configured local mount to a remote SLURM cluster by copying only new and changed files; optionally mirror deletions after a dry-run preview.

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:
    cluster: SSH cluster name (see ``list_clusters``). Required.
    project: Project root (directory holding ``.srunx/config.toml``)
        whose mounts are used. Required.
    mount: Mount name from that project on that cluster. Only configured
        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.
    approve_new_target: The first real sync into a remote path needs
        approval. Only pass True when the user confirmed the target.

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cluster": "<cluster>",
      "project": "<project>",
      "mount": "<mount>"
    },
    "name": "sync_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
mountYes
deleteNo
clusterYes
dry_runNo
projectYes
max_deleteNo
approve_new_targetNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv6.0.0
    • addedInput schema / properties / approve_new_target
      Added value: +{
      +  "default": false,
      +  "title": "Approve New Target",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / cluster
      Added value: +{
      +  "title": "Cluster",
      +  "type": "string"
      +}
    • addedInput schema / properties / project
      Added value: +{
      +  "title": "Project",
      +  "type": "string"
      +}
    • removedInput schema / properties / transport
      Removed value: -{
      -  "title": "Transport",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "transport",
      -  "mount"
      -]New value: +[
      +  "cluster",
      +  "project",
      +  "mount"
      +]
  2. Changed8 schema fields changedv4.0.1
    • addedInput schema / properties / delete
      Added value: +{
      +  "default": false,
      +  "title": "Delete",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / local_path
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Local Path"
      -}
    • addedInput schema / properties / max_delete
      Added value: +{
      +  "default": 100,
      +  "title": "Max Delete",
      +  "type": "integer"
      +}
    • removedInput schema / properties / mount / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / mount / default
      Removed value: -null
    • addedInput schema / properties / mount / type
      Added value: +"string"
    • removedInput schema / properties / remote_path
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Remote Path"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "transport"
      -]New value: +[
      +  "transport",
      +  "mount"
      +]
  3. Changed5 schema fields changedv0.1.1
    • addedInput schema / properties / mount
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Mount"
      +}
    • removedInput schema / properties / mount_name
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Mount Name"
      -}
    • removedInput schema / properties / profile_name
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Profile Name"
      -}
    • addedInput schema / properties / transport
      Added value: +{
      +  "title": "Transport",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "transport"
      +]
  4. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does: it spells out exactly what ``delete=True`` destroys (remote-only checkpoints, logs, job outputs), the approval requirement for a first sync into a new remote path, and the guard semantics of ``max_delete``. The Returns section further discloses the two different counting units and the documented leading-whitespace limitation on path strings.

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

Conciseness4/5

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

Front-loaded with the core behavior and the destructive warning, and every argument is documented in a predictable Args/Returns layout. It is unusually long, and the detailed Returns narrative partially duplicates an output schema that already exists, so some material could be trimmed without losing callability.

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 seven-parameter destructive file-sync tool with zero annotation and zero schema-description coverage, the definition covers safety, preconditions, parameter units, and result interpretation. Nothing an agent needs in order to call it correctly or safely is missing.

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?

Schema coverage is 0% and the description fully compensates, documenting all seven parameters including defaults implied behavior. Particularly strong on ``max_delete``: it explains the entry-vs-file unit (directories count too), the >= 1 constraint, and that the cap does not apply to ``dry_run`` previews.

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?

Opens with a specific verb and resource ("Sync a configured mount from this machine to a remote SLURM cluster") and immediately scopes it to new/changed files only. It distinguishes itself from the sibling ``inspect_mount`` by naming what that tool reports (remote-only stale files) that this one does not.

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?

Explicit when-to-use and when-not-to-use: prefer ``dry_run=True`` first when unsure, leave ``delete`` off unless the user explicitly asked for a mirror, and use ``inspect_mount`` rather than ``delete=True`` to inspect staleness. It also states the precondition that only configured mounts are accepted, not arbitrary paths.

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