Skip to main content
Glama

Bring files you share in a private conversation or group chat back to an earlier commit

restore_files

Bring files you share in a private conversation or group chat back to an earlier commit. Use it to undo changes: a new commit that makes paths, or every file that changed since, read as they did after commit to. Nothing is lost by restoring, because the commits in between stay in the history and can be restored too. It is announced in the conversation or group like any commit, unless announce is false. Only commits from history_from on can be restored. Needs the personal token.

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": {
      "space_id": "<space_id>",
      "to": "<to>"
    },
    "name": "restore_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
asNoThe agent to act as, by name: one that this connection's personal token created with create_agent (list_agents shows them). Leave it out to act as the token's own agent. A chat that has an agent of its own passes its name in every call.
toYesThe commit to go back to: the files will read as they did after it. 0 removes everything.
pathsNoOnly these files. Default: every file that changed since.
messageNoWhy. Default: "Restore the files of commit N".
announceNoWhether the conversation or group gets a message about it, as for any commit.
space_idYesWhose files these are: the `conversation_id` of a conversation you take part in, or the `group_id` of a group you are a member of.
idempotency_keyNoOptional: 1-255 visible ASCII characters, such as a UUID, new for each operation. A retry with the same key and the identical request returns the original result instead of a duplicate; the same key with a different request of the same kind gets 409.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations, it explains that restoring is non-destructive because intervening commits remain in history, that a commit announcement is emitted unless `announce` is false, and that a personal token is required. It does not cover failure cases (out-of-range commit, permission errors) or concurrency behavior, and the idempotency_key retry semantics are left entirely to the schema.

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?

The purpose and the undo framing are front-loaded, and the remaining sentences each add usable detail about reversibility, announcement, and auth. It is somewhat dense for a single paragraph, and the phantom `history_from` clause is a sentence that does not earn its place.

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

Completeness3/5

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

For a mutation tool with no output schema, it covers reversibility, side effects, and auth reasonably well. However, it never says what the call returns or how errors surface, and the dangling `history_from` constraint leaves the valid range for `to` ambiguous even though `to` is a required parameter.

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%, so the schema already documents every parameter, making 3 the baseline. The description adds real meaning for defaults ('every file that changed since', the default commit message), but it also references a `history_from` commit bound that does not exist among the 7 parameters — a stale reference that can mislead an agent trying to determine valid `to` values.

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 ('Bring files ... back to an earlier commit') and scopes it to files shared in a conversation or group. An agent can distinguish this from commit_files or diff_files without opening any schema.

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?

It gives an explicit purpose ('Use it to undo changes') and clarifies the two operating modes: named `paths`, or every file that changed since. It does not name an alternative tool or state when not to use it, so the routing signal is contextual rather than explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources