Skip to main content
Glama

Show the safety rules of a connection

pg_policy
Read-onlyIdempotent

Inspect what a PostgreSQL connection permits—access mode, approvals, limits, function policy, protected tables/columns, denied relations—before planning work or when a statement is refused.

Instructions

Explain what is allowed on a connection: access mode, approval, limits, function policy, protected tables and columns, denied relations.

Read it when a statement is refused, or before planning work on a connection you do not know.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pg_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so safety is fully covered structurally. The description adds a useful enumeration of what the report covers, which no output schema provides. It does not say what the tool does when the connection argument is omitted or whether it errors on an unknown connection, so the behavioral picture remains partial.

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?

Two sentences: the first front-loads the payload the tool returns, the second gives the usage trigger. No filler, no repetition of the title or annotations.

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 and only one optional parameter, the definition does the important work by listing the report's sections so the agent knows what it will learn. The remaining gap is connection resolution when the argument is null, which matters for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the single 'connection' parameter is nullable with a default of null, yet the description never mentions the parameter or what an omitted/null value means (presumably the current connection). For a low-coverage schema the description is expected to compensate, and it does not.

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 names a specific verb (explain/show) and resource (what is allowed on a connection), then enumerates the report contents: access mode, approval, limits, function policy, protected tables and columns, denied relations. That makes the tool's output distinguishable from data-reading siblings. It stops short of explicitly contrasting itself with the nearby privilege/inspection tools (pg_privileges), so it is clear but not fully differentiated.

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 gives two concrete triggering situations: read it when a statement is refused, or before planning work on a connection you do not know. That is actionable usage context with a clear read-only-preamble framing. There is no explicit when-not guidance or named alternative in case the agent needs raw privileges instead.

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