Skip to main content
Glama

query_database

Read-only

Get schema and rows of a database. Row markdown bodies are NOT included by default — add "content" to fields when you need them, or get_page a single row. Optionally filter rows by property values, and project with fields to fetch only the columns you need (much cheaper on wide tables). Supports cursor-based pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum rows per page (default 50)
cursorNoPagination cursor from a previous response's nextCursor field
fieldsNoOnly 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.
filtersNoFilter rows by property value, e.g. {"status": "Done"} or {"col_xxx": ["Tag1"]}
databaseIdYesDatabase ID (from list_workspace or search)

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. 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"
  2. 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)"
  3. 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)"
  4. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds valuable behavioral context: row markdown bodies are omitted by default, fields projection affects cost, and pagination is cursor-based. It doesn't describe the exact response format, but the output schema exists and covers that. The description adds meaningful behavioral detail beyond 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 three sentences with no wasted words. It front-loads the core purpose, then immediately covers the most important behavioral caveat (bodies not included), then provides optimization guidance and pagination info. Every sentence earns its place.

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 read-only query tool with a rich output schema and 100% parameter coverage, the description is complete. It covers the key caveat (bodies omitted), the optimization strategy (fields projection), the pagination mechanism, and the alternative for single rows. An agent has everything it needs to call this tool 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?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds some context about the 'fields' parameter (add 'content' for bodies, cheaper on wide tables) and mentions cursor-based pagination, but it doesn't add significant new meaning beyond the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 description clearly states the tool's function: 'Get schema and rows of a database.' It distinguishes itself from siblings by explicitly noting that row markdown bodies are not included by default and pointing to get_page for a single row. This makes it easy for an agent to understand what this tool does and how it differs from related tools like get_database_schema or get_page.

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?

The description provides explicit guidance on when to use this tool and when to use alternatives: 'add "content" to fields when you need them, or get_page a single row.' It also explains the benefit of projecting with fields ('much cheaper on wide tables') and mentions cursor-based pagination. This is clear, actionable usage guidance.

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.