Skip to main content
Glama

Select rows

select_rows
Read-onlyIdempotent

Read rows from a PostgreSQL table using equality filters instead of writing SQL, with schema allowlists, row caps, and automatic redaction of secret-like columns.

Instructions

Read rows from one table with equality filters — no SQL needed, and held to the schema allowlist. Results are capped at POSTGRES_MAX_ROWS; secret-like columns are redacted.

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": {
      "schema": "<schema>",
      "table": "<table>"
    },
    "name": "select_rows"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax rows (capped at POSTGRES_MAX_ROWS)
tableYesTable or view name
whereNoEquality filters, e.g. { "status": "open", "deleted_at": null }
schemaYesSchema name
columnsNoColumns to return (default all)
orderByNoSort order, e.g. [{ "column": "created_at", "desc": true }]

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, non-destructive and open-world, yet the description adds real behavioral facts: enforcement of a schema allowlist, a row cap at POSTGRES_MAX_ROWS, and redaction of secret-like columns. Those details materially change what an agent should expect and are not derivable from structured fields.

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?

A single front-loaded sentence with no wasted wording; the cap and redaction caveats are packed into a short trailing clause.

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 the main risks for a 6-parameter read tool with nested objects and no output schema: allowlist enforcement, truncation, and column redaction. What remains unsaid is the return shape (rows vs. column metadata), a minor gap given the description's otherwise concrete guarantees.

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 description coverage is 100%, so all six parameters including limit, where, columns and orderBy are already documented with examples. The description only reinforces the equality-only nature of where and the row cap, adding little beyond the schema.

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?

States a specific verb and resource ("Read rows from one table") plus the scoping constraint (equality filters only). "No SQL needed" implicitly distinguishes it from run_query without naming it, so sibling differentiation is present but indirect.

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?

Implies usage context (prefer this over raw SQL for simple equality-filtered reads), but gives no explicit when-to-use/when-not rules and names no alternative such as run_query or explain_query for complex reads.

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