Skip to main content
Glama

Find Many Rows

db_find_many
Read-onlyIdempotent

Query database rows using filters, column selection, sorting, and pagination to retrieve exactly the data you need.

Instructions

Queries rows from a table with flexible filtering, column selection, sorting, and pagination. This is the primary tool for reading data. All parameters are optional except 'table' — omitting filters returns all rows (up to the limit). The default limit is 50 rows; the maximum is 500. Sensitive columns (passwords, tokens, keys) are automatically redacted in the output.

When to use:

  • "Show me recent orders", "Find users with email containing gmail"

  • "List products sorted by price", "Get page 2 of customers"

  • Any read query that needs filtering, sorting, or pagination

Parameter guidance:

  • where: JSON filter object. Supports operators: eq, neq, gt, gte, lt, lte, contains, startsWith, endsWith, in, notIn. Example: {"status": "active", "age": {"gt": 18}}

  • select: JSON array of column names to return. Example: ["id", "name", "email"]

  • orderBy: JSON object with column name and direction. Example: {"created_at": "desc"}

  • take: max rows to return (default 50, max 500)

  • skip: rows to skip for offset pagination

Behavioral notes:

  • All queries run in a read-only transaction with a configurable timeout (default 10s).

  • The table name is validated against the live schema before query execution.

  • Results include pagination metadata (total count when available).

  • On error, returns a clear message explaining what went wrong.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skipNoRows to skip for pagination
takeNoMax rows to return (default 50, max 500)
tableYesName of the table to query
whereNoJSON filter object, e.g. '{"email":{"contains":"@gmail"}}'
selectNoJSON array of column names, e.g. '["id","email"]'
orderByNoJSON object, e.g. '{"createdAt":"desc"}'
databaseNoName of the database to query (from pgautopilot.json). Omit to use the current default database.
Install Server

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already mark this read-only and idempotent, and the description adds meaningful behavior beyond them: automatic redaction of sensitive columns, read-only transaction timeout, live schema validation, pagination metadata, and error messages. No statement contradicts the annotations.

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?

The description is organized into clear sections: summary, when-to-use examples, parameter guidance, and behavioral notes. It is long but every section adds operational value; no filler or repetition of the schema is present.

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

Completeness5/5

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

For a 7-parameter read tool with no output schema, the description covers invocation, parameter semantics, defaults, limits, security behavior, and error handling. The only minor omission is explicit routing to sibling tools, but the usage examples make the tool's scope sufficiently clear.

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

Parameters5/5

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

Schema coverage is 100%, but the description goes well beyond it by documenting where operators (eq, neq, gt, gte, lt, lte, contains, startsWith, endsWith, in, notIn), providing concrete JSON examples for where/select/orderBy, and stating take default/max. The database parameter is only in the schema, but the schema description is sufficient.

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 first sentence states a specific verb ('Queries rows') and resource ('from a table') and enumerates capabilities: filtering, column selection, sorting, and pagination. The phrase 'primary tool for reading data' helps distinguish it from sibling read tools, and the title 'Find Many Rows' reinforces the many-row semantics.

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?

The 'When to use' section lists concrete natural-language triggers and explicitly says any read query needing filtering, sorting, or pagination. It does not explicitly name alternatives or exclusions (e.g., use db_find_first for a single row), so guidance is clear but not fully contrastive.

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

Other Tools

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/cyberreinxy/pgautopilot'

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