Skip to main content
Glama

Request access to a connection

pg_request_access
Read-onlyIdempotent

Request user approval before accessing a protected PostgreSQL connection such as production, showing the connection, server, and reason so access occurs only with explicit consent.

Instructions

Ask the user to approve the use of a protected connection (for example production).

Call this only when the user explicitly asked for that environment. The user sees a dialog with the connection, the server and your reason. Never use a protected connection as a fallback because another one failed.

user_requested_this_environment matters only for clients that cannot show dialogs: set it to true only if the user named this environment in the conversation.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection": "<connection>",
      "reason": "<reason>"
    },
    "name": "pg_request_access"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYes
connectionYes
user_requested_this_environmentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, and the description adds real behavioral context beyond them: a user-visible dialog containing the connection, server, and the agent's reason. It does not say what happens on denial, timeout, or whether approval is remembered, so it stops short of full transparency.

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 short paragraphs, front-loaded with the core action, then the usage gate, then the one parameter caveat. No filler and every sentence carries a distinct rule.

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?

Covers purpose, gating condition, user-visible effect, and all three parameters for a small tool with no output schema. The only real omission is the outcome when the user declines or the dialog is unavailable, which would matter for an agent deciding how to proceed.

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?

Schema coverage is 0%, so the description must carry parameter meaning, and it largely does: it explains that `reason` is shown to the user, that `connection` names a protected environment such as production, and it gives precise semantics for `user_requested_this_environment` (true only if the user named the environment). It leaves the expected format of `connection` (name vs. URI) unspecified.

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?

States a specific verb and object: asking the user to approve use of a protected connection, with a concrete example (production). It is clearly distinguishable from read-oriented siblings like pg_connections or pg_query, which never prompt the user.

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?

Gives an explicit positive condition (only when the user explicitly asked for that environment) and an explicit prohibition (never as a fallback after another connection failed). It also scopes the conditional flag to clients that cannot render dialogs, which is exactly the kind of when-to-use nuance an agent needs.

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