Skip to main content
Glama
igorolv

jdbc-mcp-server

inspectQuery

inspectQuery
Read-onlyIdempotent

Parse SQL into an AST summary showing tables, aliases, joins, predicates, ordering, columns, and parameters—without requiring database access.

Instructions

Inspect SQL syntax and structure without accessing a database. Returns a parser-derived AST summary of tables, aliases, expressions, joins, predicates, ordering, columns and parameters; use validateQuery for driver validation or queryLint for metadata-aware advice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
connectionYesDatabase to run against. Call listConnections for valid names; do not guess.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
joinsNoJoin clauses detected in the query.
tablesNoTable references extracted from the query, including CTEs and subqueries where possible.
aliasesNoMap of SQL alias to referenced table or expression.
columnsNoColumn references extracted from all inspectable SQL clauses.
explainNoTrue when the inspected statement is an EXPLAIN statement.
orderByNoORDER BY expressions in the query.
cteNamesNoCommon table expression names declared by the query.
featuresNo
warningsNoWarnings produced while parsing and inspecting the query.
parseableNoTrue when SQL parsing succeeded well enough to produce structured inspection data.
parametersNoSQL placeholders or documented query parameters.
predicatesNoPredicate expressions extracted from WHERE, JOIN, HAVING, and related scopes.
selectItemsNoExpressions in the SELECT list, in output order.
normalizedSqlNoNormalized SQL text produced by parser or usage-catalog indexing.
statementTypeNoTop-level SQL statement type detected by the parser.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description adds the significant behavioral detail that the tool does not access a database and that the result is parser-derived. It also lists what the AST summary contains, giving the agent accurate expectations of the tool's behavior.

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 and front-loaded: purpose, behavioral claim, output, and alternatives all appear in one efficient sentence. Every clause earns its place, with no redundant elaboration.

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 two-parameter parser tool with an output schema and read-only annotations, this description is complete. It covers the tool's scope, output nature, and sibling alternatives, and the remaining connection nuance is at least partially handled by the schema's instructions.

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?

The description explains what the SQL input is used for, but the connection parameter remains ambiguous: the schema says 'Database to run against' while the description says 'without accessing a database.' With only 50% schema description coverage, the description should clarify why the connection is needed despite no database access.

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 names a specific action ('Inspect SQL syntax and structure') and a clear resource (SQL), and immediately distinguishes the tool from close siblings by listing what it returns and by naming validateQuery and queryLint as alternatives. An agent can tell exactly what this tool does without inspecting schemas.

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 explicitly tells the agent when not to use this tool: 'use validateQuery for driver validation or queryLint for metadata-aware advice.' This provides concrete routing among siblings and enough context to select inspectQuery for syntax/structure inspection.

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