Skip to main content
Glama

OpenCode Backups

opencode_backups
Destructive

Back up the opencode database and config with rotation and disk guard. Create, list, restore, prune, or delete backups to recover data when needed.

Instructions

Backup the opencode database and config with rotation + disk guard; restore when needed.

Return Format

{"success": bool, "message": str, "data": dict}

Examples

opencode_backups(action="status") opencode_backups(action="create", kind="all") opencode_backups(action="list", kind="db") opencode_backups(action="restore", name="opencode-db-20260802-120000.sqlite3", confirm=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoTarget: database, config directory, or both (create/prune)all
nameNoBackup filename (required for restore/delete)
forceNoAllow restore while opencode serve is running
actionYesstatus: paths, free space, counts, last backup. create: take a snapshot of the database (kind=db), config (kind=config), or both (kind=all). list: backups with sizes/dates. prune: drop old backups beyond retention. restore: overwrite the database or config from a backup (confirm=True; refuses while opencode serve is running unless force=True). delete: remove one backup file.
confirmNoMust be True for restore (overwrites live data)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already mark this as destructive (destructiveHint=true, readOnlyHint=false). The description adds context about rotation and disk guard, indicating automatic retention and disk-space checks. Examples show confirm=True for restore, hinting at overwrite semantics, though the schema provides the full safety details.

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 well-structured: a one-sentence summary, a return format block, and four concise examples. All elements are purposeful and front-loaded, with no filler.

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?

Given the rich input schema, output schema, and annotations, the description is complete enough. It covers the high-level purpose, provides usage examples, and the schema fills in action-specific details like restore safety and confirm requirement.

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?

Input schema coverage is 100% with detailed descriptions for all five parameters. The description's examples demonstrate valid parameter combinations and the 'rotation + disk guard' phrase adds meaning to the prune action beyond the schema's retention mention.

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 it backs up the opencode database and config with rotation and disk guard, and supports restore. This distinct purpose is not covered by any sibling tools, which focus on runs, sessions, and status.

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 concrete examples for status, create, list, and restore, showing typical use cases. It says 'restore when needed' as a trigger, but does not explicitly state when not to use the tool or alternatives, though no natural alternatives exist among siblings.

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/sandraschi/opencode-cli-mcp'

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