Skip to main content
Glama

ct_psql

Run SQL inside a PostgreSQL container via psql. Dry-run first for a plan and classification; confirm to execute with optional automatic snapshot for undo.

Instructions

Run SQL via psql inside a container (as the db OS user). MUTATION-CAPABLE.

Dry-run by default: without confirm=True you get a PLAN — the SQL plus a heuristic read/DML/DDL classification (advisory only) — recorded to the ledger. Re-call with confirm=True to execute.

snapshot=True (UNDO): take an auto-undo snapshot first and WAIT for it; if it can't be made the SQL is NOT run (fail-closed). On success the result carries an undo_point (revert via pve_rollback).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbNoTarget database name.postgres
sqlYesSQL to run via psql inside the container, as the database OS user.
ctidYesNumeric CTID of the container running PostgreSQL (allowlist-scoped).
confirmNoFalse (default) returns a dry-run PLAN; true executes.
snapshotNoTake a fail-closed auto-undo snapshot before running.
proximo_targetNoWhich configured Proxmox target to run this call against — a target name from your multi-target config (a specific PVE/PBS/PMG/PDM box). Omit to use the single/default target from the environment; the selection applies only to this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully discloses mutation capability, dry-run behavior, ledger recording, the need for confirm=True to execute, and the fail-closed snapshot mechanism with undo_point. This is comprehensive and transparent.

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 tightly written with three concise paragraphs, each serving a distinct purpose: purpose statement, dry-run workflow, and snapshot mechanism. No extraneous words; critical information is front-loaded.

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 tool's complexity (mutation with dry-run and snapshot), the description covers all key behavioral aspects: default dry-run, classification, ledger recording, snapshot fail-closed, undo_point, and revert path. The existence of an output schema means return values need not be detailed.

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 input schema already describes each parameter (100% coverage). The description adds value by explaining the overarching workflow (dry-run, confirm, snapshot) and that snapshot yields an undo_point, which goes beyond individual parameter descriptions.

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 the verb 'Run SQL via psql inside a container' and identifies the resource (container running PostgreSQL). It explicitly marks the tool as 'MUTATION-CAPABLE', which distinguishes it from read-only siblings like ct_logs or ct_diagnose.

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 clearly explains the dry-run default behavior and when to use confirm=True vs False, as well as snapshot=True for undo. However, it does not explicitly contrast with ct_exec for running arbitrary commands, leaving some inference to the agent.

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/john-broadway/proximo'

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