Skip to main content
Glama
igorolv

jdbc-mcp-server

validateQuery

validateQuery
Read-onlyIdempotent

Check if a SELECT, WITH, or EXPLAIN statement is valid without executing it: prepares the statement to verify syntax, parameters, and referenced objects. Use to catch errors before running a query.

Instructions

Check whether the database driver accepts a SELECT / WITH / EXPLAIN without executing it: prepares the statement and validates parameters, syntax and referenced objects. Use inspectQuery for parser-only AST inspection or queryLint for advisory metadata/index warnings. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNoPositional parameters for '?' placeholders, in order. Required when SQL contains '?'.
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.
namedParamsNoNamed parameters for ':name' placeholders. Required when SQL contains ':name'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
stageNoValidation stage that failed, such as guard, params, or driver.
validYesTrue when the statement passed guard, parameter, and driver validation.
columnsNoNumber of result columns reported by driver validation when available.
inspectionNoParsed query inspection that underpins validation (opaque; the inspectQuery tool returns the typed form).
parametersNoNumber of SQL parameters expected or validated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds substantial behavioral detail beyond those: 'without executing it', 'prepares the statement', and the specific validation dimensions (parameters, syntax, referenced objects). There is no contradiction with 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 compact, front-loaded with the core action, then adds sibling routing and binding details in two tightly written sentences plus an example. No filler or repetition of schema content; every sentence contributes distinct decision-relevant information.

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?

With an output schema present, return values need no explanation. The description covers what the tool does, what it does not do (execute), how to choose between siblings, and how to bind parameters. Combined with annotations and schema descriptions, an agent has all necessary context to call this tool correctly.

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?

The schema already documents params and namedParams with clear semantics. The description adds value by explaining the mapping between '?' and ':name' placeholders, warning against mixing, and providing a concrete example where the key is the bare name. The sql parameter itself lacks a schema description, but the tool's purpose statement ('SELECT / WITH / EXPLAIN') gives adequate implied meaning.

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 and resource: 'Check whether the database driver accepts a SELECT / WITH / EXPLAIN without executing it.' It then details what validation covers (parameters, syntax, referenced objects) and explicitly contrasts with inspectQuery and queryLint, making the tool's unique role unmistakable.

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 gives direct routing guidance: use inspectQuery for parser-only AST inspection, and queryLint for advisory metadata/index warnings. It also provides binding rules ('never mix') and a concrete example, so the agent knows exactly when and how to invoke this tool versus alternatives.

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