Skip to main content
Glama

PostgreSQL MCP by InsightfulPipe

postgresql Data

query_data
Read-only

Query postgresql data (Step 3 (FINAL) of workflow).

REQUIRED: Complete these steps first using query_contexts:

  1. request='accounts' - Get workspace_id, brand_id, connection_slug AND available_actions

  2. request='actions_details' with actions=['xxxxxx', 'xxxxxx', 'xxxxxx'] - Get detailed body structure for specific action(s) using actions from available_actions

IMPORTANT: Always call step 2 to see the exact body structure before querying.

query_data accepts read-only SQL only: a single SELECT (or EXPLAIN) statement. Write statements (INSERT/UPDATE/DELETE/DDL) are rejected here - send them through execute_action.

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": {
      "body": "<body>"
    },
    "name": "query_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description reinforces this with concrete enforcement detail: write statements (INSERT/UPDATE/DELETE/DDL) are rejected at this endpoint. That rejection behavior is genuinely useful and not derivable from annotations. It does not cover result limits, latency, or cost of an open-world query, keeping it short of a 5.

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?

Front-loaded with the workflow position and the read-only constraint, then the prerequisites in numbered form. The numbered steps are dense and purposeful, though the "IMPORTANT: Always call step 2" line partly repeats the preceding step list.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return values need no explanation, and the gating workflow is fully described. The gap is the free-form body: for a tool whose only input is an undocumented nested object, the description should enumerate the expected keys (sql, workspace_id, brand_id, connection_slug) rather than leave them to inference.

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 parameter is an opaque nested object (additionalProperties: true) with 0% schema description coverage, so the description must carry the semantics. It implies the body holds a SQL statement and hints that workspace_id/brand_id/connection_slug come from query_contexts, but never spells out the actual body keys or their shape.

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 concrete verb and resource ("Query postgresql data") and immediately bounds the scope to read-only SQL (a single SELECT or EXPLAIN). It also names the sibling that handles the other case ("Write statements ... send them through execute_action"), so an agent can route without opening either schema.

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 ordered prerequisite chain via query_contexts (accounts, then actions_details) and marks itself as Step 3 (FINAL) of the workflow. It also states the use/avoid boundary in both directions: read-only SQL here, writes to execute_action.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.