Skip to main content
Glama

git_restore

Discard changes to specific files or unstage them, with confirmation and explicit paths to prevent accidental loss. Restores files to their last committed state.

Instructions

Discard changes to specific files, or unstage them. This destroys uncommitted work, so it requires confirm=true and specific paths — it will never discard everything at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesFiles to restore. Required.
stagedNoUnstage instead of discarding worktree changes. Default false.
confirmYesMust be true — this discards uncommitted work.
workspaceNoWorkspace alias. Defaults to the active workspace.
Behavior5/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It explicitly states that the tool 'destroys uncommitted work', requires confirm=true, and 'will never discard everything at once'. This goes beyond basic safety to give behavioral guarantees, which is excellent transparency.

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 two sentences, front-loaded with the primary purpose, followed by a concise safety warning. It is extremely concise with no wasted words, perfectly sized for an MCP tool description.

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 destructive operation, the description is complete: it covers purpose, the destructive nature, the required confirm flag, path restrictions, and the guarantee of limited scope. The schema fully documents all parameters, so no additional parameter context is needed. Despite no output schema, the description provides enough context for safe invocation.

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

Parameters3/5

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

Schema coverage is 100%, with all four parameters having clear descriptions. The tool description adds minimal extra parametric meaning, only reiterating that confirm is required and paths must be specified, which is already in the schema. Baseline 3 is appropriate.

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 clearly states the tool's function: 'Discard changes to specific files, or unstage them.' This uses specific verbs (discard/unstage) and a clear resource (file changes), distinguishing it from sibling tools like git_commit, git_diff, and git_status. The additional safety clause about never discarding everything at once further clarifies its scope.

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

Usage Guidelines4/5

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

The description provides clear context for when to use the tool (discarding or unstaging changes) and critically warns that it 'destroys uncommitted work' and requires confirm=true with specific paths. However, it does not explicitly name alternative tools or state when not to use it, so it lacks that explicit exclusion.

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/zcrossoverz/repo-bridge'

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