trace_restore
[solution]
Restores .NET packages and stores warnings, failures, and project outcomes.
Before you use this tool
Executes commands with your local permissions. Commands can change workspace files and contact package sources. Check the workspace and runner policy. Runs a workspace-scoped restore that downloads packages; the nuget runner requires --allow-executable nuget-workspace.
Try it locally in the GliderTrace playground
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| targetPath | string | No | Optional solution, project, directory, or (with runner 'nuget') packages.config path under the workspace root. Defaults to the workspace root. |
| runner | string | No | Restore runner: 'auto' (default, dotnet restore) or 'nuget' (a workspace-local .nuget\NuGet.exe; requires the server started with --allow-executable nuget-workspace). |
| nugetConfigPath | string | No | Optional NuGet configuration file under the workspace root, mapped to --configfile / -ConfigFile. |
| packagesDirectory | string | No | Optional packages directory under the workspace root, mapped to --packages / -PackagesDirectory. |
| lockedMode | boolean | No | Fail when the lock file is out of date (--locked-mode / -LockedMode). Defaults to false. Default: false |
| disableParallelProcessing | boolean | No | Disable parallel restore (--disable-parallel / -DisableParallelProcessing). Defaults to false. Default: false |
| environment | json | No | Optional environment variables to set for the restore process. |
| timeoutMs | number | No | Optional restore timeout in milliseconds. When exceeded the session completes with status timeout. |
| summaryLimit | number | No | Maximum diagnostics returned in topFindings, errors first. Clamped to 1..100. Defaults to 20. Default: 20 |
| label | string | No | Optional short label for the stored session, for example nightly-baseline. Use it to find the session again with trace_list_sessions. Maximum 128 characters. |
| properties | json | No | MSBuild properties for dotnet restore in -p:Key=Value form. The tool rejects RestorePackagesPath and RestoreConfigFile; use packagesDirectory and nugetConfigPath. The nuget runner ignores properties. |
| arguments | json | No | Extra dotnet restore arguments. The tool appends them verbatim. It rejects binary-logger and packages or config-file options; use packagesDirectory and nugetConfigPath. |
| profile | string | No | Optional named MSBuild property profile. Use 'worktree' to accommodate a Git worktree checkout. Its properties merge under any properties you pass. |
Examples
Replace sample paths and symbol keys with values from your workspace.
Restore the workspace with dotnet restore
{}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trace_restore",
"arguments": {}
}
}Restore a packages.config solution with the workspace NuGet.exe
{
"runner": "nuget",
"targetPath": "MyApp.sln"
}Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trace_restore",
"arguments": {
"runner": "nuget",
"targetPath": "MyApp.sln"
}
}
}Response Notes
Returns a restore session id, status, exit code, restoredProjects/upToDateProjects/failedProjects/nuWarningCount/nuErrorCount/restoreSucceeded summary, errors-first topFindings, and (dotnet runner) a sensitive restore.binlog artifact reference.
GliderTrace 1.0.0 returns compact JSON for every tool. Result fields appear beside success; there is no response-format parameter. success describes the tool call. Check the process or session status and exitCode separately. Scalar results and fields that conflict with reserved names appear under result.
To migrate an envelope consumer, read response.sessionId instead of response.data.sessionId. Stored sessions and exported files keep their formats. --max-response-chars limits response text to 60,000 UTF-16 characters by default. Use 0 to disable it, or at least 1,000. This limit counts text characters, not transport bytes or tokens.
outputLimit.truncated marks omitted response detail. It does not change capture completeness. Use the returned next tool and arguments when available. Do not repeat a command or feedback submission to recover omitted output. For event pages, keep the filters and cursor while reducing limit.
For session details, set includeArtifacts and includeTopFindings to false to reduce output. Check error, actionable meta, warnings, and coverage before drawing conclusions. Internal diagnostics stay in local server logs.