Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Read or restore one strategy file

file_history
Destructive

List per-file history or explicitly restore one historical file into the current complete strategy snapshot. Listing is read-only. Restoring creates a new immutable strategy revision and preserves all other current files and Rules; it never restores an old whole snapshot. Use sourceRevisionId and expectedHeadRevisionId from history for restoration, then read back the saved file with get_file.

Set "action" to choose the operation. Only send the fields listed for that action.

action="list": Read one strategy file history

Required fields: path. Returns bounded metadata for actual content, metadata and deletion changes of one owned strategy file, with per-file versions, source strategy revision UUIDs and current headRevisionId. Historical preview is read-only: this tool does not select an editing base, restore files or change conversation strategy state. Omit strategyId and revisionId for the current attached strategy; for another named owned strategy pass its exact legacy Strategy id and revisionId from list_strategies/list_revisions. Preview the intended historical source with get_file before restoring it. matchesCurrentContent identifies entries that would not change current content. Do not mistake fileVersion for the whole strategy version or UUID. Use nextBefore to read older entries. To restore a selected file, use file_history(action="restore") with its source strategyRevisionId and the current headRevisionId. Never copy the old whole snapshot to restore one file.

action="restore": Restore one strategy file

Required fields: sourceRevisionId, path, expectedHeadRevisionId. Restores one explicitly requested historical file into the current complete snapshot and creates a new immutable whole-strategy revision. Get sourceRevisionId and expectedHeadRevisionId from file_history(action="list"); the source and current destination must belong to the same owned strategy. All unrelated current Rules, helpers and dependencies are preserved. Never restore an old whole file map to restore one file. Restoring rules.json explicitly restores that Rules file only; restoring main.py does not restore old Rules. Omit strategyId for the current attached strategy; pass the exact named target legacy Strategy id for another owned strategy. The server uses only trusted conversation identity. A changed head returns a visible conflict: refresh history before retrying. Read back the returned new revisionId with get_file before claiming restoration succeeded.

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": {
      "action": "<action>"
    },
    "name": "file_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoUsed with action="list", action="restore". Required for action="list", action="restore".
limitNoUsed with action="list".
actionYesWhich operation to run: "list", "restore". See the tool description for each one.
beforeNoExclusive per-file version cursor returned by the preceding history page. Used with action="list".
revisionIdNoOwned revision selector. Omit to use the active revision or latest saved revision of strategyId; this is a read selector, not a write base. Used with action="list".
strategyIdNoaction="list": Legacy Strategy id (or exact owned strategy name). Omit with revisionId for the current attached strategy. | action="restore": Legacy Strategy id. Omit for the current attached strategy. Used with action="list", action="restore".
sourceRevisionIdNoExact strategy revision UUID containing the selected historical file, returned by file_history(action="list"). Used with action="restore". Required for action="restore".
expectedHeadRevisionIdNoExact current headRevisionId returned by file_history(action="list"); restoration fails if the strategy advances. Used with action="restore". Required for action="restore".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / revisionId / description
      Previous value: -"Owned revision selector. Omit with strategyId for the current attached strategy; this is a read selector, not a write base. Used with action=\"list\"."New value: +"Owned revision selector. Omit to use the active revision or latest saved revision of strategyId; this is a read selector, not a write base. Used with action=\"list\"."
    • changedInput schema / properties / strategyId / description
      Previous value: -"action=\"list\": Legacy Strategy id. Omit with revisionId for the current attached strategy. | action=\"restore\": Legacy Strategy id. Omit for the current attached strategy. Used with action=\"list\", action=\"restore\"."New value: +"action=\"list\": Legacy Strategy id (or exact owned strategy name). Omit with revisionId for the current attached strategy. | action=\"restore\": Legacy Strategy id. Omit for the current attached strategy. Used with action=\"list\", action=\"restore\"."
    • removedInput schema / properties / strategyId / format
      Removed value: -"uuid"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations mark the tool destructive and non-idempotent, and the description adds substantial context beyond them: which action is read-only, that restore creates a new immutable revision while preserving unrelated files and Rules, that a changed head yields a visible conflict, and that the server relies only on trusted conversation identity. The main residual gap is that it does not discuss rate limits or the exact response payload shape beyond the new revisionId.

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 summary followed by clearly delimited per-action sections makes it scannable despite its length. There is mild redundancy in the repeated 'never restore an old whole snapshot/file map' warnings, and a few sentences could be tightened, but nearly every line carries operational meaning.

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 two-mode, eight-parameter tool with no output schema, the description covers the full call lifecycle: input provenance, preservation guarantees, conflict handling on a changed head, identity trust, and post-restore verification. An agent could invoke both actions correctly without consulting anything else.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes further by explaining the provenance relationship between parameters (sourceRevisionId/expectedHeadRevisionId come from the list action), the omit-strategyId convention for the attached strategy, the meaning of the before cursor for older entries, and the warning not to confuse fileVersion with the whole strategy version.

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 opening sentence names both operations with specific verbs and resources: list per-file history, or restore one historical file into the current strategy snapshot. The two action sections then restate each verb precisely, and the scope is distinguished from related siblings like get_file and whole-snapshot restoration.

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 guidance is given for each action, including prerequisites (sourceRevisionId and expectedHeadRevisionId must come from action="list"), a recommended verification workflow (preview with get_file before restoring, read back with get_file after), and clear exclusions such as 'never restore an old whole snapshot to restore one file' and the note that listing does not select an editing base.

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.