Skip to main content
Glama

Sample rows

sample
Read-onlyIdempotent

Peek at a few real rows from a table to inspect data before writing queries. Returns rows with optional filters and formats.

Instructions

Peek at a few real rows of one table (SELECT * … LIMIT n, in storage order, no sorting) to see what the data looks like before writing a query. Use query instead for specific columns, joins, sorting or aggregates, and count when you only need a number. Returns rows[N]{all columns} plus rows, truncated (true = more rows exist) and ms. Default 20 rows, capped by the server's max rows setting. On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoRows to return (default 20; capped by settings, usually 200).
tableYesTable or view name as returned by `tables`. PostgreSQL tables outside `public` are written schema.table.
whereNoOptional SQL boolean expression WITHOUT the WHERE keyword, e.g. status = 'paid' AND total > 100.
formatNoResult format. Default from settings: toon (compact table: rows[N]{cols}: then one line per row).
databaseNoOptional database to use instead of the connection's default (names from `databases`). Omit to use the default.
connectionYesConnection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.2.2
    • changedInput schema / properties / connection / description
      Previous value: -"Connection name (from `connections`)"New value: +"Connection name exactly as returned by `connections` (e.g. \"shop\"). Unknown or unexposed names return an error."
    • changedInput schema / properties / database / description
      Previous value: -"Database name to use instead of the connection's default (optional)"New value: +"Optional database to use instead of the connection's default (names from `databases`). Omit to use the default."
    • changedInput schema / properties / format / description
      Previous value: -"Result format (default from settings: toon)"New value: +"Result format. Default from settings: toon (compact table: rows[N]{cols}: then one line per row)."
    • changedInput schema / properties / limit / description
      Previous value: -"Rows (default 20)"New value: +"Rows to return (default 20; capped by settings, usually 200)."
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / table / description
      Previous value: -"Table name"New value: +"Table or view name as returned by `tables`. PostgreSQL tables outside `public` are written schema.table."
    • changedInput schema / properties / where / description
      Previous value: -"SQL boolean expression without WHERE"New value: +"Optional SQL boolean expression WITHOUT the WHERE keyword, e.g. status = 'paid' AND total > 100."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real behavioral context on top: unsorted storage-order results, a default of 20 rows capped by the server's max-rows setting, truncation signalling, and the exact failure shape ('isError with error: <reason>', listing refused statement/unknown table/SQL error). It does not cover auth or permission requirements, but for a read-only peek tool that is a minor omission.

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?

Four tight sentences, front-loaded with purpose then alternatives, then return shape, then failure mode. Every sentence carries distinct information with no restatement of the name or title.

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?

With no output schema, the description compensates by describing the return payload (rows[N]{all columns}, rows, truncated flag, ms) and the error contract. For a 6-parameter read tool, nothing an agent needs to call it correctly is missing.

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 limit, table, where, format, database and connection are all documented in the schema itself. The description's 'in storage order, no sorting' implicitly clarifies what `where`/`limit` do and don't control, but adds no syntax or format detail beyond the schema, so the baseline of 3 applies.

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+resource ('Peek at a few real rows of one table') and immediately pins down the exact mechanics (SELECT * ... LIMIT n, storage order, no sorting). An agent can distinguish this from query/count/describe without opening a 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?

Explicitly routes alternatives: 'Use `query` instead for specific columns, joins, sorting or aggregates, and `count` when you only need a number.' Both the when-to-use and the when-not-to-use conditions are named with the sibling that satisfies each.

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