Skip to main content
Glama

finish-staging

Destructive

Finalize staged files by applying their source modification times and configuring folder access for the database engine.

Instructions

dbabrain common.cli finish-staging: The files that just travelled into a staging, to be given their source's times, and the folder to open for the engine. Changes or removes something. A command on the emergency-operations list takes confirm: "yes" and a reason in its request, as on the command line. Request fields (pass them as request):

  • target (required): The target host's SSH login: host, port, username and a RESOLVED password or key_file (an absolute path), open_timeout_seconds - never a secret ref: common resolves nothing; platform: linux (also when absent) or windo...

  • target_dir (required): The staging directory on the target host - on a windows login a drive path (C:/dbabrain_restore/<restore_id>, either separator); a drive path on any other login is refused.

  • files: The files copy-files landed: {path (relative to target_dir), mtime (the source's, epoch seconds; null leaves the file's time alone)} - prepare-staging's pending.

  • open_for_engine: chmod -R a+rX on the target after, for the engine's own uid. Default true. On a windows target nothing is changed: SQL Server's service account reads the folder through its ACL, granted once by the operator.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "finish-staging"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already flag destructive=true and openWorld=true, and the description adds real context beyond them: the confirm/reason gate for emergency-operations commands, the default chmod -R a+rX applied after the fact for the engine's uid, and the important exception that a Windows target changes nothing because access comes via the service account ACL. The generic 'Changes or removes something' is weak, but the chmod and Windows nuances are genuine operational disclosures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The front-loaded opening sentence is good, but the body mixes workflow commentary with field docs sentence-fragment style, and the target field documentation is truncated ('platform: linux (also when absent) or windo...'), which is a real defect in a definition whose value is in those field details. Every sentence is roughly earning its place, but the structure reads as scraped CLI help rather than curated guidance.

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?

Given a single opaque request parameter, a destructive annotation profile, and an existing output schema (so return values need not be explained), the description supplies enough to call the tool correctly: required fields, the confirm/reason gate, and the Windows caveat. It is not fully complete on ordering relative to prepare-staging and on what happens to files not listed in `files`.

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?

The schema exposes only an opaque `request` object with no field documentation, so the description carries the full burden and largely meets it: it enumerates target, target_dir, files (with path/mtime semantics, including null meaning leave time alone), and open_for_engine's default and Windows behavior. Gaps remain, most visibly the truncated `target` description that cuts off mid-sentence at 'or windo...'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names the concrete effect: files that landed in a staging get their source mtimes, and the folder is opened for the engine, with an implicit tie to prepare-staging/copy-files. It is a clear resource-plus-action statement, though phrased as a noun clause rather than an explicit verb on the tool, so an agent must infer 'finalize this staging directory'.

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

Usage Guidelines3/5

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

Workflow placement is only implied by references to 'copy-files landed' and 'prepare-staging's pending', which suggests this runs after both, and the emergency-operations note tells the agent to pass confirm/reason. There is no explicit 'use this when X, not Y' statement or statement of prerequisites such as having already run prepare-staging.

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

Deploy Server

Other Tools