Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

preview_sql_file

Preview a SQL file to see statement counts, type breakdown, and danger warnings without executing. Understand migration impact before running.

Instructions

Preview a SQL file without executing it. Shows statement count, types breakdown, and warnings for potentially dangerous operations (DROP, TRUNCATE, DELETE/UPDATE without WHERE). Similar to mutation_preview but for SQL files. Use this before execute_sql_file to understand what a migration will do.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute or relative path to the .sql file to preview
stripPatternsNoPatterns to strip from SQL before parsing. E.g., ['/'] for Liquibase, ['GO'] for SQL Server.
stripAsRegexNoIf true, stripPatterns are treated as regex patterns (default: false).
maxStatementsNoMaximum number of statements to show in preview (default: 20, max: 100).
Behavior4/5

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

With no annotations, the description carries the transparency burden. It clearly states it does NOT execute the SQL, and describes the output (statement count, types, warnings). It doesn't mention file access or error handling, but the core behavior is 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?

Three concise sentences: what it does, comparison, and usage recommendation. No wasted words, information front-loaded.

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 no output schema and no annotations, the description gives a solid overview. It explains what the tool does, what output to expect, and when to use it. Could mention return format or error scenarios, but sufficient for typical use.

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?

Schema coverage is 100%, so baseline is 3. The description does not add much beyond the schema; it briefly mentions 'warnings for dangerous operations' but that's more about output than parameters. The schema descriptions are clear enough.

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 'Preview a SQL file without executing it' and lists what it shows (statement count, types breakdown, warnings). It also distinguishes from sibling mutation_preview by specifying 'for SQL files'.

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

Usage Guidelines5/5

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

Explicitly says 'Use this before execute_sql_file to understand what a migration will do.' Also provides context by comparing to mutation_preview, helping the agent decide when to use this tool instead of others.

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/Teja-sudo/postgres-mcp-server'

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