Skip to main content
Glama
mirenqinggege

postgres-mcp

execute_sql_file

Destructive

Execute SQL migration or DDL scripts as a single atomic transaction; any failure triggers automatic rollback for data integrity.

Instructions

Execute a SQL file containing migration scripts or DDL statements. The entire file is executed as a single transaction - all changes are rolled back if any statement fails. Only available in unrestricted access mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the SQL file to execute

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Beyond the destructiveHint annotation, the description adds key behavioral context: the file executes as a single transaction with rollback on failure, and the requirement for unrestricted access mode. This helps the agent understand side effects and constraints.

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 concise (two sentences) and well-structured: the first sentence states the primary purpose, the second adds critical transactional behavior. No redundant or irrelevant information.

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 the tool has an output schema (not shown), the description appropriately omits return value details. It covers the core behavior (transaction, rollback, access mode). It could mention error handling (e.g., file not found) but is sufficient for most use cases.

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 already provides 100% coverage for the file_path parameter (description: absolute path). The description does not add further meaning beyond stating the file is a SQL file, which is a minor addition.

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 clearly states the tool executes a SQL file for migration/DDL, distinguishing it from inline SQL execution (sibling execute_sql) by specifying file-based input. However, it does not explicitly contrast with siblings.

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 description mentions the tool is only available in unrestricted access mode, providing a usage constraint. However, it lacks guidance on when to use this over execute_sql or other alternatives, and no exclusions or prerequisites.

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/mirenqinggege/postgres-mcp'

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