Skip to main content
Glama

Query Database (Read-Only)

query_database
Read-only

Run a READ-ONLY SQL query against the project's Postgres database (SELECT, EXPLAIN, etc.) — the Floot-managed database, or an external Postgres the user connected to the project. Writes are rejected — use execute_sql for those. Returns JSON: {rows, rowCount, command, truncated?} (or {results: [...]} for multi-statement queries). Pass database only if the project has more than one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
databaseNo
projectIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false, openWorldHint), but the description adds genuinely new behavioral detail: write rejection, and the exact return shape including the truncated indicator and multi-statement results array. This is valuable because there is no output schema.

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?

Three sentences, front-loaded with the action and read-only constraint, then routing guidance, then return shape. No filler; every sentence delivers information an agent needs to invoke the tool.

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 annotations covering safety and no output schema, the description fills the remaining gaps by documenting return structure and the write-rejection behavior. Nothing essential to correct invocation is missing.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the burden. It meaningfully explains the non-obvious 'database' parameter's conditional use, while 'query' and 'projectId' are self-evident from name and surrounding context. No syntax guidance for query is given, but the description's framing implies SQL.

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 specific verb (Run) and resource (READ-ONLY SQL query against Postgres), names the accepted statement classes (SELECT, EXPLAIN, etc.), and clarifies both database scopes (Floot-managed vs. external Postgres). It explicitly differentiates itself from the sibling execute_sql for write operations.

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?

Provides an explicit when-not with a routing alternative: 'Writes are rejected — use execute_sql for those.' It also gives conditional guidance for the database parameter ('Pass database only if the project has more than one'), removing the main ambiguity an agent would face.

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.

Resources