Skip to main content
Glama
raphaeljordao86

guarded-postgres-mcp

snapshot_table

Copy a table into a timestamped backup before destructive changes, enabling manual rollback and returning the snapshot name and row count.

Instructions

Runs CREATE TABLE tmp_[_]_backup_YYYYMMDD AS SELECT * FROM [WHERE ...]. Use it BEFORE a destructive operation so a manual rollback is possible afterwards. The name must fit in 63 bytes. Returns the snapshot table name and the number of rows copied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereNoOptional condition, without the WHERE keyword (e.g. status = 'OPEN'). One condition only: no ";", no data-modifying statements and no setval. Without it the whole table is copied (dangerous on large tables)
sourceYesSource table (e.g. tab_invoice)
suffixNoOptional suffix for the name (e.g. "phase_a") -> tmp_source_phase_a_backup_YYYYMMDD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare it is not read-only and not destructive, which the description is consistent with: it creates a new table plus copies rows. The description adds real behavioral context beyond the annotations—the 63-byte name limit, the generated name pattern, and the return payload (snapshot table name and row count). It does not mention permission requirements or rollback cleanup, keeping it short of 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.

Conciseness5/5

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

Three sentences, front-loaded with the operation itself, followed by usage timing and the return value. Every sentence carries distinct information with no padding.

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?

With no output schema, the description compensates by stating what is returned (snapshot name and row count), and it covers the naming constraint. A minor gap remains around failure behavior or whether the snapshot is dropped later, but for a 3-parameter tool the definition is otherwise sufficient.

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?

Schema coverage is already 100%, so the baseline is 3. The description adds value by explaining how source and suffix combine into the concrete output name (tmp_<source>[_<suffix>]_backup_YYYYMMDD), giving the suffix parameter meaning beyond its schema example.

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 gives the exact operation (CREATE TABLE ... AS SELECT ... FROM <source>) with the derived naming pattern, which unambiguously distinguishes it from sibling tools query, execute, and execute_transaction. An agent knows immediately that this is a table-copy/snapshot operation, not a generic query executor.

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?

It states the key when-to-use condition clearly: 'Use it BEFORE a destructive operation so a manual rollback is possible afterwards.' That is actionable guidance, though it does not explicitly say when NOT to use it or name a preferred alternative sibling.

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