Skip to main content
Glama
eric-patton

postgres-schema-mcp

by eric-patton

Run a read-only query

run_select
Read-onlyIdempotent

Execute single SELECT or WITH queries in a read-only transaction, with results capped and sensitive columns masked, while rejecting any write or stacked statements.

Instructions

Run one SELECT or WITH statement. Anything else is refused, including stacked statements, DDL, DML and SELECT INTO. The query runs in a read-only transaction with a statement timeout, results are capped and secret-looking columns masked. There is no write mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SELECT or WITH statement. No trailing second statement.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.1

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already mark it read-only/idempotent/non-destructive, and the description adds meaningful runtime behavior: read-only transaction, statement timeout, result cap, and masking of secret-looking columns. It also names specific refused statement classes beyond the annotation's safety profile.

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?

Three sentences pack accepted input, refusal classes, execution constraints, and output limits without fluff. A minor redundancy exists across 'no write mode,' readOnlyHint, and the refusal list, but overall the description remains tight and readable.

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?

For a one-parameter query tool, the description covers allowed statements, refusals, execution context, timeout, cap, and masking, so an agent can invoke it correctly. It does not describe return shape, but with no output schema and query-dependent results this is a minor gap.

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 single sql parameter has 100% schema coverage, so the schema already documents 'a single SELECT or WITH statement. No trailing second statement.' The description reinforces the same constraint but does not materially add parameter-level meaning beyond the schema.

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 opens with a specific verb+resource—'Run one SELECT or WITH statement'—and the title reinforces read-only. It clearly distinguishes run_select from the schema-discovery siblings by being the only arbitrary query tool.

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

Usage Guidelines3/5

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

The description clearly states what will be refused and that there is no write mode, so the agent knows when not to attempt DDL/DML. However, it never explicitly contrasts with sibling tools like list_tables or explain_query, leaving 'when to use this instead' to inference.

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

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/eric-patton/postgres-schema-mcp'

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