Skip to main content
Glama

copy-schema

Destructive

Copies a database schema from a source database to a destination, with plan/apply modes, table filters, and optional row data.

Instructions

dbabrain common.cli copy-schema: A schema to copy from one database into another. server_id (or target) names the server; its connection or host login is completed from this node's inventory and encrypted secret store, so a request carries no password. 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):

  • source: Where the schema is read from: {connection, database_name, schema} - connection is the complete login (db_type, host, port, username, password). The app that calls fills it from its own data/ (dbabrain.lib.data_source...

  • destination: Where it is written: {connection, database_name, schema} - connection is the complete login. The app that calls fills it from its own data/ (dbabrain.lib.data_sources.request_fill); common.cli reads no configuration (...

  • mode: plan | apply.

  • tables: Which tables.

  • include_tables: Only these.

  • exclude_tables: Not these.

  • modules: Which modules.

  • include_modules: Only these.

  • exclude_modules: Not these.

  • with_data: Copy rows too.

  • batch_size: Rows per batch.

  • create_schema: Create it.

  • skip_nonempty_tables: Leave a table with rows alone.

  • map_filegroups: Filegroup mapping.

  • partition_boundaries: Copy partition boundaries.

  • module_passes: Passes over modules.

  • phases: Which phases.

  • plan: A plan to apply.

  • verify: Compare after.

  • report_unsupported: List what cannot be copied.

  • assert_dest_instance: The instance it must be.

  • lock_name: The application lock.

  • lock_timeout_seconds: Waiting for it.

  • target: The machine or instance: a server_id, or <db_type> <ip>[:port].

  • schema: The schema.

  • database_name: One database.

  • timeout_seconds: How long to wait.

  • key: The secret-store passphrase, when not in the environment.

  • key_base64: The same, base64.

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": "copy-schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already declare destructive=true, readOnly=false and openWorld=true, and the description adds real context beyond them: credentials are resolved from local inventory/secret store so no password travels in the request, emergency operations require confirm/reason, and an application lock with a timeout is available. It does not explain failure modes or reversibility of a partial copy, which keeps it from a 5.

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 critical facts (credential sourcing, confirm/reason, plan vs apply) are front-loaded before the field list, which is good structure. But the list contains many redundant one-word restatements and two entries are cut off with ellipses, adding bulk without information.

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?

An output schema exists, so return values need not be explained, and the description does cover credentials, locking, confirmation, and plan/apply for a destructive cross-database operation. It is still incomplete for a destructive tool: nothing says whether a failed apply is partially committed, and the truncated source/destination definitions leave the most important nested structures undefined.

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?

The input schema is a single opaque `request` object with 0% description coverage, so the description is the only source of field semantics, and it does enumerate roughly 25 fields. However, several entries are truncated mid-sentence (source, destination) and many are near-tautological glosses ("tables: Which tables", "include_tables: Only these", "database_name: One database"), so it adds only partial meaning.

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 line states a specific verb and resource: copying a schema from one database into another, and names the source/destination model. It does not differentiate against siblings such as store_schema or copy-files, so it falls short of a 5.

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

Usage Guidelines2/5

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

The only guidance is the `mode: plan | apply` field and the note that emergency-operations commands require `confirm: "yes"` and a `reason`. There is no explicit "use this when..." or when-not guidance relative to alternatives, leaving the agent to infer that plan mode is the safe dry run.

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