Skip to main content
Glama

diagnose_query

Read-onlyIdempotent

Run a single read-only diagnostic SELECT, SHOW, or DESCRIBE query through a saved DBeaver connection, with timeouts, row caps, and automatic PII masking.

Instructions

Executes a single strictly READ-ONLY diagnostic query (SELECT / SHOW / DESCRIBE) using DBeaver's saved connection inside an engine-enforced READ ONLY transaction with timeout & row caps. Automatically masks PII columns while preserving length, NULL vs empty, and whitespace anomalies.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "diagnose_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
databaseNoTarget database/schema name on that connection.
max_rowsNo
connectionNoDBeaver connection name or host (e.g. 'localhost', 'staging-db'). Defaults to default_connection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, but the description still adds meaningful context: an engine-enforced READ ONLY transaction, timeout and row caps, and automatic PII masking that preserves length, NULL-vs-empty, and whitespace anomalies. The actual timeout and cap values are not given, which keeps this short of a 5.

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 dense sentences, no filler, with the read-only constraint and statement whitelist front-loaded before the masking behavior. Every clause carries operational information an agent needs.

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?

With no output schema, the description does describe the shape of returned data (PII-masked columns with preserved length/NULL/whitespace). Missing are error behavior, the concrete timeout/cap values, and any pagination note, which for a read-only diagnostic tool is a small residual gap.

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 50% – database and connection are documented, while sql and max_rows are not. The description only indirectly illuminates these via 'single' query (one statement per call) and 'row caps' (relating to max_rows), without format or limit details, so it neither compensates for the gap nor adds much beyond the schema.

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?

States a specific verb ('Executes') and resource ('a single strictly READ-ONLY diagnostic query') plus the allowed statement families (SELECT / SHOW / DESCRIBE). The read-only diagnostic framing implicitly separates it from apply_remediation and explain_query, but no sibling is named directly.

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?

Usage is implied by the constraint set (single statement, read-only, diagnostic) rather than stated. There is no explicit 'use this instead of X when Y' guidance and no routing toward explain_query for plans or inspect_schema for metadata.

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