Skip to main content
Glama

Restore backup

restore_backup
Destructive

Restore an app's D1 database from a backup: {app, binding?, backup_id, confirm} with confirm equal to backup_id. Takes a fresh backup first, then replaces the live tables with the dump. Owner only.

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": {
      "app": "<app>",
      "backup_id": "<backup_id>",
      "confirm": "<confirm>"
    },
    "name": "restore_backup"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYesThe app slug.
bindingNoThe D1 binding. Omit to use the app's only declared binding.
confirmYesMust equal `backup_id`: restoring overwrites the live database (a fresh backup is taken first, so a bad restore is itself restorable).
backup_idYesThe backup id to restore, from `list_backups`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, yet the description still adds substantive context: a fresh backup is taken before the destructive step, live tables are replaced with the dump, and the caller must be the owner. That directly answers what gets destroyed, whether a bad restore is recoverable, and what authorization is needed.

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?

Two tight sentences front-load the operation, then the safety and permission facts. The '{app, binding?, backup_id, confirm}' signature is slightly redundant with a fully described schema but reinforces required versus optional at a glance.

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

Completeness4/5

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

For a destructive mutation with no output schema, the description covers the authorization requirement, the pre-restore backup safety net, and the destructive effect. It stops short of saying what a successful call returns (job status, timing) or whether the operation is cancelable mid-flight, which leaves a small gap.

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%, and both the schema and the description document that confirm must equal backup_id and that binding may be omitted to use the app's only declared binding. The description mostly restates the argument tuple rather than adding meaning beyond the schema, so the baseline 3 is correct.

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?

States a specific verb and resource: restore an app's D1 database from a backup, then spells out the exact argument tuple. It is clearly distinguishable from backup_database (creates backups) and from code-oriented siblings like rollback.

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 condition for use is implicit but unmistakable (restoring a database from a backup id obtained from list_backups) and it adds a hard precondition, 'Owner only'. It does not explicitly contrast with rollback, the one sibling an agent might reasonably confuse with this, so it falls short of a 5.

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.