Skip to main content
Glama

query_database

Read-only

Rows (and the matching schema) of a database, paginated. Row bodies are NOT included unless "content" is in fields. Use filters to narrow and fields to project only the columns you need — much cheaper on wide tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNonextCursor from the previous page
fieldsNoColumn ids or names (case-insensitive); title is always included. Add "content" for row bodies.
filtersNoBy property value, e.g. {"status": "Done"} or {"col_xxx": ["Tag1"]}
databaseIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYesRows carry `recurring: true` when they belong to a repeating series — call get_page for the rule before changing its rhythm
schemaNoColumn schema (trimmed when projecting with fields)
hasMoreNo
nextCursorNoPass back as cursor to continue

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / cursor / description
      Previous value: -"Pagination cursor from a previous response's nextCursor field"New value: +"nextCursor from the previous page"
    • removedInput schema / properties / databaseId / description
      Removed value: -"Database ID (from list_workspace or search)"
    • changedInput schema / properties / fields / description
      Previous value: -"Only return these columns (match by column id or name, case-insensitive); row title is always included. Add \"content\" to include row markdown bodies (omitted by default). Omit fields for all columns without bodies."New value: +"Column ids or names (case-insensitive); title is always included. Add \"content\" for row bodies."
    • changedInput schema / properties / filters / description
      Previous value: -"Filter rows by property value, e.g. {\"status\": \"Done\"} or {\"col_xxx\": [\"Tag1\"]}"New value: +"By property value, e.g. {\"status\": \"Done\"} or {\"col_xxx\": [\"Tag1\"]}"
    • removedInput schema / properties / limit / description
      Removed value: -"Maximum rows per page (default 50)"
  2. Changed1 schema field changed
    • addedOutput schema / properties / rows / description
      Added value: +"Rows carry `recurring: true` when they belong to a repeating series — call get_page for the rule before changing its rhythm"
  3. Changed5 schema fields changed
    • changedInput schema / properties / fields / description
      Previous value: -"Only return these columns (match by column id or name, case-insensitive); row title is always included. Add \"content\" to include row markdown bodies — otherwise they are omitted. Omit fields entirely for full rows."New value: +"Only return these columns (match by column id or name, case-insensitive); row title is always included. Add \"content\" to include row markdown bodies (omitted by default). Omit fields for all columns without bodies."
    • removedOutput schema / properties / hasMore / description
      Removed value: -"Whether more rows exist beyond this page"
    • changedOutput schema / properties / nextCursor / description
      Previous value: -"Cursor for the next page (present when hasMore)"New value: +"Pass back as cursor to continue"
    • removedOutput schema / properties / rows / description
      Removed value: -"Matching rows on this page"
    • changedOutput schema / properties / schema / description
      Previous value: -"Database column schema (trimmed to the requested fields when projecting)"New value: +"Column schema (trimmed when projecting with fields)"
  4. Changed2 schema fields changed
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Only return these columns (match by column id or name, case-insensitive); row title is always included. Add \"content\" to include row markdown bodies — otherwise they are omitted. Omit fields entirely for full rows.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / schema / description
      Previous value: -"Database column schema"New value: +"Database column schema (trimmed to the requested fields when projecting)"
  5. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already mark it read-only. The description adds meaningful behavioral context: pagination, that row bodies are omitted unless 'content' is in fields, and that using filters/fields is cheaper on wide tables. These go beyond the annotations and help an agent predict behavior and resource usage.

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?

Two sentences with no fluff. The first sentence states the core function and pagination; the second delivers actionable guidance on filters and fields. It is front-loaded and every word contributes.

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?

Given the complexity (5 params, nested filters, output schema), the description covers the key behaviors: returns rows and schema, pagination, filtering, projection, content inclusion, and cost implication. It does not detail cursor usage, but the schema and output schema likely fill that gap. It is complete enough for an agent to call it correctly.

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 schema covers about 60% of parameters (cursor, fields, filters have descriptions). The description reinforces the purpose of filters and fields, and explains the special 'content' value for fields. It does not add detail for limit or databaseId, but the moderate schema coverage means the description partially compensates without being fully comprehensive.

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?

The description states a specific verb and resource: 'Rows (and the matching schema) of a database, paginated.' It clearly identifies the tool's function and distinguishes it from schema-only or page-oriented siblings, though it does not explicitly name any sibling. The purpose is clear but could be sharper about when this tool is the right choice over alternatives.

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?

It gives usage guidance: 'Use filters to narrow and fields to project only the columns you need — much cheaper on wide tables.' This implies when to use it (for querying with filtering/projection) and hints at cost. However, it does not explicitly say when not to use it or mention alternatives like get_database_schema or get_pages, leaving the choice partly to inference.

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.