Skip to main content
Glama
Bollard-db

Bollard MCP

Official
by Bollard-db

preview_query

Preview SQL queries to assess safety, intent, and cost before execution, with automatic LIMIT applied.

Instructions

Dry-run a query through the full safety + intent pipeline.

Returns:

  • Safety verdict (SAFE / BLOCKED with reason)

  • Intent analysis (interpreted intent, assumed filters, ambiguity warnings)

  • EXPLAIN cost estimate (PostgreSQL only)

  • Final SQL with auto-LIMIT applied

For bare SELECT * queries on large tables, Bollard will automatically redirect to profile_table to give the AI richer context with fewer tokens.

The editor AI should call this before execute_query for any non-trivial query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL statement to preview.
connectionYesDatabase alias (from connect_database).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries full burden and does so thoroughly. It discloses the dry-run nature, the specific outputs (safety verdict, intent analysis, cost estimate with PostgreSQL-only caveat, auto-LIMIT), and the redirection behavior. This goes beyond what any schema or annotation would state.

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 concise and well-structured with a clear purpose line, bullet-point return summary, and two behavior/usage notes. Every sentence adds value—no filler or repetition. The front-loading is ideal: immediately states dry-run, then lists outputs, then gives redirection and usage guidance.

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 tool with a rich safety/intent pipeline, the description covers all essential aspects: what it does, return values (even though output schema exists, the summary helps), the PostgreSQL-specific cost estimate, auto-LIMIT behavior, and the redirect to profile_table. It is complete enough for an AI to select and invoke correctly without additional context.

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 coverage is 100% (both sql and connection are described), so baseline is 3. The description does not add additional parameter-level detail beyond the schema's own descriptions. However, it does imply that the sql parameter is transformed (auto-LIMIT) and that connection is a database alias, but these are not parameter-specific enhancements.

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 opens with a specific verb+resource: 'Dry-run a query through the full safety + intent pipeline.' It clearly distinguishes from siblings like execute_query (which actually runs) and profile_table (which is mentioned as a redirect target). The listed return items (safety verdict, intent analysis, EXPLAIN estimate, final SQL) make it unambiguous.

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?

Explicit when-to-use guidance is provided: 'The editor AI should call this before execute_query for any non-trivial query.' It also explains the automatic redirection to profile_table for bare SELECT * on large tables, giving alternatives and context for when that behavior occurs. This is strong usage scoping.

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

Install Server

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/Bollard-db/Bollard'

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