Skip to main content
Glama

apply_remediation

Destructive

Apply database remediations with mandatory row backups and audit logging, then execute atomic, row-count-locked DML on allowed connections.

Instructions

MANDATORY BACKUP + AUDIT COMMIT: Persists full original row backups (JSON + INSERT SQL + rollback.sql) to audit-backups/, executes atomic row-count-locked DML on allowed connections, and logs field-level changes to change-logs/modification_audit.md & .jsonl.

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": {
      "table": "<table>",
      "where_clause": "<where_clause>",
      "dml_sql": "<dml_sql>",
      "expected_affected_rows": "<expected_affected_rows>"
    },
    "name": "apply_remediation"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes
dml_sqlYes
databaseNoTarget database/schema name on that connection.
connectionNoDBeaver connection name or host (e.g. 'localhost', 'staging-db'). Defaults to default_connection.
where_clauseYes
issue_summaryNo
expected_affected_rowsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and readOnlyHint=false, so the safety profile is covered; the description nevertheless adds real value by naming the on-disk artifacts created (audit-backups/ with JSON, INSERT SQL, rollback.sql), the audit log paths (change-logs/modification_audit.md and .jsonl), and the atomic row-count-locked execution model. What it omits is failure behavior — whether a row-count mismatch aborts before or after DML, and whether the rollback.sql is auto-applied. That gap keeps it below 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.

Conciseness4/5

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

A single dense sentence that front-loads the most decision-relevant fact ('MANDATORY BACKUP + AUDIT COMMIT') and then enumerates the three phases. No filler, though the stacking of file paths into one sentence makes it slightly hard to parse at a glance.

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?

For a destructive, 7-parameter, no-output-schema mutation tool, the description covers side effects and artifacts well but leaves the parameter contract and the response/failure semantics undocumented. An agent could invoke it correctly on the happy path but would be guessing about dialect requirements and what happens when expected_affected_rows does not match.

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

Parameters2/5

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

Schema description coverage is only 29% — only connection and database are documented — so the description must compensate, but it explains none of table, where_clause, dml_sql, issue_summary, or expected_affected_rows. The phrase 'row-count-locked DML' faintly implies expected_affected_rows acts as a safety guard, but the agent gets no statement of which dialect dml_sql accepts, how where_clause interacts with dml_sql, or what issue_summary feeds into the audit log.

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 description names a concrete compound action — persisting row backups, executing row-count-locked DML, and logging field-level changes — so an agent knows this is the tool that actually mutates data, not a preview. It does not name the sibling it supersedes (preview_remediation, open_remediation_in_dbeaver), but the verb+resource is specific enough to distinguish it in practice.

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?

There is no when-to-use / when-not-to-use guidance and no reference to preview_remediation or open_remediation_in_dbeaver as prerequisite alternatives. The only hint at applicability is the phrase 'allowed connections,' which implies a constraint without explaining it or telling the agent how to check eligibility.

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