Browse documentation

sync

[solution]

Refreshes existing workspace documents from disk without writing files. Use reload for project structure changes.

Try it locally in the Glider playground

Parameters

NameTypeRequiredDescription
filePathsjsonNoOptional file paths to sync, as a JSON array. Relative paths use the loaded solution or project directory, not the server process directory. Repository-relative paths also work when they identify an existing file under the loaded root. Absolute paths can identify linked documents outside that root. Named paths get a state each: synced, current, not-in-workspace, unavailable-on-disk, read-error, apply-failed, or reloaded. Named paths always compare content. A sweep with no paths trusts file length and timestamp instead.
forceSyncbooleanNoForces a full sync when no watcher change is pending. Only affects the no-paths form; named paths always sync. Default is false. Default: false
pathStylestringNoPath style: 'absolute' (default) or 'relative' (to solution root). Default: "absolute"
responseDetailstringNocompact returns results and actionable state. full adds diagnostic metadata under responseDiagnostics. Default: "compact"

Examples

Replace sample paths and symbol keys with values from your workspace.

Sync when watcher has pending changes

Arguments
{}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "sync",
    "arguments": {}
  }
}
Illustrative response
{
  "success": true,
  "updated": [
    "/Users/dev/MyProject/Program.cs"
  ],
  "skipped": [],
  "totalSynced": 1,
  "revisionBefore": 3,
  "revisionAfter": 4,
  "fallbackToReload": false,
  "fallbackReason": null,
  "status": "synced",
  "filesConsidered": 2,
  "filesSkippedUnchanged": 1,
  "files": [
    {
      "filePath": "/Users/dev/MyProject/Program.cs",
      "state": "synced"
    },
    {
      "filePath": "/Users/dev/MyProject/Other.cs",
      "state": "current"
    }
  ]
}

Force sync all documents

Arguments
{
  "forceSync": true
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "sync",
    "arguments": {
      "forceSync": true
    }
  }
}

Sync relative to the loaded root

Arguments
{
  "filePaths": "[\"Source/Program.cs\"]"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "sync",
    "arguments": {
      "filePaths": "[\"Source/Program.cs\"]"
    }
  }
}

Sync a specific file

Arguments
{
  "filePaths": "[\"/Users/dev/MyProject/Program.cs\"]"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "sync",
    "arguments": {
      "filePaths": "[\"/Users/dev/MyProject/Program.cs\"]"
    }
  }
}

Response Notes

Structural changes require reload. If no paths are provided, sync runs only when pending watcher changes exist unless forceSync is true.

Returns updated and skipped files plus revision info. status names the outcome: synced, already-current, partial, no-op, read-failed, apply-failed, or reloaded. It separates a snapshot that already held your edits from a call that examined nothing. filesConsidered and filesSkippedUnchanged report how much was checked. files gives a per-file state when you name paths, and is empty for a sweep. status supersedes the older noPendingChanges flag, which is kept for callers that read it. Results use top-level fields with success. Compact is the default; full adds responseDiagnostics. Both modes retain errors, coverage, partial state, and recovery advice.